added "at least" and "at most" comparisons
Sidoine De Wispelaere [01-02-10 - 12:32]
added "at least" and "at most" comparisons
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@182 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/Ovale.lua b/Ovale.lua
index ca4ac77..633362f 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -1318,6 +1318,12 @@ function Ovale:CalculerMeilleureAction(element)
elseif element.comparison == "less" and tempsA and tempsA<element.time then
if Ovale.trace then Ovale:Print(element.type.." return 0") end
return 0
+ elseif element.comparison == "at most" and tempsA and tempsA<=element.time then
+ if Ovale.trace then Ovale:Print(element.type.." return 0") end
+ return 0
+ elseif element.comparison == "at least" and tempsA and tempsA>=element.time then
+ if Ovale.trace then Ovale:Print(element.type.." return 0") end
+ return 0
end
return nil
elseif (element.type == "and" or element.type == "if") then
diff --git a/Ovale.toc b/Ovale.toc
index 4a564e9..f753594 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -3,7 +3,7 @@
## Notes: Show the icon of the next spell to cast
## Notes-frFR: Affiche l'icône du prochain sort à lancer
## Author: Sidoine
-## Version: 3.3.8
+## Version: 3.3.9
## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0
## SavedVariables: OvaleDB
## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 73981c5..af0fb16 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -231,6 +231,8 @@ local function ParseAddIcon(params, text)
text = string.gsub(text, "{([node%d ]*)}", ParseGroup)
text = string.gsub(text, "(more)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
text = string.gsub(text, "(less)%s+than%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
+ text = string.gsub(text, "(at least)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
+ text = string.gsub(text, "(at most)%s+(%d+%.?%d*)s%s+node(%d+)", ParseCompare)
if (was == text) then
break