Skip to content

Commit

Permalink
Separate HUD/GUI switch hotkeys out from HUD/GUI modes list; increase…
Browse files Browse the repository at this point in the history
… menu animation speed
  • Loading branch information
jimrandomh committed Apr 29, 2015
1 parent 94b71f3 commit e119182
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 65 deletions.
94 changes: 44 additions & 50 deletions DxProxy/DxProxy/Hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,84 +120,78 @@ void D3DProxyDevice::HandleControls()

controls.UpdateInputs();

if(config.hudSwitchHotkey->IsPressed(controls))
{
HUD_3D_Depth_Modes newMode=(HUD_3D_Depth_Modes)(hud3DDepthMode+1);
if (newMode>=HUD_3D_Depth_Modes::HUD_ENUM_RANGE)
newMode=HUD_3D_Depth_Modes::HUD_DEFAULT;
{
oldHudMode = hud3DDepthMode;
ChangeHUD3DDepthMode(newMode);

}
HotkeyCooldown(COOLDOWN_SHORT);
}

if(config.guiSwitchHotkey->IsPressed(controls))
{
GUI_3D_Depth_Modes newMode=(GUI_3D_Depth_Modes)(gui3DDepthMode+1);
if (newMode>=GUI_3D_Depth_Modes::GUI_ENUM_RANGE)
newMode=GUI_3D_Depth_Modes::GUI_DEFAULT;
{
oldGuiMode = gui3DDepthMode;
ChangeGUI3DDepthMode(newMode);
}
HotkeyCooldown(COOLDOWN_SHORT);
}

// loop through hotkeys
for (int i = 0; i < 5; i++)
for (int i=0; i<4; i++)
{
if (config.hudHotkeys[i]->IsPressed(controls) && HotkeysActive())
{
if (i==0)
if (hud3DDepthMode==(HUD_3D_Depth_Modes)i)
{
HUD_3D_Depth_Modes newMode=(HUD_3D_Depth_Modes)(hud3DDepthMode+1);
if (newMode>=HUD_3D_Depth_Modes::HUD_ENUM_RANGE)
newMode=HUD_3D_Depth_Modes::HUD_DEFAULT;
if (controls.Key_Down(VK_RCONTROL))
{
oldHudMode = hud3DDepthMode;
ChangeHUD3DDepthMode(newMode);

}
}
else
{
if (hud3DDepthMode==(HUD_3D_Depth_Modes)(i-1))
{
if (controls.Key_Down(VK_RCONTROL))
{
oldHudMode = hud3DDepthMode;
ChangeHUD3DDepthMode((HUD_3D_Depth_Modes)(i-1));
}
else
{
ChangeHUD3DDepthMode(oldHudMode);
}

ChangeHUD3DDepthMode((HUD_3D_Depth_Modes)i);
}
else
{
oldHudMode = hud3DDepthMode;
ChangeHUD3DDepthMode((HUD_3D_Depth_Modes)(i-1));
ChangeHUD3DDepthMode(oldHudMode);
}
}
else
{
oldHudMode = hud3DDepthMode;
ChangeHUD3DDepthMode((HUD_3D_Depth_Modes)i);
}
HotkeyCooldown(COOLDOWN_SHORT);
}
if (config.guiHotkeys[i]->IsPressed(controls) && HotkeysActive())
{
if (i==0)
if (gui3DDepthMode==(GUI_3D_Depth_Modes)i)
{
GUI_3D_Depth_Modes newMode=(GUI_3D_Depth_Modes)(gui3DDepthMode+1);
if (newMode>=GUI_3D_Depth_Modes::GUI_ENUM_RANGE)
newMode=GUI_3D_Depth_Modes::GUI_DEFAULT;
if (controls.Key_Down(VK_RCONTROL))
{
oldGuiMode = gui3DDepthMode;
ChangeGUI3DDepthMode(newMode);
}
}
else
{
if (gui3DDepthMode==(GUI_3D_Depth_Modes)(i-1))
{
if (controls.Key_Down(VK_RCONTROL))
{
oldGuiMode = gui3DDepthMode;
ChangeGUI3DDepthMode((GUI_3D_Depth_Modes)(i-1));
}
else
{
ChangeGUI3DDepthMode(oldGuiMode);
}

ChangeGUI3DDepthMode((GUI_3D_Depth_Modes)i);
}
else
{
oldGuiMode = gui3DDepthMode;
ChangeGUI3DDepthMode((GUI_3D_Depth_Modes)(i-1));
ChangeGUI3DDepthMode(oldGuiMode);
}
}
else
{
oldGuiMode = gui3DDepthMode;
ChangeGUI3DDepthMode((GUI_3D_Depth_Modes)i);
}
HotkeyCooldown(COOLDOWN_SHORT);
}
}

// avoid double input by using the menu velocity

// test VRBoost reset hotkey
if (toggleVRBoostHotkey->IsPressed(controls) && HotkeysActive())
{
Expand Down
2 changes: 1 addition & 1 deletion DxProxy/DxProxy/InGameMenus.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define COLOR_HASH_LINE D3DCOLOR_ARGB(255,255,255,0)

#define MENU_ITEM_SEPARATION 40
#define MENU_SELECT_ANIMATION_SPEED 0.2f
#define MENU_SELECT_ANIMATION_SPEED 0.8f
#define MENU_SCROLL_BOTTOM 12


Expand Down
24 changes: 12 additions & 12 deletions Shared/ProxyHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,11 @@ void ProxyHelper::HandleGameProfile(ConfigTransferDirection dir, xml_node &node,
HandleSetting(dir, node, "hud_distance_3", &config.hudDistancePresets[2]);
HandleSetting(dir, node, "hud_distance_4", &config.hudDistancePresets[3]);

HandleSetting(dir, node, "hud_key_swap", &config.hudHotkeys[0]);
HandleSetting(dir, node, "hud_key_default", &config.hudHotkeys[1]);
HandleSetting(dir, node, "hud_key_small", &config.hudHotkeys[2]);
HandleSetting(dir, node, "hud_key_large", &config.hudHotkeys[3]);
HandleSetting(dir, node, "hud_key_full", &config.hudHotkeys[4]);
HandleSetting(dir, node, "hud_key_swap", &config.hudSwitchHotkey);
HandleSetting(dir, node, "hud_key_default", &config.hudHotkeys[0]);
HandleSetting(dir, node, "hud_key_small", &config.hudHotkeys[1]);
HandleSetting(dir, node, "hud_key_large", &config.hudHotkeys[2]);
HandleSetting(dir, node, "hud_key_full", &config.hudHotkeys[3]);

HandleSetting(dir, node, "gui_3D_depth_mode", &config.gui3DDepthMode);
HandleSetting(dir, node, "gui_3D_depth_1", &config.gui3DDepthPresets[0]);
Expand All @@ -972,11 +972,11 @@ void ProxyHelper::HandleGameProfile(ConfigTransferDirection dir, xml_node &node,
HandleSetting(dir, node, "gui_size_3", &config.guiSquishPresets[2]);
HandleSetting(dir, node, "gui_size_4", &config.guiSquishPresets[3]);

HandleSetting(dir, node, "gui_key_swap", &config.guiHotkeys[0]);
HandleSetting(dir, node, "gui_key_default", &config.guiHotkeys[1]);
HandleSetting(dir, node, "gui_key_small", &config.guiHotkeys[2]);
HandleSetting(dir, node, "gui_key_large", &config.guiHotkeys[3]);
HandleSetting(dir, node, "gui_key_full", &config.guiHotkeys[4]);
HandleSetting(dir, node, "gui_key_swap", &config.guiSwitchHotkey);
HandleSetting(dir, node, "gui_key_default", &config.guiHotkeys[0]);
HandleSetting(dir, node, "gui_key_small", &config.guiHotkeys[1]);
HandleSetting(dir, node, "gui_key_large", &config.guiHotkeys[2]);
HandleSetting(dir, node, "gui_key_full", &config.guiHotkeys[3]);

HandleSetting(dir, node, "VRBoost_key_reset", &config.VRBoostResetHotkey);
HandleSetting(dir, node, "edge_peek_key", &config.EdgePeekHotkey);
Expand Down Expand Up @@ -1143,11 +1143,11 @@ ProxyConfig::ProxyConfig()
hudDistancePresets[1] = DEFAULT_HUD_DISTANCE_2;
hudDistancePresets[2] = DEFAULT_HUD_DISTANCE_3;
hudDistancePresets[3] = DEFAULT_HUD_DISTANCE_4;
hudSwitchHotkey = HotkeyExpressions::Unbound();
hudHotkeys[0] = HotkeyExpressions::Unbound();
hudHotkeys[1] = HotkeyExpressions::Unbound();
hudHotkeys[2] = HotkeyExpressions::Unbound();
hudHotkeys[3] = HotkeyExpressions::Unbound();
hudHotkeys[4] = HotkeyExpressions::Unbound();
gui3DDepthMode = 0;
gui3DDepthPresets[0] = 0.0f;
gui3DDepthPresets[1] = 0.0f;
Expand All @@ -1157,11 +1157,11 @@ ProxyConfig::ProxyConfig()
guiSquishPresets[1] = DEFAULT_GUI_SIZE_2;
guiSquishPresets[2] = DEFAULT_GUI_SIZE_3;
guiSquishPresets[3] = DEFAULT_GUI_SIZE_4;
guiSwitchHotkey = HotkeyExpressions::Unbound();
guiHotkeys[0] = HotkeyExpressions::Unbound();
guiHotkeys[1] = HotkeyExpressions::Unbound();
guiHotkeys[2] = HotkeyExpressions::Unbound();
guiHotkeys[3] = HotkeyExpressions::Unbound();
guiHotkeys[4] = HotkeyExpressions::Unbound();
VRBoostResetHotkey = HotkeyExpressions::Unbound();
EdgePeekHotkey = HotkeyExpressions::Unbound();
WorldFOV = 95.0;
Expand Down
6 changes: 4 additions & 2 deletions Shared/ProxyHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ struct ProxyConfig
int hud3DDepthMode; /**< Current HUD mode. */
float hud3DDepthPresets[4]; /**< HUD 3D Depth presets.*/
float hudDistancePresets[4]; /**< HUD Distance presets.*/
InputBindingRef hudHotkeys[5]; /**< HUD Hotkeys.*/
InputBindingRef hudSwitchHotkey; /**< Toggle between two most recent HUD settings */
InputBindingRef hudHotkeys[4]; /**< HUD Hotkeys.*/
int gui3DDepthMode; /**< Current GUI mode. */
float gui3DDepthPresets[4]; /**< GUI 3D Depth presets.*/
float guiSquishPresets[4]; /**< GUI Size presets.*/
InputBindingRef guiHotkeys[5]; /**< GUI Hotkeys.*/
InputBindingRef guiSwitchHotkey;
InputBindingRef guiHotkeys[4]; /**< GUI Hotkeys.*/
InputBindingRef VRBoostResetHotkey; /**< Hotkey option to reset VRBoost. */
InputBindingRef EdgePeekHotkey; /**< Hotkey option to toggle disconnected screen view. */

Expand Down

0 comments on commit e119182

Please sign in to comment.