mirror of https://gitlab.com/drummyfish/anarch.git
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
|
#define SCROLL_PIXELS_PER_FRAME 1
|
||||||
#endif
|
#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;
|
uint16_t scroll = (SFG_game.frame * SCROLL_PIXELS_PER_FRAME) / 64;
|
||||||
|
|
||||||
|
@ -4161,6 +4162,14 @@ void SFG_drawMenu()
|
||||||
if (item == SFG_MENU_ITEM_NONE)
|
if (item == SFG_MENU_ITEM_NONE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if SFG_SIMPLE_MENU
|
||||||
|
if (i != SFG_game.selectedMenuItem)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *text = SFG_menuItemTexts[item];
|
const char *text = SFG_menuItemTexts[item];
|
||||||
|
|
||||||
uint8_t textLen = SFG_textLen(text);
|
uint8_t textLen = SFG_textLen(text);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define SFG_RAYCASTING_MAX_STEPS 20
|
#define SFG_RAYCASTING_MAX_STEPS 20
|
||||||
#define SFG_RAYCASTING_MAX_HITS 5
|
#define SFG_RAYCASTING_MAX_HITS 5
|
||||||
#define SFG_RAYCASTING_SUBSAMPLE 2
|
#define SFG_RAYCASTING_SUBSAMPLE 2
|
||||||
|
#define SFG_SIMPLE_MENU 1
|
||||||
|
|
||||||
#define SFG_DITHERED_SHADOW 0
|
#define SFG_DITHERED_SHADOW 0
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,14 @@
|
||||||
#define SFG_ARDUINO 0
|
#define SFG_ARDUINO 0
|
||||||
#endif
|
#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 ------
|
//------ developer/debug settings ------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue