aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnie Price <contact@connieprice.co.uk>2022-01-20 13:44:59 +0000
committerGitHub <noreply@github.com>2022-01-20 10:44:59 -0300
commit64604b50bc1d940176dc1efe518a6904a4f5e276 (patch)
tree1b3e66736c48b6640be6fcaf4593c80cf748cd15
parentdece917635b060cdfcdb742a6d1722ac4c153b9c (diff)
downloadNorthstarMods-64604b50bc1d940176dc1efe518a6904a4f5e276.tar.gz
NorthstarMods-64604b50bc1d940176dc1efe518a6904a4f5e276.zip
Fixed core HUD related stuff (#135)
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut27
1 files changed, 18 insertions, 9 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut
index 5de6d956..16908362 100644
--- a/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut
@@ -279,9 +279,6 @@ void function EarnMeter_Update()
break
entity soul = player.GetTitanSoul()
- entity core = player.GetOffhandWeapons()[3]
- string coreName = core.GetWeaponClassName()
- array<string> coreMods = core.GetMods()
#if SP
RuiTrackFloat( file.earnMeterRui, "earnedFrac", soul, RUI_TRACK_SCRIPT_NETWORK_VAR, GetNetworkedVariableIndex( "coreAvailableFrac" ) )
@@ -299,16 +296,28 @@ void function EarnMeter_Update()
RuiTrackFloat( file.earnMeterRui, "earnedFrac", soul, RUI_TRACK_SCRIPT_NETWORK_VAR, GetNetworkedVariableIndex( "coreAvailableFrac" ) )
RuiTrackFloat( file.earnMeterRui, "ownedFrac", soul, RUI_TRACK_SCRIPT_NETWORK_VAR, GetNetworkedVariableIndex( "coreAvailableFrac" ) )
RuiTrackFloat( file.earnMeterRui, "rewardFrac", player, RUI_TRACK_SCRIPT_NETWORK_VAR, GetNetworkedVariableIndex( EARNMETER_REWARDFRAC ) )
-
- if ( coreName == "mp_titancore_upgrade" )
+
+ entity core = player.GetOffhandWeapon( OFFHAND_EQUIPMENT )
+ if ( IsValid(core) )
{
- RuiSetImage( file.earnMeterRui, "goalBuildingIcon", GetVanguardCoreIcon( player ) )
- RuiSetImage( file.earnMeterRui, "goalReadyIcon", GetVanguardCoreIcon( player ) )
+ string coreName = core.GetWeaponClassName()
+ array<string> coreMods = core.GetMods()
+
+ if ( coreName == "mp_titancore_upgrade" )
+ {
+ RuiSetImage( file.earnMeterRui, "goalBuildingIcon", GetVanguardCoreIcon( player ) )
+ RuiSetImage( file.earnMeterRui, "goalReadyIcon", GetVanguardCoreIcon( player ) )
+ }
+ else
+ {
+ RuiSetImage( file.earnMeterRui, "goalBuildingIcon", GetWeaponInfoFileKeyFieldAsset_WithMods_Global( coreName, coreMods, "hud_icon" ) )
+ RuiSetImage( file.earnMeterRui, "goalReadyIcon", GetWeaponInfoFileKeyFieldAsset_WithMods_Global( coreName, coreMods, "hud_icon" ) )
+ }
}
else
{
- RuiSetImage( file.earnMeterRui, "goalBuildingIcon", GetWeaponInfoFileKeyFieldAsset_WithMods_Global( coreName, coreMods, "hud_icon" ) )
- RuiSetImage( file.earnMeterRui, "goalReadyIcon", GetWeaponInfoFileKeyFieldAsset_WithMods_Global( coreName, coreMods, "hud_icon" ) )
+ RuiSetImage( file.earnMeterRui, "goalBuildingIcon", $"" )
+ RuiSetImage( file.earnMeterRui, "goalReadyIcon", $"" )
}
EarnObject earnReward = PlayerEarnMeter_GetReward( player )