1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00
VVVVVV/desktop_version/src/ActionSets.h
Dav999-v 3354a1a352 Add support for button glyph display
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).
2023-03-21 19:59:48 -07:00

81 lines
1.5 KiB
C

/* For now, this isn't really a foundation for action sets yet; button glyphs
* just need to be able to identify actions that are printed in text like
* "Press ENTER to teleport". Thus, this currently ONLY contains identifiers
* for the actions that button glyphs are needed for.
*
* Based on this comment:
* https://github.com/TerryCavanagh/VVVVVV/issues/834#issuecomment-1015692161
*/
#ifndef ACTIONSETS_H
#define ACTIONSETS_H
#ifdef __cplusplus
extern "C"
{
#endif
/*----------------------------------------*
* List of all action sets (all "states") *
*----------------------------------------*/
typedef enum
{
//ActionSet_Global,
//ActionSet_Menu,
ActionSet_InGame
//ActionSet_Editor
}
ActionSet;
/*----------------------------------------------------------*
* An enum for each actionset, with the actions in that set *
*----------------------------------------------------------*/
/*
typedef enum
{
Action_Global_Mute,
Action_Global_MuteMusic
}
Action_Global;
*/
typedef enum
{
Action_InGame_Interact,
Action_InGame_Map
}
Action_InGame;
/*
typedef enum
{
//Action_Editor_PrevTool,
//Action_Editor_NextTool
}
Action_Editor;
*/
/*-----------------------------------------*
* A union to represent any actionset enum *
*-----------------------------------------*/
typedef union
{
int intval;
//Action_Global Global;
Action_InGame InGame;
//Action_Editor Editor;
}
Action;
#ifdef __cplusplus
} // extern "C"
#endif
#endif // ACTIONSETS_H