MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_String_Get_ByIndex

Function GUI_String_Get_ByIndex

src/gui/gui.c:2920–2963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2918}
2919
2920char *GUI_String_Get_ByIndex(int16 stringID)
2921{
2922 extern char g_savegameDesc[5][51];
2923
2924 switch (stringID) {
2925 case -5: case -4: case -3: case -2: case -1: {
2926 char *s = g_savegameDesc[abs((int16)stringID + 1)];
2927 if (*s == '\0') return NULL;
2928 return s;
2929 }
2930
2931 case -10:
2932 stringID = (g_gameConfig.music != 0) ? STR_ON : STR_OFF;
2933 break;
2934
2935 case -11:
2936 stringID = (g_gameConfig.sounds != 0) ? STR_ON : STR_OFF;
2937 break;
2938
2939 case -12: {
2940 static const uint16 gameSpeedStrings[] = {
2941 STR_SLOWEST,
2942 STR_SLOW,
2943 STR_NORMAL,
2944 STR_FAST,
2945 STR_FASTEST
2946 };
2947
2948 stringID = gameSpeedStrings[g_gameConfig.gameSpeed];
2949 } break;
2950
2951 case -13:
2952 stringID = (g_gameConfig.hints != 0) ? STR_ON : STR_OFF;
2953 break;
2954
2955 case -14:
2956 stringID = (g_gameConfig.autoScroll != 0) ? STR_ON : STR_OFF;
2957 break;
2958
2959 default: break;
2960 }
2961
2962 return String_Get_ByIndex(stringID);
2963}
2964
2965static void GUI_StrategicMap_AnimateArrows(void)
2966{

Callers 3

GUI_Window_CreateFunction · 0.85
GUI_Purchase_ShowInvoiceFunction · 0.85

Calls 1

String_Get_ByIndexFunction · 0.85

Tested by

no test coverage detected