aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/gamemodes
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/gamemodes')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/cl_gg_earn_meter.gnut23
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut22
2 files changed, 13 insertions, 32 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/cl_gg_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/cl_gg_earn_meter.gnut
index 92f7be61..f28e8cbd 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/cl_gg_earn_meter.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/cl_gg_earn_meter.gnut
@@ -1,6 +1,5 @@
global function Cl_GGEarnMeter_Init
global function Cl_GGEarnMeter_RegisterNetwork
-global function ServerCallback_GGEarnMeter_SetWeaponIcon
const float FILL_ANIM_DURATION = 0.2
@@ -81,26 +80,4 @@ void function Cl_GGEarnMeter_TrackWeaponIcon()
WaitFrame()
}
-}
-
-void function ServerCallback_GGEarnMeter_SetWeaponIcon( int damageSourceId )
-{
- asset weaponImage
-
- if ( damageSourceId > -1 )
- {
- if ( !DamageSourceIDHasString(damageSourceId) )
- {
- return
- }
-
- weaponImage = GetItemImage( DamageSourceIDToString( damageSourceId ) )
- }
- else
- {
- weaponImage = RandomFloat( 1 ) > 0.1 ? $"rui/menu/boosts/boost_icon_random" : $"rui/faction/faction_logo_mrvn"
- }
-
- RuiSetImage( file.earnMeterRui, "goalBuildingIcon", weaponImage )
- RuiSetImage( file.earnMeterRui, "goalReadyIcon", weaponImage )
} \ No newline at end of file
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut
index a1dbb75a..2eba4eee 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut
@@ -2,25 +2,29 @@ global function Sh_GGEarnMeter_Init
struct
{
- string gamemode = ""
+ bool callbackAdded = false
+ array<string> gamemodes
} file
void function Sh_GGEarnMeter_Init(string gamemode)
{
- file.gamemode = gamemode
+ file.gamemodes.append(gamemode)
- AddCallback_OnRegisteringCustomNetworkVars( RegisterSharedNetwork )
+ if ( !file.callbackAdded )
+ {
+ file.callbackAdded = true
+ AddCallback_OnRegisteringCustomNetworkVars( RegisterSharedNetwork )
+ }
}
void function RegisterSharedNetwork()
{
- if ( GAMETYPE != file.gamemode )
- return
+ if ( !( file.gamemodes.contains(GAMETYPE) ) )
+ return
RegisterNetworkedVariable( "gunGameLevelPercentage", SNDC_PLAYER_EXCLUSIVE, SNVT_FLOAT_RANGE, 0.0, 0.0, 1.0 )
- Remote_RegisterFunction( "ServerCallback_GGEarnMeter_SetWeaponIcon" )
- #if CLIENT
- Cl_GGEarnMeter_RegisterNetwork()
- #endif
+ #if CLIENT
+ Cl_GGEarnMeter_RegisterNetwork()
+ #endif
} \ No newline at end of file