@@ -327,11 +327,11 @@ namespace {
327
327
bool nothingToClear = false ;
328
328
if ( bindIdx == BIND_ALL ) {
329
329
if ( bindings.Num () == 0 ) {
330
- D3::ImGuiHooks:: ShowWarningOverlay ( " No keys are bound to this command, so there's nothing to unbind" );
330
+ imguiLocal. ShowWarningOverlay ( " No keys are bound to this command, so there's nothing to unbind" );
331
331
nothingToClear = true ;
332
332
}
333
333
} else if ( bindIdx < 0 || bindIdx >= bindings.Num () || bindings[bindIdx].keyNum == -1 ) {
334
- D3::ImGuiHooks:: ShowWarningOverlay ( " No bound key selected for unbind" );
334
+ imguiLocal. ShowWarningOverlay ( " No bound key selected for unbind" );
335
335
nothingToClear = true ;
336
336
}
337
337
@@ -829,7 +829,7 @@ namespace {
829
829
ImGuiIO& io = ImGui::GetIO ();
830
830
831
831
if ( newOpen ) {
832
- D3::ImGuiHooks:: SetKeyBindMode ( true );
832
+ imguiLocal. SetKeyBindMode ( true );
833
833
834
834
// disable keyboard and gamepad input while the bind popup is open
835
835
// (the mouse can still be used to click the Cancel button, and Escape
@@ -873,7 +873,7 @@ namespace {
873
873
ImGui::CloseCurrentPopup ();
874
874
ret = BESS_Selected;
875
875
io.ConfigFlags |= (ImGuiConfigFlags_NavEnableGamepad | ImGuiConfigFlags_NavEnableKeyboard);
876
- D3::ImGuiHooks:: SetKeyBindMode ( false );
876
+ imguiLocal. SetKeyBindMode ( false );
877
877
} else if ( !newOpen ) {
878
878
// find out if any key is pressed and bind that (except for Esc which can't be
879
879
// bound and is already handled though IsCancelKeyPressed() above)
@@ -905,7 +905,7 @@ namespace {
905
905
pressedKey = K_RIGHT_SHIFT;
906
906
}
907
907
908
- D3::ImGuiHooks:: SetKeyBindMode ( false );
908
+ imguiLocal. SetKeyBindMode ( false );
909
909
910
910
const char * oldBinding = idKeyInput::GetBinding ( pressedKey );
911
911
if ( oldBinding[0 ] == ' \0 ' ) {
@@ -920,7 +920,7 @@ namespace {
920
920
const char * keyName = GetKeyName ( pressedKey );
921
921
idStr warning = idStr::Format ( " Key '%s' is already bound to this command (%s)!" ,
922
922
keyName, displayName.c_str () );
923
- D3::ImGuiHooks:: ShowWarningOverlay ( warning );
923
+ imguiLocal. ShowWarningOverlay ( warning );
924
924
ret = BESS_Selected;
925
925
// TODO: select column with that specific binding?
926
926
} else {
@@ -1636,7 +1636,7 @@ namespace {
1636
1636
// this was just set with GLimp_SetSwapInterval(), no reason to set it again in R_CheckCvars()
1637
1637
r_swapInterval.ClearModified ();
1638
1638
} else {
1639
- D3::ImGuiHooks:: ShowWarningOverlay ( " Setting VSync (GL SwapInterval) failed, maybe try another mode" );
1639
+ imguiLocal. ShowWarningOverlay ( " Setting VSync (GL SwapInterval) failed, maybe try another mode" );
1640
1640
}
1641
1641
} else {
1642
1642
AddTooltip ( " r_swapInterval" );
@@ -1685,7 +1685,7 @@ namespace {
1685
1685
cvar.SetBool ( enable );
1686
1686
if ( enable && r_enableDepthCapture.GetInteger () == 0 ) {
1687
1687
r_enableDepthCapture.SetInteger (-1 );
1688
- D3::ImGuiHooks:: ShowWarningOverlay ( " Capturing the Depth Buffer was disabled.\n Enabled it because soft particles need it!" );
1688
+ imguiLocal. ShowWarningOverlay ( " Capturing the Depth Buffer was disabled.\n Enabled it because soft particles need it!" );
1689
1689
}
1690
1690
}
1691
1691
const char * descr = " ! Can slow down rendering !\n Soften particle transitions when player walks through them or they cross solid geometry. Needs r_enableDepthCapture." ;
@@ -1700,7 +1700,7 @@ namespace {
1700
1700
cvar.SetInteger ( sel );
1701
1701
if ( sel == 0 && r_useSoftParticles.GetBool () ) {
1702
1702
r_useSoftParticles.SetBool ( false );
1703
- D3::ImGuiHooks:: ShowWarningOverlay ( " You disabled capturing the Depth Buffer.\n Disabling Soft Particles because they need the depth buffer texture." );
1703
+ imguiLocal. ShowWarningOverlay ( " You disabled capturing the Depth Buffer.\n Disabling Soft Particles because they need the depth buffer texture." );
1704
1704
}
1705
1705
}
1706
1706
AddCVarOptionTooltips ( cvar );
@@ -2030,7 +2030,7 @@ namespace {
2030
2030
} else {
2031
2031
idSoundSystemLocal::s_device.SetString ( alDevices[selAlDevice] );
2032
2032
}
2033
- D3::ImGuiHooks:: ShowWarningOverlay ( " Changing the sound device only takes effect after restarting the game!" );
2033
+ imguiLocal. ShowWarningOverlay ( " Changing the sound device only takes effect after restarting the game!" );
2034
2034
}
2035
2035
AddTooltip ( " s_device" );
2036
2036
@@ -2045,7 +2045,7 @@ namespace {
2045
2045
if ( ImGui::Checkbox ( " Use EAX/EFX Reverb Effects" , &useReverb ) ) {
2046
2046
idSoundSystemLocal::s_useEAXReverb.SetBool ( useReverb );
2047
2047
if ( useReverb != idSoundSystemLocal::useEFXReverb ) {
2048
- D3::ImGuiHooks:: ShowWarningOverlay ( " Enabling/disabling EFX only takes effect after restarting the game!" );
2048
+ imguiLocal. ShowWarningOverlay ( " Enabling/disabling EFX only takes effect after restarting the game!" );
2049
2049
}
2050
2050
}
2051
2051
AddTooltip ( " s_useEAXReverb" );
@@ -2289,7 +2289,7 @@ namespace {
2289
2289
// and possibly containing '?' from non-translatable unicode chars
2290
2290
D3_ISO8859_1toUTF8 ( ui_nameVar->GetString (), playerNameBuf, sizeof (playerNameBuf) );
2291
2291
} else {
2292
- D3::ImGuiHooks:: ShowWarningOverlay ( " Player Name way too long (max 40 chars) or contains invalid UTF-8 encoding!" );
2292
+ imguiLocal. ShowWarningOverlay ( " Player Name way too long (max 40 chars) or contains invalid UTF-8 encoding!" );
2293
2293
playerNameBuf[0 ] = ' \0 ' ;
2294
2294
}
2295
2295
}
@@ -2303,23 +2303,23 @@ namespace {
2303
2303
2304
2304
static void DrawOtherOptionsMenu ( void ) {
2305
2305
ImGui::Spacing ();
2306
- float scale = D3::ImGuiHooks:: GetScale ();
2306
+ float scale = imguiLocal. GetScale ();
2307
2307
if ( ImGui::DragFloat (" ImGui scale" , &scale, 0 .005f , 0 .25f , 8 .0f , " %.3f" ) ) {
2308
- D3::ImGuiHooks:: SetScale ( scale );
2308
+ imguiLocal. SetScale ( scale );
2309
2309
}
2310
2310
ImGui::SameLine ();
2311
2311
if ( ImGui::Button (" Reset" ) ) {
2312
- D3::ImGuiHooks:: SetScale ( -1 .0f );
2312
+ imguiLocal. SetScale ( -1 .0f );
2313
2313
}
2314
2314
2315
2315
int style_idx = imgui_style.GetInteger ();
2316
2316
if ( ImGui::Combo ( " ImGui Style" , &style_idx, " dhewm3\0 ImGui Default\0 Userstyle\0 " ) )
2317
2317
{
2318
2318
switch ( style_idx )
2319
2319
{
2320
- case 0 : D3::ImGuiHooks:: SetImGuiStyle ( D3::ImGuiHooks::Style ::Dhewm3 ); break ;
2321
- case 1 : D3::ImGuiHooks:: SetImGuiStyle ( D3::ImGuiHooks::Style ::ImGui_Default ); break ;
2322
- case 2 : D3::ImGuiHooks:: SetImGuiStyle ( D3::ImGuiHooks::Style ::User ); break ;
2320
+ case 0 : imguiLocal. SetImGuiStyle ( idImGuiStyle ::Dhewm3 ); break ;
2321
+ case 1 : imguiLocal. SetImGuiStyle ( idImGuiStyle ::ImGui_Default ); break ;
2322
+ case 2 : imguiLocal. SetImGuiStyle ( idImGuiStyle ::User ); break ;
2323
2323
}
2324
2324
imgui_style.SetInteger ( style_idx );
2325
2325
}
@@ -2331,14 +2331,14 @@ namespace {
2331
2331
ImGui::SameLine ();
2332
2332
2333
2333
if ( ImGui::Button ( " Write Userstyle" ) ) {
2334
- D3::ImGuiHooks:: WriteUserStyle ();
2334
+ imguiLocal. WriteUserStyle ();
2335
2335
imgui_style.SetInteger ( 2 );
2336
2336
}
2337
2337
AddTooltip ( " Writes the current style settings (incl. colors) as userstyle" );
2338
2338
2339
2339
static bool onlyChanges = false ;
2340
2340
if ( ImGui::Button ( " Copy style code to clipboard" ) ) {
2341
- D3::ImGuiHooks:: CopyCurrentStyle ( onlyChanges );
2341
+ imguiLocal. CopyCurrentStyle ( onlyChanges );
2342
2342
}
2343
2343
AddTooltip ( " Generates C++ code for the current style settings (incl. colors) and copies it into the clipboard" );
2344
2344
@@ -2350,7 +2350,7 @@ namespace {
2350
2350
ImGui::Spacing ();
2351
2351
2352
2352
if ( ImGui::Button ( " Show ImGui Demo" ) ) {
2353
- D3::ImGuiHooks:: OpenWindow ( D3::ImGuiHooks::D3_ImGuiWin_Demo );
2353
+ imguiLocal. OpenWindow ( idImGuiWindow::WINDOW_DEMO );
2354
2354
}
2355
2355
}
2356
2356
} // anon namespace
@@ -2386,7 +2386,7 @@ static void InitSettingsMenu( void ) {
2386
2386
settingsWinInitialized = true ;
2387
2387
}
2388
2388
2389
- // called from D3::ImGuiHooks:: NewFrame() (if this window is enabled)
2389
+ // called from imguiLocal. NewFrame() (if this window is enabled)
2390
2390
void Com_DrawSettingsMenu ( void ) {
2391
2391
bool showSettingsWindow = true ;
2392
2392
@@ -2469,14 +2469,14 @@ void Com_DrawSettingsMenu( void ) {
2469
2469
2470
2470
ImGui::End ();
2471
2471
if ( !showSettingsWindow ) {
2472
- D3::ImGuiHooks:: CloseWindow ( D3::ImGuiHooks::D3_ImGuiWin_Settings );
2472
+ imguiLocal. CloseWindow ( idImGuiWindow::WINDOW_SETTINGS );
2473
2473
}
2474
2474
}
2475
2475
2476
2476
/* !
2477
2477
WARNING: Don't call this function directly, always use
2478
- D3::ImGuiHooks:: OpenWindow( D3::ImGuiHooks::D3_ImGuiWin_Settings )
2479
- or D3::ImGuiHooks:: CloseWindow( D3::ImGuiHooks::D3_ImGuiWin_Settings )
2478
+ imguiLocal. OpenWindow( idImGuiWindow::WINDOW_SETTINGS )
2479
+ or imguiLocal. CloseWindow( idImGuiWindow::WINDOW_SETTINGS )
2480
2480
(unless you're implementing those two functions, they call this..)
2481
2481
*/
2482
2482
void Com_OpenCloseSettingsMenu ( bool open ) {
@@ -2505,14 +2505,14 @@ void Com_OpenCloseSettingsMenu( bool open ) {
2505
2505
}
2506
2506
2507
2507
void Com_Settings_f ( const idCmdArgs &args ) {
2508
- bool menuOpen = ( D3::ImGuiHooks:: GetOpenWindowsMask () & D3::ImGuiHooks::D3_ImGuiWin_Settings ) != 0 ;
2508
+ bool menuOpen = ( imguiLocal. GetOpenWindowsMask () & idImGuiWindow::WINDOW_SETTINGS ) != 0 ;
2509
2509
if ( !menuOpen ) {
2510
- D3::ImGuiHooks:: OpenWindow ( D3::ImGuiHooks::D3_ImGuiWin_Settings );
2510
+ imguiLocal. OpenWindow ( idImGuiWindow::WINDOW_SETTINGS );
2511
2511
} else {
2512
2512
if ( ImGui::IsWindowFocused ( ImGuiFocusedFlags_AnyWindow ) ) {
2513
2513
// if the settings window is open and an ImGui window has focus,
2514
2514
// close the settings window when "settings" is executed
2515
- D3::ImGuiHooks:: CloseWindow ( D3::ImGuiHooks::D3_ImGuiWin_Settings );
2515
+ imguiLocal. CloseWindow ( idImGuiWindow::WINDOW_SETTINGS );
2516
2516
} else {
2517
2517
// if the settings window is open but no ImGui window has focus,
2518
2518
// give focus to one of the ImGui windows.
0 commit comments