static void GUI_FactoryWindow_FailScrollList(int16 step) { uint16 i; uint16 y = 32; GUI_FactoryWindow_B495_0F30(); GUI_Mouse_Hide_Safe(); GUI_FactoryWindow_B495_0F30(); for (i = 0; i < 6; i++) { y += step; GFX_Screen_Copy2(72, y, 72, 16, 32, 136, SCREEN_1, SCREEN_0, false); } for (i = 0; i < 6; i++) { y -= step; GFX_Screen_Copy2(72, y, 72, 16, 32, 136, SCREEN_1, SCREEN_0, false); } GUI_Mouse_Show_Safe(); GUI_FactoryWindow_UpdateSelection(true); }
/** * Handles Click event for the list in production window. * * @return True, always. */ bool GUI_Production_List_Click(Widget *w) { GUI_FactoryWindow_B495_0F30(); g_factoryWindowSelected = w->index - 46; GUI_FactoryWindow_DrawDetails(); GUI_FactoryWindow_UpdateSelection(true); return true; }
/** * Handles Click event for the "Up" button in production window. * * @return True, always. */ bool GUI_Production_Up_Click(Widget *w) { bool locdi = false; if (g_factoryWindowSelected != 0) { g_timerTimeout = 10; GUI_FactoryWindow_B495_0F30(); g_factoryWindowSelected--; GUI_FactoryWindow_UpdateSelection(true); locdi = true; } else { if (g_factoryWindowBase != 0) { g_timerTimeout = 10; g_factoryWindowBase--; locdi = true; GUI_FactoryWindow_ScrollList(-1); GUI_FactoryWindow_UpdateSelection(true); } else { locdi = false; GUI_FactoryWindow_DrawDetails(); GUI_FactoryWindow_FailScrollList(-1); } } do { GUI_FactoryWindow_UpdateSelection(false); sleepIdle(); } while (g_timerTimeout != 0); if (locdi) GUI_FactoryWindow_DrawDetails(); GUI_Widget_MakeNormal(w, false); return true; }
/** * Handles Click event for the "Down" button in production window. * * @return True, always. */ bool GUI_Production_Down_Click(Widget *w) { bool locdi = false; if (g_factoryWindowSelected < 3 && (g_factoryWindowSelected + 1) < g_factoryWindowTotal) { g_timerTimeout = 10; GUI_FactoryWindow_B495_0F30(); g_factoryWindowSelected++; GUI_FactoryWindow_UpdateSelection(true); locdi = true; } else { if (g_factoryWindowBase + 4 < g_factoryWindowTotal) { g_timerTimeout = 10; g_factoryWindowBase++; locdi = true; GUI_FactoryWindow_ScrollList(1); GUI_FactoryWindow_UpdateSelection(true); } else { locdi = false; GUI_FactoryWindow_DrawDetails(); GUI_FactoryWindow_FailScrollList(1); } } for (; g_timerTimeout != 0; sleepIdle()) { GUI_FactoryWindow_UpdateSelection(false); } if (locdi) GUI_FactoryWindow_DrawDetails(); GUI_Widget_MakeNormal(w, false); return true; }