Added stance requirement for every triggers

This commit is contained in:
Athene
2016-01-22 18:09:51 +01:00
parent 65afc20870
commit da3c3d8e19
7 changed files with 90 additions and 16 deletions
@@ -107,6 +107,12 @@ ICON_CACHE["pierre de soins"] = "Interface\\Icons\\inv_stone_04"
ICON_CACHE["capturer un esprit"] = "Interface\\Icons\\Spell_Shadow_Haunting"
ICON_CACHE["récupération du mana"] = "Interface\\Icons\\inv_misc_gem_ruby_01"
ICON_CACHE["maître des éléments"] = "Interface\\Icons\\spell_fire_masterofelements"
ICON_CACHE["tribu zandalar"] = "Interface\\Icons\\inv_misc_coin_08"
ICON_CACHE["crachat venimeux"] = "Interface\\Icons\\spell_nature_corrosivebreath"
ICON_CACHE["morsure fatale"] = "Interface\\Icons\\ability_backstab"
ICON_CACHE["explosion sonore"] = "Interface\\Icons\\spell_shadow_teleport"
ICON_CACHE["flammes"] = "Interface\\Icons\\spell_fire_fire"
ICON_CACHE["effet inferno"] = "Interface\\Icons\\spell_fire_incinerate"
-- Cache des spells dont l'icone n'a pas été trouvée
@@ -652,6 +658,16 @@ function MikSBT.TriggerHandler(triggerEvent)
-- Get a recycled table from the events recycler object.
local animationEvent = eventsRecycler:AcquireTable();
-- Check if the trigger require a stance
if (MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].TriggerSettings.Stance) then
local _,_,isActive = GetShapeshiftFormInfo(MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].TriggerSettings.Stance)
if not isActive then
-- Reclaim the animation event table to the table recycler.
eventsRecycler:ReclaimTable(animationEvent);
return
end
end
-- Check if there is profile data for the trigger.
if (MikSBT.CurrentProfile.Triggers[triggerEvent.TriggerKey].EventSettings) then
-- Set the scroll area, event settings, and output text.
@@ -1,5 +1,5 @@
## Interface: 11200
## Version: 4.42
## Version: 4.43
## Title: Mik's Scrolling Battle Text
## Notes: Scrolls battle information around the character model.
## OptionalDeps: SW_FixLogStrings
+18 -2
View File
@@ -12,8 +12,8 @@ MikSBT = {};
-------------------------------------------------------------------------------
MikSBT.MOD_NAME = "MikScrollingBattleText"
MikSBT.VERSION_NUMBER = 4.42;
MikSBT.VERSION_STRING = "v4.42";
MikSBT.VERSION_NUMBER = 4.43;
MikSBT.VERSION_STRING = "v4.43 beta";
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING .. " - \124cffF58CBA\124hAthene Edit\124h\124r";
MikSBT.COMMAND = "/msbt";
@@ -155,6 +155,22 @@ MikSBT.AVAILABLE_TRIGGER_TYPES = {
};
------------------------------
-- Stances info
------------------------------
-- Holds the available stances.
MikSBT.AVAILABLE_STANCES = {
[1] = {Name="|cffC79C6EBattle Stance|r/|cffFF7D0ABear Form|r/|cffFFF569Stealth|r/|cffF58CBADevotion Aura"},
[2] = {Name="|cffC79C6EDefensive Stance|r/|cffFF7D0AAquatic Form|r/|cffF58CBARetribution Aura"},
[3] = {Name="|cffC79C6EBeserker Stance|r/|cffFF7D0ACat Form|r/|cffF58CBAConcentration Aura"},
[4] = {Name="|cffFF7D0ATravel Form|r/|cffF58CBAShadow Resistance Aura"},
[5] = {Name="|cffFF7D0AMoonkin Form|r/|cffF58CBAFrost Resistance Aura"},
[6] = {Name="|cffF58CBAFire Resistance Aura"},
[7] = {Name="Any"},
};
------------------------------
-- Defaults
------------------------------
+34 -2
View File
@@ -372,6 +372,11 @@ function MikSBTOpt.InitDropdowns()
key = "TriggerTypeDropdown";
MikSBTOpt.SetupDropdown(TRIGGER_CONFIGURATION_FRAME_NAME .. key, MikSBTOpt.DROPDOWNS[key].Label, MikSBTOpt.DROPDOWNS[key].Tooltip, MikSBTOpt.TriggerTypeDropdownOnClick, MikSBT.AVAILABLE_TRIGGER_TYPES, nil);
UIDropDownMenu_SetWidth(150, getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. key));
-- Initialize the stances dropdown.
key = "StanceDropdown";
MikSBTOpt.SetupDropdown(TRIGGER_CONFIGURATION_FRAME_NAME .. key, MikSBTOpt.DROPDOWNS[key].Label, MikSBTOpt.DROPDOWNS[key].Tooltip, MikSBTOpt.StanceDropdownOnClick, MikSBT.AVAILABLE_STANCES, nil);
UIDropDownMenu_SetWidth(240, getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. key));
end
@@ -553,6 +558,15 @@ function MikSBTOpt.TriggerTypeDropdownOnClick(frameName)
end
-- **********************************************************************************
-- Called when the stance dropdown menu is clicked.
-- **********************************************************************************
function MikSBTOpt.StanceDropdownOnClick(frameName)
-- Set the selected dropdown option to the appropriate value.
UIDropDownMenu_SetSelectedValue(getglobal(frameName), this.value);
end
-- **********************************************************************************
-- This function refreshes the options for the profiles dropdown.
-- **********************************************************************************
@@ -3344,7 +3358,7 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
-- Check if the search pattern controls should be shown.
if (showSearch) then
-- Resize the trigger frame.
triggerFrame:SetHeight(420);
triggerFrame:SetHeight(450);
-- Hide the threshold slider.
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "ThresholdSlider"):Hide();
@@ -3356,6 +3370,7 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent3Checkbox"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent4Checkbox"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "StanceDropdown"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern1Editbox"):Show();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern2Editbox"):Show();
@@ -3376,7 +3391,12 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
-- Populate the appropriate trigger events.
MikSBTOpt.PopulateAvailableTriggerEvents();
local stance = triggerData.TriggerSettings.Stance
if not stance then stance = 7 end
-- Populate the stance dropdown.
MikSBTOpt.PopulateDropdown(TRIGGER_CONFIGURATION_FRAME_NAME .. "StanceDropdown", stance);
-- Holds the search patterns.
local searchPattern1 = "";
local searchPattern2 = "";
@@ -3404,6 +3424,7 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent2Checkbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent3Checkbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "TriggerEvent4Checkbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "StanceDropdown"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern1Editbox"):Hide();
getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "SearchPattern2Editbox"):Hide();
@@ -3505,6 +3526,17 @@ function MikSBTOpt.SaveTriggerConfig()
-- Save the selected trigger events.
triggerData.TriggerSettings.TriggerEvents = trigEvents;
-- Save the required stance.
if UIDropDownMenu_GetSelectedValue(getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "StanceDropdown")) ~= 7 then
triggerData.TriggerSettings.Stance = UIDropDownMenu_GetSelectedValue(getglobal(TRIGGER_CONFIGURATION_FRAME_NAME .. "StanceDropdown"));
if not GetShapeshiftFormInfo(triggerData.TriggerSettings.Stance) then
MikSBT.Print("No stance found for the selected requirement on this character, this trigger might never occur :o", 1, 1, 0);
MikSBT.Print("Also it's dangerous to go alone! take this. o-[====>", 1, 1, 0); --remind me that this is a beta release
end
else
triggerData.TriggerSettings.Stance = nil
end
-- Create a table to hold the search patterns.
local searchPatterns = {};
+12 -3
View File
@@ -2149,7 +2149,16 @@
</Anchors>
</CheckButton>
<!-- Stance Dropdown -->
<Frame name="$parentStanceDropdown" inherits="MSBTDropdownTemplate" hidden="false">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-310" />
</Offset>
</Anchor>
</Anchors>
</Frame>
<!-- Search Pattern 2 Editbox -->
<EditBox name="$parentSearchPattern2Editbox" inherits="MSBTEditboxTemplate">
@@ -2157,9 +2166,9 @@
<AbsDimension x="250" y="22" />
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentStanceDropdown">
<Offset>
<AbsDimension x="0" y="40" />
<AbsDimension x="23" y="-50" />
</Offset>
</Anchor>
</Anchors>
@@ -1,5 +1,5 @@
## Interface: 11200
## Version: 4.42
## Version: 4.43
## Title: Mik's Scrolling Battle Text Options
## Notes: Load on demand options for Mik's Scrolling Battle Text
## Dependencies: MikScrollingBattleText
@@ -72,15 +72,16 @@ MikSBTOpt.TABS = {
MikSBTOpt.DROPDOWNS = {
["Tab1FrameProfileDropdown"] = { Label="Profile", Tooltip="Selects the current profile."},
["ScrollAreaDropdown"] = { Label="Scroll Area", Tooltip="Selects the scroll area to configure."},
["TextAlignDropdown"] = { Label="Text Align", Tooltip="The alignment of the text for the scroll area."},
["AnimationStyleDropdown"] = { Label="Animation Style", Tooltip="The animation style for the scroll area."},
["ScrollAreaDropdown"] = { Label="Scroll Area", Tooltip="Selects the scroll area to configure."},
["TextAlignDropdown"] = { Label="Text Align", Tooltip="The alignment of the text for the scroll area."},
["AnimationStyleDropdown"] = { Label="Animation Style", Tooltip="The animation style for the scroll area."},
["ScrollDirectionDropdown"] = { Label="Scroll Direction", Tooltip="The scroll direction for the scroll area."},
["FontDropdown"] = { Label="Normal Font"},
["FontOutlineDropdown"] = { Label="Normal Font Outline"},
["FontCritDropdown"] = { Label="Crit Font"},
["FontDropdown"] = { Label="Normal Font"},
["FontOutlineDropdown"] = { Label="Normal Font Outline"},
["FontCritDropdown"] = { Label="Crit Font"},
["FontOutlineCritDropdown"] = { Label="Crit Font Outline"},
["TriggerTypeDropdown"] = { Label="Trigger Type", Tooltip="Select the type of trigger."},
["TriggerTypeDropdown"] = { Label="Trigger Type", Tooltip="Select the type of trigger."},
["StanceDropdown"] = { Label="Required Stance", Tooltip="Select the stance required to enable this trigger."},
};
MikSBTOpt.CHECKBOXES = {