Skip to content

Commit

Permalink
PA: fix keybinding issue and add chat notification (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
klingo committed Apr 23, 2019
1 parent a02b3a3 commit 85ae066
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 11 deletions.
34 changes: 28 additions & 6 deletions 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"}))
-- 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
10 changes: 5 additions & 5 deletions PersonalAssistant/bindings/Bindings.xml
Expand Up @@ -2,19 +2,19 @@
<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
<Category name="|cFFD700P|rersonal|cFFD700A|rssistant">
<Action name="ACTIVATE_PROFILE_1">
<Down>MenuHelper.loadProfile(1)</Down>
<Down>PersonalAssistant.Bindings.loadProfile(1)</Down>
</Action>
<Action name="ACTIVATE_PROFILE_2">
<Down>MenuHelper.loadProfile(2)</Down>
<Down>PersonalAssistant.Bindings.loadProfile(2)</Down>
</Action>
<Action name="ACTIVATE_PROFILE_3">
<Down>MenuHelper.loadProfile(3)</Down>
<Down>PersonalAssistant.Bindings.loadProfile(3)</Down>
</Action>
<Action name="ACTIVATE_PROFILE_4">
<Down>MenuHelper.loadProfile(4)</Down>
<Down>PersonalAssistant.Bindings.loadProfile(4)</Down>
</Action>
<Action name="ACTIVATE_PROFILE_5">
<Down>MenuHelper.loadProfile(5)</Down>
<Down>PersonalAssistant.Bindings.loadProfile(5)</Down>
</Action>
</Category>
</Layer>
Expand Down
7 changes: 7 additions & 0 deletions PersonalAssistant/localization/de.lua
Expand Up @@ -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 == --
-- -----------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions PersonalAssistant/localization/en.lua
Expand Up @@ -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 == --
-- -----------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions PersonalAssistant/localization/fr.lua
Expand Up @@ -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 == --
-- -----------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 85ae066

Please sign in to comment.