MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / MenuOptionsScreen_Update

Function MenuOptionsScreen_Update

src/MenuOptions.c:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133static struct Widget* menuOpts_widgets[MENUOPTS_MAX_OPTS + 1];
134
135static void MenuOptionsScreen_Update(struct MenuOptionsScreen* s, struct ButtonWidget* btn) {
136 struct MenuOptionMetaBool* meta = (struct MenuOptionMetaBool*)btn->meta.ptr;
137 cc_string title; char titleBuffer[STRING_SIZE];
138 String_InitArray(title, titleBuffer);
139
140 String_AppendConst(&title, btn->optName);
141 if (meta->GetText) {
142 String_AppendConst(&title, ": ");
143 meta->GetText(btn, &title);
144 }
145 ButtonWidget_Set(btn, &title, &s->titleFont);
146}
147
148CC_NOINLINE static void MenuOptionsScreen_FreeExtHelp(struct MenuOptionsScreen* s) {
149 Elem_Free(&s->extHelp);

Calls 2

String_AppendConstFunction · 0.85
ButtonWidget_SetFunction · 0.85

Tested by

no test coverage detected