MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / DrawGameOptionsMenu

Function DrawGameOptionsMenu

neo/framework/Dhewm3SettingsMenu.cpp:2389–2412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2387}
2388
2389void DrawGameOptionsMenu()
2390{
2391 ImGui::Spacing();
2392
2393 ImGuiInputTextFlags flags = ImGuiInputTextFlags_CallbackEdit | ImGuiInputTextFlags_CallbackCharFilter;
2394 if ( ImGui::InputText( "Player Name", playerNameBuf, sizeof(playerNameBuf), flags, PlayerNameInputTextCallback )
2395 && playerNameBuf[0] != '\0' )
2396 {
2397 char playerNameIso[128] = {};
2398 if ( D3_UTF8toISO8859_1( playerNameBuf, playerNameIso, sizeof(playerNameIso), '!' ) != NULL ) {
2399 playerNameIso[40] = '\0'; // limit to 40 chars, like the original menu
2400 ui_nameVar->SetString( playerNameIso );
2401 // update the playerNameBuf to reflect the name as it is now: limited to 40 chars
2402 // and possibly containing '!' from non-translatable unicode chars
2403 D3_ISO8859_1toUTF8( ui_nameVar->GetString(), playerNameBuf, sizeof(playerNameBuf) );
2404 } else {
2405 D3::ImGuiHooks::ShowWarningOverlay( "Player Name way too long (max 40 chars) or contains invalid UTF-8 encoding!" );
2406 playerNameBuf[0] = '\0';
2407 }
2408 }
2409 AddTooltip( "ui_name" );
2410
2411 DrawOptions( gameOptions, IM_ARRAYSIZE(gameOptions) );
2412}
2413
2414
2415static bool showStyleEditor = false;

Callers 1

Calls 7

D3_UTF8toISO8859_1Function · 0.85
D3_ISO8859_1toUTF8Function · 0.85
AddTooltipFunction · 0.85
DrawOptionsFunction · 0.85
ShowWarningOverlayFunction · 0.50
SetStringMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected