Skip to content

Commit

Permalink
Implement crosshair control in adjust interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MAYLAYSHEZ committed Oct 23, 2023
1 parent 990e7d1 commit 8ee4fca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1799,11 +1799,13 @@ u32 CWeapon::Cost() const
return res;
}

extern bool hud_adj_crosshair;
bool CWeapon::show_crosshair()
{
return !IsPending() && ( !IsZoomed() || !ZoomHideCrosshair() );
return !IsPending() && ((!IsZoomed() || !ZoomHideCrosshair()) || hud_adj_mode != 0 && hud_adj_crosshair);
}


bool CWeapon::show_indicators()
{
return ! ( IsZoomed() && ZoomTexture() );
Expand Down
8 changes: 8 additions & 0 deletions src/xrGame/player_hud_tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

u32 hud_adj_mode = 0;
u32 hud_adj_item_idx = 0;
bool hud_adj_crosshair = false;
// "press SHIFT+NUM 0-return 1-hud_pos 2-hud_rot 3-itm_pos 4-itm_rot 5-fire_point 6-fire_2_point 7-shell_point";

float _delta_pos = 0.0005f;
Expand Down Expand Up @@ -367,6 +368,13 @@ void hud_adjust_mode_keyb(int dik)
hud_adj_mode = 8;
if(dik==DIK_NUMPAD9)
hud_adj_mode = 9;
if (dik == DIK_NUMPADENTER)
{
if (hud_adj_crosshair)
hud_adj_crosshair = false;
else
hud_adj_crosshair = true;
}
}
if(pInput->iGetAsyncKeyState(DIK_LCONTROL))
{
Expand Down

0 comments on commit 8ee4fca

Please sign in to comment.