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

Function GUI_HallOfFame_CreateButtons

src/gui/gui.c:4208–4253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4206}
4207
4208static Widget *GUI_HallOfFame_CreateButtons(HallOfFameStruct *data)
4209{
4210 const char *resumeString;
4211 const char *clearString;
4212 Widget *wClear;
4213 Widget *wResume;
4214 uint16 width;
4215
4216 memcpy(s_temporaryColourBorderSchema, s_colourBorderSchema, sizeof(s_colourBorderSchema));
4217 memcpy(s_colourBorderSchema, s_HOF_ColourBorderSchema, sizeof(s_colourBorderSchema));
4218
4219 resumeString = String_Get_ByIndex(STR_RESUME_GAME2);
4220 clearString = String_Get_ByIndex(STR_CLEAR_LIST);
4221
4222 width = max(Font_GetStringWidth(resumeString), Font_GetStringWidth(clearString)) + 6;
4223
4224 /* "Clear List" */
4225 wClear = GUI_Widget_Allocate(100, *clearString, 160 - width - 18, 180, 0xFFFE, STR_CLEAR_LIST);
4226 wClear->width = width;
4227 wClear->height = 10;
4228 wClear->clickProc = &GUI_Widget_HOF_ClearList_Click;
4229 memset(&wClear->flags, 0, sizeof(wClear->flags));
4230 wClear->flags.requiresClick = true;
4231 wClear->flags.clickAsHover = true;
4232 wClear->flags.loseSelect = true;
4233 wClear->flags.notused2 = true;
4234 wClear->flags.buttonFilterLeft = 4;
4235 wClear->flags.buttonFilterRight = 4;
4236 wClear->data = data;
4237
4238 /* "Resume Game" */
4239 wResume = GUI_Widget_Allocate(101, *resumeString, 178, 180, 0xFFFE, STR_RESUME_GAME2);
4240 wResume->width = width;
4241 wResume->height = 10;
4242 wResume->clickProc = &GUI_Widget_HOF_Resume_Click;
4243 memset(&wResume->flags, 0, sizeof(wResume->flags));
4244 wResume->flags.requiresClick = true;
4245 wResume->flags.clickAsHover = true;
4246 wResume->flags.loseSelect = true;
4247 wResume->flags.notused2 = true;
4248 wResume->flags.buttonFilterLeft = 4;
4249 wResume->flags.buttonFilterRight = 4;
4250 wResume->data = data;
4251
4252 return GUI_Widget_Insert(wClear, wResume);
4253}
4254
4255static void GUI_HallOfFame_DeleteButtons(Widget *w)
4256{

Callers 1

GUI_HallOfFame_ShowFunction · 0.85

Calls 4

String_Get_ByIndexFunction · 0.85
Font_GetStringWidthFunction · 0.85
GUI_Widget_AllocateFunction · 0.85
GUI_Widget_InsertFunction · 0.85

Tested by

no test coverage detected