| 2354 | static idCVar* ui_nameVar = nullptr; |
| 2355 | |
| 2356 | void InitGameOptionsMenu() |
| 2357 | { |
| 2358 | ui_nameVar = cvarSystem->Find( "ui_name" ); |
| 2359 | |
| 2360 | // Note: ImGui uses UTF-8 for strings, Doom3 uses ISO8859-1, so we need to translate |
| 2361 | if ( D3_ISO8859_1toUTF8( ui_nameVar->GetString(), playerNameBuf, sizeof(playerNameBuf) ) == nullptr ) { |
| 2362 | // returning NULL means playerNameBuf wasn't big enough - that shouldn't happen, |
| 2363 | // at least the player name input in the original menu only allowed 40 chars |
| 2364 | playerNameBuf[sizeof(playerNameBuf)-1] = '\0'; |
| 2365 | } |
| 2366 | |
| 2367 | InitOptions( gameOptions, IM_ARRAYSIZE(gameOptions) ); |
| 2368 | } |
| 2369 | |
| 2370 | static int PlayerNameInputTextCallback(ImGuiInputTextCallbackData* data) |
| 2371 | { |
no test coverage detected