diff --git a/PersonalAssistant/bindings/Bindings.lua b/PersonalAssistant/bindings/Bindings.lua index 4992cb4e..4afbbb9b 100644 --- a/PersonalAssistant/bindings/Bindings.lua +++ b/PersonalAssistant/bindings/Bindings.lua @@ -1,6 +1,28 @@ -local L = PersonalAssistant.Localization -ZO_CreateStringId("SI_BINDING_NAME_ACTIVATE_PROFILE_1", table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " 1"})) -ZO_CreateStringId("SI_BINDING_NAME_ACTIVATE_PROFILE_2", table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " 2"})) -ZO_CreateStringId("SI_BINDING_NAME_ACTIVATE_PROFILE_3", table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " 3"})) -ZO_CreateStringId("SI_BINDING_NAME_ACTIVATE_PROFILE_4", table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " 4"})) -ZO_CreateStringId("SI_BINDING_NAME_ACTIVATE_PROFILE_5", table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " 5"})) \ No newline at end of file +-- Local instances of Global tables -- +local PA = PersonalAssistant +local PAC = PA.Constants +local PAHF = PA.HelperFunctions +local PAMF = PA.MenuFunctions + +-- --------------------------------------------------------------------------------------------------------------------- + +local function loadProfile(profileNo) + if profileNo > 0 and profileNo <= PAC.GENERAL.MAX_PROFILES then + local activeProfile = PAMF.PAGeneral.getActiveProfile() + if activeProfile ~= profileNo then + PAMF.PAGeneral.setActiveProfile(profileNo) + -- then inform player + PAHF.println(SI_PA_CHAT_GENERAL_ACTIVE_PROFILE_ACTIVE, PA.SavedVars.General[PA.activeProfile].name) + end + end +end + +-- --------------------------------------------------------------------------------------------------------------------- +-- Export +PA.Bindings = { + loadProfile = loadProfile +} + +for i = 1, PAC.GENERAL.MAX_PROFILES do + ZO_CreateStringId(table.concat({"SI_BINDING_NAME_ACTIVATE_PROFILE_", tostring(i)}), table.concat({GetString(SI_PA_KB_LOAD_PROFILE), " ", tostring(i)})) +end diff --git a/PersonalAssistant/bindings/Bindings.xml b/PersonalAssistant/bindings/Bindings.xml index 301f4604..725c921d 100644 --- a/PersonalAssistant/bindings/Bindings.xml +++ b/PersonalAssistant/bindings/Bindings.xml @@ -2,19 +2,19 @@ - MenuHelper.loadProfile(1) + PersonalAssistant.Bindings.loadProfile(1) - MenuHelper.loadProfile(2) + PersonalAssistant.Bindings.loadProfile(2) - MenuHelper.loadProfile(3) + PersonalAssistant.Bindings.loadProfile(3) - MenuHelper.loadProfile(4) + PersonalAssistant.Bindings.loadProfile(4) - MenuHelper.loadProfile(5) + PersonalAssistant.Bindings.loadProfile(5) diff --git a/PersonalAssistant/localization/de.lua b/PersonalAssistant/localization/de.lua index 9251a073..ffc49d7a 100644 --- a/PersonalAssistant/localization/de.lua +++ b/PersonalAssistant/localization/de.lua @@ -34,6 +34,13 @@ SafeAddString(SI_PA_MENU_SILENT_MODE, "Ruhemodus (Deaktiviert ALLE Meldungen)", SafeAddString(SI_PA_MENU_NOT_YET_IMPLEMENTED, table.concat({PAC.COLORS.RED, "Noch nicht implementiert!"}), 1) +-- ================================================================================================================= +-- == CHAT OUTPUTS == -- +-- ----------------------------------------------------------------------------------------------------------------- +-- PAGeneral -- +SafeAddString(SI_PA_CHAT_GENERAL_ACTIVE_PROFILE_ACTIVE, table.concat({PAC.COLORED_TEXTS.PA, PAC.COLORS.DEFAULT, " aktives Profil: ", PAC.COLORS.ORANGE_RED, "%s"}), 1) + + -- ================================================================================================================= -- == OTHER STRINGS FOR MENU == -- -- ----------------------------------------------------------------------------------------------------------------- diff --git a/PersonalAssistant/localization/en.lua b/PersonalAssistant/localization/en.lua index 46edd61e..72f593c8 100644 --- a/PersonalAssistant/localization/en.lua +++ b/PersonalAssistant/localization/en.lua @@ -37,6 +37,13 @@ local PAStrings = { SI_PA_MENU_NOT_YET_IMPLEMENTED = table.concat({PAC.COLORS.RED, "Not yet implemented!"}), + -- ================================================================================================================= + -- == CHAT OUTPUTS == -- + -- ----------------------------------------------------------------------------------------------------------------- + -- PAGeneral -- + SI_PA_CHAT_GENERAL_ACTIVE_PROFILE_ACTIVE = table.concat({PAC.COLORED_TEXTS.PA, PAC.COLORS.DEFAULT, " active profile: ", PAC.COLORS.ORANGE_RED, "%s"}), + + -- ================================================================================================================= -- == OTHER STRINGS FOR MENU == -- -- ----------------------------------------------------------------------------------------------------------------- diff --git a/PersonalAssistant/localization/fr.lua b/PersonalAssistant/localization/fr.lua index fd8d35ff..e3a6c0e9 100644 --- a/PersonalAssistant/localization/fr.lua +++ b/PersonalAssistant/localization/fr.lua @@ -34,6 +34,13 @@ SafeAddString(SI_PA_MENU_SILENT_MODE, "Mode silencieux (Ne RIEN afficher dans le SafeAddString(SI_PA_MENU_NOT_YET_IMPLEMENTED, "Pas encore implémenté !", 1) +-- ================================================================================================================= +-- == CHAT OUTPUTS == -- +-- ----------------------------------------------------------------------------------------------------------------- +-- PAGeneral -- +SafeAddString(SI_PA_CHAT_GENERAL_ACTIVE_PROFILE_ACTIVE, table.concat({PAC.COLORED_TEXTS.PA, PAC.COLORS.DEFAULT, " profil actif: ", PAC.COLORS.ORANGE_RED, "%s"}), 1) + + -- ================================================================================================================= -- == OTHER STRINGS FOR MENU == -- -- -----------------------------------------------------------------------------------------------------------------