Merge pull request #66 from cellos51/bug_fixes
Fixed a bug where selecting discard with 0 discards would toggle card select and extracted function game_playing_process_hand_select_input() from game_playing_process_input_and_state()
This commit is contained in:
+9
-4
@@ -1038,10 +1038,8 @@ void game_init()
|
||||
tte_printf("#{P:%d,%d; cx:0xC000}%d#{cx:0xF000}/%d", ANTE_TEXT_RECT.left, ANTE_TEXT_RECT.top, ante, MAX_ANTE); // Ante
|
||||
}
|
||||
|
||||
static void game_playing_process_input_and_state()
|
||||
static void game_playing_process_hand_select_input()
|
||||
{
|
||||
if (hand_state == HAND_SELECT)
|
||||
{
|
||||
static bool discard_button_highlighted = false; // true = play button highlighted, false = discard button highlighted
|
||||
|
||||
if (key_hit(KEY_LEFT))
|
||||
@@ -1120,18 +1118,25 @@ static void game_playing_process_input_and_state()
|
||||
{
|
||||
memcpy16(&pal_bg_mem[1], &pal_bg_mem[7], 1); // Play button highlight color
|
||||
memcpy16(&pal_bg_mem[9], &pal_bg_mem[12], 1); // Discard button highlight color
|
||||
}
|
||||
|
||||
if (key_hit(SELECT_CARD))
|
||||
{
|
||||
hand_select();
|
||||
set_hand();
|
||||
}
|
||||
}
|
||||
|
||||
if (key_hit(SORT_HAND))
|
||||
{
|
||||
hand_change_sort();
|
||||
}
|
||||
}
|
||||
|
||||
static void game_playing_process_input_and_state()
|
||||
{
|
||||
if (hand_state == HAND_SELECT)
|
||||
{
|
||||
game_playing_process_hand_select_input();
|
||||
}
|
||||
else if (play_state == PLAY_ENDING)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user