Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Krazyito
VuhDo
Commits
75dfd733
Commit
75dfd733
authored
9 years ago
by
Ivaria
Browse files
Options
Download
Email Patches
Plain Diff
Added custom flag validator which accepts a user defined function.
parent
c59c0473
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
128 additions
and
0 deletions
+128
-0
VuhDoBouquetValidators.lua
VuhDoBouquetValidators.lua
+44
-0
VuhDoLocalization_de.lua
VuhDoLocalization_de.lua
+6
-0
VuhDoLocalization_en.lua
VuhDoLocalization_en.lua
+6
-0
VuhDoLocalization_es.lua
VuhDoLocalization_es.lua
+6
-0
VuhDoLocalization_fr.lua
VuhDoLocalization_fr.lua
+6
-0
VuhDoLocalization_ru.lua
VuhDoLocalization_ru.lua
+6
-0
VuhDoLocalization_zhCN.lua
VuhDoLocalization_zhCN.lua
+6
-0
VuhDoLocalization_zhTW.lua
VuhDoLocalization_zhTW.lua
+6
-0
VuhDoOptions/VuhDoLocalization_de.lua
VuhDoOptions/VuhDoLocalization_de.lua
+1
-0
VuhDoOptions/VuhDoLocalization_en.lua
VuhDoOptions/VuhDoLocalization_en.lua
+1
-0
VuhDoOptions/VuhDoLocalization_es.lua
VuhDoOptions/VuhDoLocalization_es.lua
+1
-0
VuhDoOptions/VuhDoLocalization_fr.lua
VuhDoOptions/VuhDoLocalization_fr.lua
+1
-0
VuhDoOptions/VuhDoLocalization_ru.lua
VuhDoOptions/VuhDoLocalization_ru.lua
+1
-0
VuhDoOptions/VuhDoLocalization_zhCN.lua
VuhDoOptions/VuhDoLocalization_zhCN.lua
+1
-0
VuhDoOptions/VuhDoLocalization_zhTW.lua
VuhDoOptions/VuhDoLocalization_zhTW.lua
+1
-0
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.lua
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.lua
+6
-0
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.xml
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.xml
+23
-0
changelog.txt
changelog.txt
+6
-0
No files found.
VuhDoBouquetValidators.lua
View file @
75dfd733
...
...
@@ -6,6 +6,7 @@ VUHDO_BOUQUET_CUSTOM_TYPE_HEALTH = 5;
VUHDO_BOUQUET_CUSTOM_TYPE_HOLY_POWER
=
6
;
VUHDO_BOUQUET_CUSTOM_TYPE_SECONDS
=
7
;
VUHDO_BOUQUET_CUSTOM_TYPE_STACKS
=
8
;
VUHDO_BOUQUET_CUSTOM_TYPE_CUSTOM_FLAG
=
9
;
VUHDO_FORCE_RESET
=
false
;
...
...
@@ -1001,6 +1002,41 @@ end
--
local
function
VUHDO_customFlagValidator
(
anInfo
,
aCustom
)
if
aCustom
and
aCustom
[
"custom"
]
and
aCustom
[
"custom"
][
1
]
then
local
loadedFunction
,
errorString
=
loadstring
(
"local anInfo = _G[\"
VUHDO_anInfo
\
"];"
..
aCustom
[
"custom"
][
1
]);
if
loadedFunction
then
_G
[
"VUHDO_anInfo"
]
=
anInfo
;
setfenv
(
loadedFunction
,
_G
)
local
_
,
ret
,
ret2
,
ret3
,
ret4
,
ret5
=
xpcall
(
loadedFunction
,
function
()
DEFAULT_CHAT_FRAME
:
AddMessage
(
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE
,
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
debugstack
(
1
,
2
,
0
),
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
VUHDO_I18N_ERROR_INVALID_VALIDATOR
,
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
aCustom
[
"custom"
][
1
],
1
.
0
,
0
.
0
,
0
.
0
);
return
false
,
nil
,
-
1
,
-
1
,
-
1
;
end
);
if
ret
and
ret
==
true
then
return
true
,
nil
,
-
1
,
-
1
,
-
1
;
end
else
DEFAULT_CHAT_FRAME
:
AddMessage
(
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD
,
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
errorString
,
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
VUHDO_I18N_ERROR_INVALID_VALIDATOR
,
1
.
0
,
0
.
0
,
0
.
0
);
DEFAULT_CHAT_FRAME
:
AddMessage
(
aCustom
[
"custom"
][
1
],
1
.
0
,
0
.
0
,
0
.
0
);
end
end
return
false
,
nil
,
-
1
,
-
1
,
-
1
;
end
--
local
tUnit
;
local
function
VUHDO_enemyStateValidator
(
anInfo
,
_
)
...
...
@@ -1593,5 +1629,13 @@ VUHDO_BOUQUET_BUFFS_SPECIAL = {
[
"validator"
]
=
VUHDO_alwaysTrueValidator
,
[
"interests"
]
=
{
},
},
[
"CUSTOM_FLAG"
]
=
{
[
"displayName"
]
=
VUHDO_I18N_BOUQUET_CUSTOM_FLAG
,
[
"validator"
]
=
VUHDO_customFlagValidator
,
[
"custom_type"
]
=
VUHDO_BOUQUET_CUSTOM_TYPE_CUSTOM_FLAG
,
[
"interests"
]
=
{
VUHDO_UPDATE_INC
,
VUHDO_UPDATE_HEALTH
,
VUHDO_UPDATE_RANGE
,
VUHDO_UPDATE_HEALTH_MAX
,
VUHDO_UPDATE_ALIVE
},
},
};
This diff is collapsed.
Click to expand it.
VuhDoLocalization_de.lua
View file @
75dfd733
...
...
@@ -420,3 +420,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "[no NPC]";
VUHDO_I18N_BOSSES = "NPCs";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_en.lua
View file @
75dfd733
...
...
@@ -429,3 +429,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "[no NPC]";
VUHDO_I18N_BOSSES = "NPCs";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_es.lua
View file @
75dfd733
...
...
@@ -430,3 +430,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "[no NPC]";
VUHDO_I18N_BOSSES = "NPCs";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_fr.lua
View file @
75dfd733
...
...
@@ -428,3 +428,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "[no NPC]";
VUHDO_I18N_BOSSES = "NPCs";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_ru.lua
View file @
75dfd733
...
...
@@ -494,3 +494,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "
[
no
NPC
]
";
VUHDO_I18N_BOSSES = "
NPCs
";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "
Custom
Flag
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
load
:
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
execute
:
";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "
{
VuhDo
}
Error
:
Invalid
validator
:
";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_zhCN.lua
View file @
75dfd733
...
...
@@ -422,3 +422,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "
[
no
NPC
]
";
VUHDO_I18N_BOSSES = "
NPCs
";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "
Custom
Flag
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
load
:
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
execute
:
";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "
{
VuhDo
}
Error
:
Invalid
validator
:
";
This diff is collapsed.
Click to expand it.
VuhDoLocalization_zhTW.lua
View file @
75dfd733
...
...
@@ -422,3 +422,9 @@ VUHDO_I18N_BOUQUET_STATUS_TOTAL_ABSORB = "Statusbar: Total Absorption %";
VUHDO_I18N_NO_BOSS = "
[
no
NPC
]
";
VUHDO_I18N_BOSSES = "
NPCs
";
-- 3.71
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "
Custom
Flag
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
load
:
";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "
{
VuhDo
}
Error
:
Your
custom
flag
validator
did
not
execute
:
";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "
{
VuhDo
}
Error
:
Invalid
validator
:
";
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_de.lua
View file @
75dfd733
...
...
@@ -612,6 +612,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_en.lua
View file @
75dfd733
...
...
@@ -611,6 +611,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_es.lua
View file @
75dfd733
...
...
@@ -619,6 +619,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_fr.lua
View file @
75dfd733
...
...
@@ -621,6 +621,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_ru.lua
View file @
75dfd733
...
...
@@ -719,6 +719,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_zhCN.lua
View file @
75dfd733
...
...
@@ -613,6 +613,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoLocalization_zhTW.lua
View file @
75dfd733
...
...
@@ -613,6 +613,7 @@ VUHDO_I18N_TT.K553 = "Make the selected profile the default for all new characte
VUHDO_I18N_TT
.
K554
=
"Make the selected key layout the default for all new characters on this account."
;
VUHDO_I18N_TT
.
K555
=
"Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode."
;
VUHDO_I18N_TT
.
K556
=
"Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore)."
;
VUHDO_I18N_TT
.
K557
=
"Body of the custom flag function. Must return true or false. Example: return (\"
YOURNAME
\
" == anInfo\[\"
name
\
"\])"
;
VUHDO_I18N_DEFAULT_PROFILE
=
"Default Profile"
;
VUHDO_I18N_DEFAULT_LAYOUT
=
"Default Layout"
;
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.lua
View file @
75dfd733
...
...
@@ -302,6 +302,7 @@ function VUHDO_rebuildBouquetContextEditors(anIndex)
_G
[
tPanel
:
GetName
()
..
"BuffOrIndicatorFrameMineOthersFrame"
]:
Hide
();
_G
[
tPanel
:
GetName
()
..
"BuffOrIndicatorFramePercentFrame"
]:
Hide
();
_G
[
tPanel
:
GetName
()
..
"BuffOrIndicatorFrameCustomFlagEditBox"
]:
Hide
();
tBuffName
=
VUHDO_lnfGetValueFrom
(
tModel
..
".name"
);
...
...
@@ -434,8 +435,13 @@ function VUHDO_rebuildBouquetContextEditors(anIndex)
tSpecialName
=
VUHDO_BOUQUETS
[
"STORED"
][
tBouquetName
][
tIndex
][
"name"
];
VUHDO_lnfSliderOnLoad
(
tSlider
,
VUHDO_BOUQUET_BUFFS_SPECIAL
[
tSpecialName
][
"displayName"
],
0
,
50
,
"#"
);
tSubPanel
:
Show
();
elseif
(
VUHDO_BOUQUET_BUFFS_SPECIAL
[
tBuffName
][
"custom_type"
]
==
VUHDO_BOUQUET_CUSTOM_TYPE_CUSTOM_FLAG
)
then
tSubPanel
=
_G
[
tInnerPanel
:
GetName
()
..
"CustomFlagEditBox"
];
VUHDO_lnfSetModel
(
tSubPanel
,
tModel
..
".custom.##1"
);
tSubPanel
:
Show
();
else
_G
[
tInnerPanel
:
GetName
()
..
"PercentFrame"
]:
Hide
();
_G
[
tInnerPanel
:
GetName
()
..
"CustomFlagEditBox"
]:
Hide
();
end
if
(
VUHDO_BOUQUET_BUFFS_SPECIAL
[
tBuffName
][
"no_color"
])
then
...
...
This diff is collapsed.
Click to expand it.
VuhDoOptions/VuhDoNewOptionsGeneralBouquet.xml
View file @
75dfd733
...
...
@@ -818,6 +818,29 @@
</Frame>
</Frames>
</Frame>
<EditBox
name=
"$parentCustomFlagEditBox"
inherits=
"VuhDoEditBoxTemplate"
>
<Size>
<AbsDimension
x=
"170"
y=
"32"
/>
</Size>
<Anchors>
<Anchor
point=
"BOTTOM"
>
<Offset>
<AbsDimension
x=
"0"
y=
"7"
/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
VUHDO_lnfSetModel(self, nil);
VUHDO_lnfSetTooltip(self, VUHDO_I18N_TT.K557);
</OnLoad>
<OnTextChanged>
VUHDO_lnfEditBoxUpdateModel(self);
</OnTextChanged>
</Scripts>
</EditBox>
</Frames>
</Frame>
...
...
This diff is collapsed.
Click to expand it.
changelog.txt
View file @
75dfd733
...
...
@@ -18,6 +18,12 @@ Bugfixes:
Improvements:
-- Added custom flag validator which accepts a user defined function.
-- Bouquets can include any valid Lua function which returns true or false.
-- The function can access the 'anInfo' variable which is a map containing
-- the relevant unit information.
-- Example below returns true if the unit is named 'Ivaria':
-- return ("Ivaria" == anInfo["name"])
--------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment