mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-28 17:27:23 +02:00
3354a1a352
This adds a function that converts an action (such as interacting in-game) to the corresponding button text ("ENTER", "E") or button glyph (PlayStation triangle, Steam Deck Y, etc). This function currently only gives the existing ENTERs or Es, because I don't know how best to detect controller usage, or whether the game is running on a Steam Deck, or what buttons need to be displayed there. Still, it should now be really easy to adapt the rendering of keyboard keys to consoles, controllers, or rebound keys. To identify the actions that currently need to be displayed, this commit also adds the initial enums for action sets as described by Ethan in a comment in #834 (Jan 18, 2022).
24 lines
444 B
C
24 lines
444 B
C
#ifndef BUTTONGLYPHS_H
|
|
#define BUTTONGLYPHS_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "ActionSets.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
void BUTTONGLYPHS_init(void);
|
|
|
|
bool BUTTONGLYPHS_keyboard_is_available(void);
|
|
bool BUTTONGLYPHS_keyboard_is_active(void);
|
|
const char* BUTTONGLYPHS_get_wasd_text(void);
|
|
const char* BUTTONGLYPHS_get_button(ActionSet actionset, Action action);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // BUTTONGLYPHS_H
|