mutators: add localization (en)

This commit is contained in:
UnShame 2018-02-23 13:13:26 +03:00
parent bbd12c1175
commit 27e84025f3
6 changed files with 80 additions and 22 deletions

View file

@ -6,16 +6,16 @@
set SOUCE_CODE_DIR=.\vmf_source set SOUCE_CODE_DIR=.\vmf_source
set TEMP_DIR=.\TEMP set TEMP_DIR=.\TEMP
set ORIGINAL_VMF_BUNDLE_FILE_NAME=98161451961848df set ORIGINAL_VMF_BUNDLE_FILE_NAME=98161451961848df
set NEW_VMF_BUNDLE_FILE_NAME=000_VMF_Main_Bundle set NEW_VMF_BUNDLE_FILE_NAME=VMF
:: manual setting pathes (in case this batch file won't be able to find steam installation folders) [you can change them :D] :: manual setting pathes (in case this batch file won't be able to find steam installation folders) [you can change them :D]
set MANUAL_MODS_DIR=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide\bundle\mods set MANUAL_MODS_DIR=E:\SteamLibrary\SteamApps\workshop\content\235540\1289946781
set MANUAL_STINGRAY_EXE=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide Mod Tools\bin\stingray_win64_dev_x64.exe set MANUAL_STINGRAY_EXE=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide Mod Tools\bin\stingray_win64_dev_x64.exe
:: find Vermintide folder :: find Vermintide folder
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 235540" set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\asdasdCurrentVersion\Uninstall\Steam App 235540"
set VALUE_NAME=InstallLocation set VALUE_NAME=InstallLocation
for /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do ( for /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do (
@ -54,7 +54,7 @@ if not exist "%STINGRAY_EXE%" (
echo Starting... echo Starting...
"%STINGRAY_EXE%" --compile-for win32 --source-dir "%SOUCE_CODE_DIR%" --data-dir "%TEMP_DIR%\compile" --bundle-dir "%TEMP_DIR%\bundle" "%STINGRAY_EXE%" --compile-for win32 --source-dir "%SOUCE_CODE_DIR%" --data-dir "%TEMP_DIR%\compile" --bundle-dir "%TEMP_DIR%\bundle" > nul
echo Done. echo Done.

View file

@ -22,5 +22,57 @@ return {
}, },
survival_hardest = { survival_hardest = {
en = "Heroic" en = "Heroic"
},
broadcast_enabled_mutators = {
en = "ENABLED MUTATORS"
},
broadcast_all_disabled = {
en = "ALL MUTATORS DISABLED"
},
broadcast_disabled_mutators = {
en = "MUTATORS DISABLED"
},
local_disabled_mutators = {
en = "Mutators disabled"
},
whisper_enabled_mutators = {
en = "[Automated message] This lobby has the following mutators active"
},
disabled_reason_not_server = {
en = "because you're no longer the host"
},
disabled_reason_difficulty_change = {
en = "DUE TO CHANGE IN DIFFICULTY"
},
mutators_title = {
en = "Mutators"
},
mutators_banner_tooltip = {
en = "Enable and disable mutators"
},
no_mutators = {
en = "No mutators installed"
},
no_mutators_tooltip = {
en = "Subscribe to mods and mutators on the workshop"
},
tooltip_supported_difficulty = {
en = "Supported difficulty levels"
},
tooltip_incompatible_with_all = {
en = "Incompatible with all other mutators"
},
tooltip_incompatible_with = {
en = "Incompatible with"
},
tooltip_compatible_with_all = {
en = "Compatible with all other mutators"
},
tooltip_will_be_disabled = {
en = "Will be disabled when Play is pressed"
} }
} }

View file

@ -319,7 +319,7 @@ local mutators_view = {
-- Show supported difficulty when can't be enabled due to difficulty level -- Show supported difficulty when can't be enabled due to difficulty level
local supports_difficulty = mutator:supports_current_difficulty() local supports_difficulty = mutator:supports_current_difficulty()
if not supports_difficulty then if not supports_difficulty then
text = text .. "\nSupported difficulty levels:" text = text .. "\n" .. manager:localize("tooltip_supported_difficulty") .. ":"
for i, difficulty in ipairs(config.difficulty_levels) do for i, difficulty in ipairs(config.difficulty_levels) do
text = text .. (i == 1 and " " or ", ") .. manager:localize(difficulty) text = text .. (i == 1 and " " or ", ") .. manager:localize(difficulty)
end end
@ -338,9 +338,9 @@ local mutators_view = {
if currently_compatible and config.incompatible_with_all or #incompatible_mutators == #mutators - 1 then if currently_compatible and config.incompatible_with_all or #incompatible_mutators == #mutators - 1 then
-- Show special message when incompatible with all -- Show special message when incompatible with all
text = text .. "\nIncompatible with all other mutators" text = text .. "\n" .. manager:localize("tooltip_incompatible_with_all")
else else
text = text .. "\nIncompatible with:" text = text .. "\n" .. manager:localize("tooltip_incompatible_with") .. ":"
for i, other_mutator in ipairs(incompatible_mutators) do for i, other_mutator in ipairs(incompatible_mutators) do
local name = (other_mutator:get_config().title or other_mutator:get_name()) local name = (other_mutator:get_config().title or other_mutator:get_name())
text = text .. (i == 1 and " " or ", ") .. name text = text .. (i == 1 and " " or ", ") .. name
@ -349,12 +349,12 @@ local mutators_view = {
elseif config.compatible_with_all then elseif config.compatible_with_all then
-- Special message when compatible with all -- Special message when compatible with all
text = text .. "\nCompatible with all other mutators" text = text .. "\n" .. manager:localize("tooltip_compatible_with_all")
end end
-- Special message if switched to unsupported difficulty level -- Special message if switched to unsupported difficulty level
if mutator:is_enabled() and not supports_difficulty then if mutator:is_enabled() and not supports_difficulty then
text = text .. "\nWill be disabled when Play is pressed" text = text .. "\n" .. manager:localize("tooltip_will_be_disabled")
end end
-- Description -- Description

View file

@ -1,4 +1,4 @@
local manager = get_mod("vmf_mutator_manager")
local definitions = local_require("scripts/ui/views/map_view_definitions") local definitions = local_require("scripts/ui/views/map_view_definitions")
local scenegraph_definition = definitions.scenegraph_definition local scenegraph_definition = definitions.scenegraph_definition
@ -56,7 +56,12 @@ scenegraph_definition.no_mutators_text = {
local new_widgets = { local new_widgets = {
-- This will replace the banner behind the Mission text -- This will replace the banner behind the Mission text
banner_mutators_widget = UIWidgets.create_texture_with_text_and_tooltip("title_bar", "Mutators", "Enable and disable mutators", "banner_level", "banner_mutators_text", { banner_mutators_widget = UIWidgets.create_texture_with_text_and_tooltip(
"title_bar",
manager:localize("mutators_title"),
manager:localize("mutators_banner_tooltip"),
"banner_level",
"banner_mutators_text", {
vertical_alignment = "center", vertical_alignment = "center",
scenegraph_id = "banner_mutators_text", scenegraph_id = "banner_mutators_text",
localize = false, localize = false,
@ -93,8 +98,8 @@ local new_widgets = {
normal_texture = "octagon_button_normal", normal_texture = "octagon_button_normal",
icon_texture = "mutator_button", icon_texture = "mutator_button",
icon_hover_texture = "mutator_button_hover", icon_hover_texture = "mutator_button_hover",
tooltip_text = "Mutators", tooltip_text = manager:localize("mutators_title"),
toggled_tooltip_text = "Mutators", toggled_tooltip_text = manager:localize("mutators_title"),
button_hotspot = {} button_hotspot = {}
}, },
style = { style = {
@ -219,8 +224,8 @@ local new_widgets = {
} }
}, },
content = { content = {
text = "No mutators installed", text = manager:localize("no_mutators"),
tooltip_text = "Subscribe to mods and mutators on the workshop", tooltip_text = manager:localize("no_mutators_tooltip"),
tooltip_hotspot = {}, tooltip_hotspot = {},
color = Colors.get_color_table_with_alpha("slate_gray", 255) color = Colors.get_color_table_with_alpha("slate_gray", 255)
}, },

View file

@ -73,10 +73,10 @@ manager:hook("MatchmakingStateHostGame.host_game", function(func, self, ...)
set_lobby_data() set_lobby_data()
local names = add_enabled_mutators_titles_to_string("", ", ") local names = add_enabled_mutators_titles_to_string("", ", ")
if string.len(names) > 0 then if string.len(names) > 0 then
manager:chat_broadcast("ENABLED MUTATORS: " .. names) manager:chat_broadcast(manager:localize("broadcast_enabled_mutators") .. ": " .. names)
were_enabled_before = true were_enabled_before = true
elseif were_enabled_before then elseif were_enabled_before then
manager:chat_broadcast("ALL MUTATORS DISABLED") manager:chat_broadcast(manager:localize("broadcast_all_disabled"))
were_enabled_before = false were_enabled_before = false
end end
end) end)
@ -85,7 +85,7 @@ end)
manager:hook("MatchmakingManager.rpc_matchmaking_request_join_lobby", function(func, self, sender, client_cookie, host_cookie, lobby_id, friend_join) manager:hook("MatchmakingManager.rpc_matchmaking_request_join_lobby", function(func, self, sender, client_cookie, host_cookie, lobby_id, friend_join)
local name = add_enabled_mutators_titles_to_string("", ", ") local name = add_enabled_mutators_titles_to_string("", ", ")
if string.len(name) > 0 then if string.len(name) > 0 then
local message = "[Automated message] This lobby has the following difficulty mod active : " .. name local message = manager:localize("whisper_enabled_mutators") .. ": " .. name
manager:chat_whisper(get_peer_id_from_cookie(client_cookie), message) manager:chat_whisper(get_peer_id_from_cookie(client_cookie), message)
end end
func(self, sender, client_cookie, host_cookie, lobby_id, friend_join) func(self, sender, client_cookie, host_cookie, lobby_id, friend_join)

View file

@ -258,7 +258,8 @@ manager.disable_impossible_mutators = function(notify, everybody, reason)
end end
if #disabled_mutators > 0 and notify then if #disabled_mutators > 0 and notify then
if not reason then reason = "" end if not reason then reason = "" end
local message = everybody and "MUTATORS DISABLED " .. reason .. ":" or "Mutators disabled " .. reason .. ":" local loc = everybody and "broadcast_disabled_mutators" or "local_disabled_mutators"
local message = manager:localize(loc) .. " " .. manager:localize(reason) .. ":"
message = message .. " " .. manager.add_mutator_titles_to_string(disabled_mutators, "", ", ", false) message = message .. " " .. manager.add_mutator_titles_to_string(disabled_mutators, "", ", ", false)
if everybody then if everybody then
manager:chat_broadcast(message) manager:chat_broadcast(message)
@ -314,7 +315,7 @@ end
-- Check if player is still hosting -- Check if player is still hosting
manager.update = function() manager.update = function()
if not all_mutators_disabled and not player_is_server() then if not all_mutators_disabled and not player_is_server() then
manager.disable_impossible_mutators(true, false, "because you're no longer the host") manager.disable_impossible_mutators(true, false, "disabled_reason_not_server")
all_mutators_disabled = true all_mutators_disabled = true
end end
end end
@ -335,7 +336,7 @@ local function disable_mutator(self)
set_mutator_state(self, false) set_mutator_state(self, false)
end end
-- Checks current difficulty, map selection screen settings (optionally), incompatible mutators and whether player is server -- Checks current difficulty, map selection screen settings (optionally), incompatible mutators and whether player is server
-- to determine if a mutator can be enabled -- to determine if a mutator can be enabled
local function can_be_enabled(self, ignore_map) local function can_be_enabled(self, ignore_map)
if #self:get_incompatible_mutators(true) > 0 then return false end if #self:get_incompatible_mutators(true) > 0 then return false end
@ -438,7 +439,7 @@ end
HOOKS HOOKS
]]-- ]]--
manager:hook("DifficultyManager.set_difficulty", function(func, self, difficulty) manager:hook("DifficultyManager.set_difficulty", function(func, self, difficulty)
manager.disable_impossible_mutators(true, true, "DUE TO CHANGE IN DIFFICULTY") manager.disable_impossible_mutators(true, true, "disabled_reason_difficulty_change")
return func(self, difficulty) return func(self, difficulty)
end) end)