3 class BetDialog : Window
5 background = activeBorder;
8 size = Size { 160 }, clientSize.h = 80;
12 this, isDefault = true, text = "Bet", hotKey = altB;
13 size = Size { 40, 20 };
14 anchor = Anchor { horz = -20, top = 40 };
16 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
18 RuffGame * game = &((Ruff)master).game;
19 Round * round = &game->rounds[game->round];
21 int bet = atoi(edit.contents);
22 if(bet >= 40 && bet <= 100 && !(bet%5) && bet >= round->bet.howMuch &&
23 (game->turn == round->shuffle || bet > round->bet.howMuch))
31 this, text = "Pass", hotKey = altP;
32 anchor = Anchor { horz = 20, top = 40 };
33 size = Size { 40, 20 };
34 NotifyClicked = ButtonCloseDialog;
37 EditBox edit { this, size = Size { 80, 20 }, anchor = Anchor { top = 10 }; };
47 RuffGame * game = &((Ruff)master).game;
48 Round * round = &game->rounds[game->round];
51 pass.disabled = false;
52 if(game->turn == round->shuffle)
54 if(!round->bet.howMuch)
56 edit.Printf("%d", 40);
60 edit.Printf("%d", round->bet.howMuch);
64 if(round->bet.howMuch)
66 if(round->bet.howMuch < 100)
67 edit.Printf("%d", round->bet.howMuch + 5);
70 edit.Printf("%d", 40);
75 bool OnKeyDown(Key key, unichar ch)
82 pass.NotifyClicked(this, pass, 0, 0, key.modifiers);