mirror of
https://github.com/brianstrauch/solitaire-tui.git
synced 2024-12-25 21:58:52 +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] {
|
switch deckTypes[i] {
|
||||||
case stock:
|
case stock:
|
||||||
if deck.Size() > 0 {
|
if deck.Size() > 0 {
|
||||||
s.draw(3, deck, s.decks[waste])
|
s.draw(1, deck, s.decks[waste])
|
||||||
} else {
|
} else {
|
||||||
s.draw(s.decks[waste].Size(), s.decks[waste], deck)
|
s.draw(s.decks[waste].Size(), s.decks[waste], deck)
|
||||||
}
|
}
|
||||||
|
@ -139,8 +139,7 @@ func (s *Solitaire) click(x, y int) {
|
||||||
}
|
}
|
||||||
deck.Top().Flip()
|
deck.Top().Flip()
|
||||||
} else if s.selected != nil && s.selected.deck != i {
|
} else if s.selected != nil && s.selected.deck != i {
|
||||||
ok := s.move(&index{deck: i, card: j})
|
if !s.move(&index{deck: i, card: j}) && deck.Size() > 0 {
|
||||||
if !ok {
|
|
||||||
s.toggleSelect(nil)
|
s.toggleSelect(nil)
|
||||||
s.toggleSelect(&index{deck: i, card: j})
|
s.toggleSelect(&index{deck: i, card: j})
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (d *Deck) View() string {
|
||||||
|
|
||||||
// Outline
|
// Outline
|
||||||
if d.Size() == 0 {
|
if d.Size() == 0 {
|
||||||
return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#EEEEEE", Dark: "#888888"})
|
return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#CCCCCC", Dark: "#888888"})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expanded cards
|
// Expanded cards
|
||||||
|
|
Loading…
Reference in a new issue