From c0a0c7e502f2bc99185d79a485b965f63de7a203 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 1 Sep 2021 01:20:39 +0100 Subject: match setting localisation --- .../northstar_client_localisation_english.txt | Bin 5866 -> 8980 bytes .../vscripts/ui/menu_ns_custom_match_settings.nut | 1 + .../mod/scripts/vscripts/ui/menu_private_match.nut | 12 +++--- .../mod/scripts/vscripts/_custom_air_accel.gnut | 2 +- .../mod/scripts/vscripts/_promode.gnut | 2 +- .../scripts/vscripts/gamemodes/_gamemode_cp.nut | 2 +- .../lobby/sh_private_lobby_modes_init.gnut | 46 ++++++++++----------- 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index 1fc54f2b..e6175e5b 100644 Binary files a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt and b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt differ diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_custom_match_settings.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_custom_match_settings.nut index d39b7774..34ad4f77 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_custom_match_settings.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_custom_match_settings.nut @@ -17,6 +17,7 @@ void function AddNorthstarCustomMatchSettingsMenu() void function SetNextMatchSettingsCategory( string category ) { file.currentCategory = category + Hud_SetText( Hud_GetChild( GetMenu( "CustomMatchSettingsMenu" ), "Title" ), Localize( "#MENU_MATCH_SETTINGS_SUBMENU", Localize( category ) ) ) print( "Category: " + category ) file.enumRealValues.clear() diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_private_match.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_private_match.nut index b1da22ee..d203a673 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_private_match.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_private_match.nut @@ -628,6 +628,8 @@ function UpdateLobby() } else { + bool shouldBreak = false + foreach ( string category in GetPrivateMatchSettingCategories() ) { foreach ( CustomMatchSettingContainer setting in GetPrivateMatchCustomSettingsForCategory( category ) ) @@ -635,18 +637,18 @@ function UpdateLobby() if ( setting.playlistVar == varName ) { if ( setting.isEnumSetting ) - { playlistOverridesDesc += Localize( setting.localizedName ) + ": `2" + setting.enumNames[ setting.enumValues.find( expect string ( GetCurrentPlaylistVar( varName ) ) ) ] + "`0\n" - } else playlistOverridesDesc += Localize( setting.localizedName ) + ": `2" + GetCurrentPlaylistVar( varName ) + "`0\n" - + + shouldBreak = true break } } + + if ( shouldBreak ) + break } - - // sorta temp: ideally wanna localise playlist var names in the future } } diff --git a/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut b/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut index 5c228af4..8ebef034 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut @@ -2,7 +2,7 @@ global function CustomAirAccelVars_Init void function CustomAirAccelVars_Init() { - AddPrivateMatchModeSettingArbitrary( "Pilot", "custom_air_accel_pilot", "500" ) // 500 is the default airaccel + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "custom_air_accel_pilot", "500" ) // 500 is the default airaccel #if SERVER AddCallback_OnPlayerRespawned( ApplyCustomPlayerAirAccel ) diff --git a/Northstar.Custom/mod/scripts/vscripts/_promode.gnut b/Northstar.Custom/mod/scripts/vscripts/_promode.gnut index 3e6d6d65..f390fed6 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_promode.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/_promode.gnut @@ -4,7 +4,7 @@ global function PromodeEnabled void function Promode_Init() { - AddPrivateMatchModeSettingEnum( "Promode", "promode_enable", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PROMODE", "promode_enable", [ "Disabled", "Enabled" ], "0" ) #if SERVER AddCallback_OnPlayerRespawned( GivePromodeWeaponMod ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut index ddfe6ee6..4c9f61d5 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut @@ -24,7 +24,7 @@ struct { void function GamemodeCP_Init() { - file.ampingEnabled = GetCurrentPlaylistVar( "amped_capture_points" ) == "1" + file.ampingEnabled = GetCurrentPlaylistVarInt( "cp_amped_capture_points", 1 ) == 1 RegisterSignal( "HardpointCaptureStart" ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut index 41806e16..8991ebb0 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut @@ -4,34 +4,34 @@ void function PrivateMatchModesInit() { // match settings // super temp: do localisation strings later - AddPrivateMatchModeSettingArbitrary( "Match", "scorelimit", "5" ) //, "Score Limit" ) - AddPrivateMatchModeSettingArbitrary( "Match", "roundscorelimit", "0" ) //, "Score Limit (round-based modes)" ) - AddPrivateMatchModeSettingArbitrary( "Match", "timelimit", "12" ) //, "Time Limit" ) - AddPrivateMatchModeSettingArbitrary( "Match", "roundtimelimit", "0" ) //, "Time Limit (round-based modes)" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "scorelimit", "5" ) //, "Score Limit" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundscorelimit", "0" ) //, "Score Limit (round-based modes)" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "timelimit", "12" ) //, "Time Limit" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundtimelimit", "0" ) //, "Time Limit (round-based modes)" ) - AddPrivateMatchModeSettingArbitrary( "Pilot", "pilot_health_multiplier", "1.0" ) - AddPrivateMatchModeSettingArbitrary( "Pilot", "respawn_delay", "0.0" ) - AddPrivateMatchModeSettingEnum( "Pilot", "boosts_enabled", [ "Default", "Disabled" ], "1" ) - AddPrivateMatchModeSettingEnum( "Pilot", "earn_meter_pilot_overdrive", [ "Disabled", "Enabled", "Only" ], "1" ) - AddPrivateMatchModeSettingArbitrary( "Pilot", "earn_meter_pilot_multiplier", "1.0" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "pilot_health_multiplier", "1.0" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "respawn_delay", "0.0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PILOT", "boosts_enabled", [ "Default", "Disabled" ], "1" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PILOT", "earn_meter_pilot_overdrive", [ "Disabled", "Enabled", "Only" ], "1" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "earn_meter_pilot_multiplier", "1.0" ) - AddPrivateMatchModeSettingArbitrary( "Titan", "earn_meter_titan_multiplier", "1.0" ) - AddPrivateMatchModeSettingEnum( "Titan", "aegis_upgrades", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Titan", "infinite_doomed_state", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Titan", "titan_shield_regen", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_TITAN", "earn_meter_titan_multiplier", "1.0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_TITAN", "aegis_upgrades", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_TITAN", "infinite_doomed_state", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_TITAN", "titan_shield_regen", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "riff_floorislava", [ "Default", "Enabled", "Disabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_all_holopilot", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_all_grapple", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_all_phase", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_all_ticks", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_tactikill", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_amped_tacticals", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_rocket_arena", [ "Disabled", "Enabled" ], "0" ) - AddPrivateMatchModeSettingEnum( "Riff Settings", "featured_mode_shotguns_snipers", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "riff_floorislava", [ "Default", "Enabled", "Disabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_all_holopilot", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_all_grapple", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_all_phase", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_all_ticks", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_tactikill", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_amped_tacticals", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_rocket_arena", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "featured_mode_shotguns_snipers", [ "Disabled", "Enabled" ], "0" ) // gamemode settings - AddPrivateMatchModeSettingEnum( "#GAMEMODE_cp", "amped_capture_points", [ "Disabled", "Enabled" ], "0" ) + AddPrivateMatchModeSettingEnum( "#GAMEMODE_cp", "cp_amped_capture_points", [ "Disabled", "Enabled" ], "1" ) // would've been nice to use amped_capture_points, but this var is already used ingame and its value is default 0 AddPrivateMatchModeSettingEnum( "#GAMEMODE_coliseum", "coliseum_loadouts_enabled", [ "Disabled", "Enabled" ], "1" ) -- cgit v1.2.3