Refactor/main menu (#416)

* Add basic common_ui background gfx functions

* Move game main menu to separate file

* clang format

* tmp commit basic docs

* clang format

* scope vars and cleanup

* Quick consistency update. Finalize.

This branch is based on: https://github.com/GBALATRO/balatro-gba/pull/363
Co-authored-by: emiyl <me@emiyl.com>

* Simplify global struct

* clang-format

* Add clang-format to subdirs

* Move timer definitions into their own file

* clang-format

* Fix action yml

* docs

* Update for PR

* Move game start to a state

* Remove lag switch

* Remove GameVariables pointer for callbacks

* Make game_vars a global

* move declaration of game vars in header

* Fix multiple game_vars

* fix for pr

* remove change_background in update again

* clang format

* Make bgCallbacks table static const

---------

Co-authored-by: emiyl <me@emiyl.com>
This commit is contained in:
Rickey
2026-04-27 20:04:18 -07:00
committed by GitHub
co-authored by emiyl
parent adca0961f5
commit da988ba7f5
9 changed files with 292 additions and 206 deletions
+37
View File
@@ -0,0 +1,37 @@
/**
* @file main_menu.h
*
* @brief Main menu state functions
*/
#ifndef GAME_MAIN_MENU_H
#define GAME_MAIN_MENU_H
#include "game_variables.h"
/**
* @brief Change the main menu background
*/
void game_main_menu_change_background(void);
/**
* @brief Main menu state initialization
*
* @param vars passed @ref GameVariables struct
*/
void game_main_menu_on_init(void);
/**
* @brief Main menu state update
*
* @param vars passed @ref GameVariables struct
*/
void game_main_menu_on_update(void);
/**
* @brief Main menu cleanup (called when transitioning to game start)
*
* @param vars passed @ref GameVariables struct
*/
void game_main_menu_on_exit(void);
#endif // GAME_MAIN_MENU_H