mirror of
https://github.com/brianstrauch/solitaire-tui.git
synced 2024-12-24 21:58:51 +01:00
draw 1 and fix bug
This commit is contained in:
parent
32847475aa
commit
d8d6082484
2 changed files with 3 additions and 4 deletions
|
@ -109,7 +109,7 @@ func (s *Solitaire) click(x, y int) {
|
|||
switch deckTypes[i] {
|
||||
case stock:
|
||||
if deck.Size() > 0 {
|
||||
s.draw(3, deck, s.decks[waste])
|
||||
s.draw(1, deck, s.decks[waste])
|
||||
} else {
|
||||
s.draw(s.decks[waste].Size(), s.decks[waste], deck)
|
||||
}
|
||||
|
@ -139,8 +139,7 @@ func (s *Solitaire) click(x, y int) {
|
|||
}
|
||||
deck.Top().Flip()
|
||||
} else if s.selected != nil && s.selected.deck != i {
|
||||
ok := s.move(&index{deck: i, card: j})
|
||||
if !ok {
|
||||
if !s.move(&index{deck: i, card: j}) && deck.Size() > 0 {
|
||||
s.toggleSelect(nil)
|
||||
s.toggleSelect(&index{deck: i, card: j})
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ func (d *Deck) View() string {
|
|||
|
||||
// Outline
|
||||
if d.Size() == 0 {
|
||||
return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#EEEEEE", Dark: "#888888"})
|
||||
return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#CCCCCC", Dark: "#888888"})
|
||||
}
|
||||
|
||||
// Expanded cards
|
||||
|
|
Loading…
Reference in a new issue