mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Convert menu names to be an enum instead of being stringly-typed
Stringly-typed things are bad, because if you make a typo when typing out a string, it's not caught at compile-time. And in the case of this menu system, you'd have to do an excessive amount of testing to uncover any bugs caused by a typo. Why do that when you can just use an enum and catch compile-time errors instead? Also, you can't use switch-case statements on stringly-typed variables. So every menu name is now in the enum Menu::MenuName, but you can simply refer to a menu name by just prefixing it with Menu::. Unfortunately, I've had to change the "continue" menu name to be "continuemenu", because "continue" is a keyword in C and C++. Also, it looks like "timetrialcomplete4" is an unused menu name, even though it was referenced in Render.cpp.
This commit is contained in:
@@ -2534,7 +2534,7 @@ void scriptclass::resetgametomenu()
|
||||
graphics.flipmode = false;
|
||||
obj.entities.clear();
|
||||
graphics.fademode = 4;
|
||||
game.createmenu("gameover");
|
||||
game.createmenu(Menu::gameover);
|
||||
}
|
||||
|
||||
void scriptclass::startgamemode( int t )
|
||||
|
||||
Reference in New Issue
Block a user