mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2025-01-30 14:50:13 -05:00
Improve menu
This commit is contained in:
parent
c762a09909
commit
5d3965772b
11
game.h
11
game.h
@ -4133,7 +4133,8 @@ void SFG_drawMenu()
|
||||
#define SCROLL_PIXELS_PER_FRAME 1
|
||||
#endif
|
||||
|
||||
#define SELECTION_START_X (SFG_GAME_RESOLUTION_X / 5)
|
||||
#define SELECTION_START_X ((SFG_GAME_RESOLUTION_X - 12 * SFG_FONT_SIZE_MEDIUM\
|
||||
* (SFG_FONT_CHARACTER_SIZE + 1)) / 2)
|
||||
|
||||
uint16_t scroll = (SFG_game.frame * SCROLL_PIXELS_PER_FRAME) / 64;
|
||||
|
||||
@ -4161,6 +4162,14 @@ void SFG_drawMenu()
|
||||
if (item == SFG_MENU_ITEM_NONE)
|
||||
break;
|
||||
|
||||
#if SFG_SIMPLE_MENU
|
||||
if (i != SFG_game.selectedMenuItem)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *text = SFG_menuItemTexts[item];
|
||||
|
||||
uint8_t textLen = SFG_textLen(text);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#define SFG_RAYCASTING_MAX_STEPS 20
|
||||
#define SFG_RAYCASTING_MAX_HITS 5
|
||||
#define SFG_RAYCASTING_SUBSAMPLE 2
|
||||
#define SFG_SIMPLE_MENU 1
|
||||
|
||||
#define SFG_DITHERED_SHADOW 0
|
||||
|
||||
|
@ -340,6 +340,14 @@
|
||||
#define SFG_ARDUINO 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
If set, the menu will only display the selected item. This is good for very
|
||||
small resolution screens that can't display all items at once.
|
||||
*/
|
||||
#ifndef SFG_SIMPLE_MENU
|
||||
#define SFG_SIMPLE_MENU 0
|
||||
#endif
|
||||
|
||||
//------ developer/debug settings ------
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user