From 9216bbd42d5a94a7f0ea583868e31d67f0db6513 Mon Sep 17 00:00:00 2001 From: Retera Date: Sat, 11 Jun 2022 20:27:14 -0400 Subject: [PATCH] Some changes with the brainstormed jass abilities api --- .../etheller/warsmash/parsers/jass/Jass2.java | 245 ++++++++++-------- .../scope/CommonTriggerExecutionScope.java | 18 +- .../CommandCardPopulatingAbilityVisitor.java | 4 +- .../jass/CAbilityTypeJassDefinition.java | 32 +-- 4 files changed, 167 insertions(+), 132 deletions(-) diff --git a/core/src/com/etheller/warsmash/parsers/jass/Jass2.java b/core/src/com/etheller/warsmash/parsers/jass/Jass2.java index ebefe42..421b53f 100644 --- a/core/src/com/etheller/warsmash/parsers/jass/Jass2.java +++ b/core/src/com/etheller/warsmash/parsers/jass/Jass2.java @@ -91,7 +91,7 @@ import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.CAb import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.BehaviorExpr; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrder; -import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderCommandCardType; +import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderButtonType; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.ai.AIDifficulty; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.behaviors.CBehaviorAttackListener; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.config.CPlayerAPI; @@ -612,10 +612,11 @@ public class Jass2 { // Warsmash Ability API final HandleJassType abilitytypeType = globals.registerHandleType("abilitytype"); - final HandleJassType ordercommandcardType = globals.registerHandleType("ordercommandcard"); - final HandleJassType ordercommandcardtypeType = globals.registerHandleType("ordercommandcardtype"); + final HandleJassType orderbuttonType = globals.registerHandleType("orderbutton"); + final HandleJassType orderbuttontypeType = globals.registerHandleType("orderbuttontype"); final HandleJassType abilitybehaviorType = globals.registerHandleType("abilitybehavior"); final HandleJassType behaviorexprType = globals.registerHandleType("behaviorexpr"); + final HandleJassType iconuiType = globals.registerHandleType("iconui"); registerTypingNatives(jassProgramVisitor, raceType, alliancetypeType, racepreferenceType, igamestateType, fgamestateType, playerstateType, playerscoreType, playergameresultType, unitstateType, @@ -625,12 +626,12 @@ public class Jass2 { volumegroupType, camerafieldType, playercolorType, placementType, startlocprioType, raritycontrolType, blendmodeType, texmapflagsType, effecttypeType, fogstateType, versionType, itemtypeType, attacktypeType, damagetypeType, weapontypeType, soundtypeType, pathingtypeType); - jassProgramVisitor.getJassNativeManager().createNative("ConvertOrderCommandCardType", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("ConvertOrderButtonType", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { final int i = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); - return new HandleJassValue(ordercommandcardtypeType, JassOrderCommandCardType.VALUES[i]); + return new HandleJassValue(orderbuttontypeType, JassOrderButtonType.VALUES[i]); } }); @@ -4048,20 +4049,18 @@ public class Jass2 { return new IntegerJassValue(((CommonTriggerExecutionScope) triggerScope).getSpellAbilityOrderId()); } }); - jassProgramVisitor.getJassNativeManager().createNative("GetSpellAbilityOrderCommandCard", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - return new IntegerJassValue( - ((CommonTriggerExecutionScope) triggerScope).getSpellAbilityOrderId()); - } - }); + jassProgramVisitor.getJassNativeManager().createNative("GetSpellAbilityOrderButton", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + return new IntegerJassValue(((CommonTriggerExecutionScope) triggerScope).getSpellAbilityOrderId()); + } + }); jassProgramVisitor.getJassNativeManager().createNative("GetSpellTargetType", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { - return new HandleJassValue(ordercommandcardtypeType, + return new HandleJassValue(orderbuttontypeType, ((CommonTriggerExecutionScope) triggerScope).getSpellAbilityTargetType()); } }); @@ -4215,56 +4214,97 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("CreateOrderCommandCard", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("GetUnitIconUI", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { - final JassOrderCommandCardType type = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); + final int rawcode = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); + return new HandleJassValue(iconuiType, + war3MapViewer.getAbilityDataUI().getUnitUI(new War3ID(rawcode))); + } + }); + jassProgramVisitor.getJassNativeManager().createNative("GetAbilityOnIconUI", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final int rawcode = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); + return new HandleJassValue(iconuiType, + war3MapViewer.getAbilityDataUI().getUI(new War3ID(rawcode)).getOnIconUI()); + } + }); + jassProgramVisitor.getJassNativeManager().createNative("GetAbilityOffIconUI", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final int rawcode = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); + return new HandleJassValue(iconuiType, + war3MapViewer.getAbilityDataUI().getUI(new War3ID(rawcode)).getOffIconUI()); + } + }); + jassProgramVisitor.getJassNativeManager().createNative("GetAbilityLearnIconUI", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final int rawcode = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); + return new HandleJassValue(iconuiType, + war3MapViewer.getAbilityDataUI().getUI(new War3ID(rawcode)).getLearnIconUI()); + } + }); + jassProgramVisitor.getJassNativeManager().createNative("GetItemIconUI", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final int rawcode = arguments.get(0).visit(IntegerJassValueVisitor.getInstance()); + return new HandleJassValue(iconuiType, + war3MapViewer.getAbilityDataUI().getItemUI(new War3ID(rawcode))); + } + }); + jassProgramVisitor.getJassNativeManager().createNative("CreateOrderButton", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final JassOrderButtonType type = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); final int orderId = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); final int buttonPositionX = arguments.get(2).visit(IntegerJassValueVisitor.getInstance()); final int buttonPositionY = arguments.get(3).visit(IntegerJassValueVisitor.getInstance()); final JassOrder javaValue = new JassOrder(orderId, buttonPositionX, buttonPositionY); javaValue.setType(type); - return new HandleJassValue(ordercommandcardType, javaValue); + return new HandleJassValue(orderbuttonType, javaValue); } }); - jassProgramVisitor.getJassNativeManager().createNative("AbilityTypeAddOrderCommandCard", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final CAbilityTypeJassDefinition abilityType = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final JassOrder commandCard = arguments.get(1).visit(ObjectJassValueVisitor.getInstance()); - abilityType.addJassOrder(commandCard); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("AbilityTypeRemoveOrderCommandCard", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final CAbilityTypeJassDefinition abilityType = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final JassOrder commandCard = arguments.get(1).visit(ObjectJassValueVisitor.getInstance()); - abilityType.removeJassOrder(commandCard); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardAutoCastOrderId", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final JassOrder orderCommandCard = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final int autoCastOrderId = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); - orderCommandCard.setAutoCastOrderId(autoCastOrderId); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardUnAutoCastOrderId", + jassProgramVisitor.getJassNativeManager().createNative("AbilityTypeAddOrderButton", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final CAbilityTypeJassDefinition abilityType = arguments.get(0) + .visit(ObjectJassValueVisitor.getInstance()); + final JassOrder commandCard = arguments.get(1).visit(ObjectJassValueVisitor.getInstance()); + abilityType.addJassOrder(commandCard); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("AbilityTypeRemoveOrderButton", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final CAbilityTypeJassDefinition abilityType = arguments.get(0) + .visit(ObjectJassValueVisitor.getInstance()); + final JassOrder commandCard = arguments.get(1).visit(ObjectJassValueVisitor.getInstance()); + abilityType.removeJassOrder(commandCard); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonAutoCastOrderId", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final JassOrder orderCommandCard = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); + final int autoCastOrderId = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); + orderCommandCard.setAutoCastOrderId(autoCastOrderId); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonUnAutoCastOrderId", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, @@ -4276,7 +4316,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardContainerMenuOrderId", + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonContainerMenuOrderId", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, @@ -4288,7 +4328,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardDisabled", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonDisabled", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4298,7 +4338,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardManaCost", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonManaCost", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4308,7 +4348,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardGoldCost", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonGoldCost", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4318,7 +4358,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardLumberCost", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonLumberCost", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4328,7 +4368,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardFoodCostDisplayOnly", + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonFoodCostDisplayOnly", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, @@ -4340,7 +4380,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardCharges", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonCharges", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4350,19 +4390,17 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardAutoCastActive", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final JassOrder orderCommandCard = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final boolean active = arguments.get(1).visit(BooleanJassValueVisitor.getInstance()); - orderCommandCard.setAutoCastActive(active); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardHidden", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonAutoCastActive", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final JassOrder orderCommandCard = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); + final boolean active = arguments.get(1).visit(BooleanJassValueVisitor.getInstance()); + orderCommandCard.setAutoCastActive(active); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonHidden", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4372,7 +4410,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardIconPath", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonIconPath", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4382,31 +4420,27 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardButtonPositionX", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final JassOrder orderCommandCard = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final int buttonPosX = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); - orderCommandCard.setButtonPositionX(buttonPosX); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardButtonPositionY", - new JassFunction() { - @Override - public JassValue call(final List arguments, final GlobalScope globalScope, - final TriggerExecutionScope triggerScope) { - final JassOrder orderCommandCard = arguments.get(0) - .visit(ObjectJassValueVisitor.getInstance()); - final int buttonPosY = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); - orderCommandCard.setButtonPositionY(buttonPosY); - return null; - } - }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardToolTip", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonButtonPositionX", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final JassOrder orderCommandCard = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); + final int buttonPosX = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); + orderCommandCard.setButtonPositionX(buttonPosX); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonButtonPositionY", new JassFunction() { + @Override + public JassValue call(final List arguments, final GlobalScope globalScope, + final TriggerExecutionScope triggerScope) { + final JassOrder orderCommandCard = arguments.get(0).visit(ObjectJassValueVisitor.getInstance()); + final int buttonPosY = arguments.get(1).visit(IntegerJassValueVisitor.getInstance()); + orderCommandCard.setButtonPositionY(buttonPosY); + return null; + } + }); + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonToolTip", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4416,7 +4450,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardUberTip", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonUberTip", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4426,7 +4460,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardHotKey", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonHotKey", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4436,7 +4470,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardPreviewBuildUnitId", + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonPreviewBuildUnitId", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, @@ -4448,7 +4482,7 @@ public class Jass2 { return null; } }); - jassProgramVisitor.getJassNativeManager().createNative("SetOrderCommandCardAOE", new JassFunction() { + jassProgramVisitor.getJassNativeManager().createNative("SetOrderButtonAOE", new JassFunction() { @Override public JassValue call(final List arguments, final GlobalScope globalScope, final TriggerExecutionScope triggerScope) { @@ -4603,6 +4637,7 @@ public class Jass2 { final HandleJassType ordercommandcardtypeType = globals.registerHandleType("ordercommandcardtype"); final HandleJassType abilitybehaviorType = globals.registerHandleType("abilitybehavior"); final HandleJassType behaviorexprType = globals.registerHandleType("behaviorexpr"); + final HandleJassType iconuiType = globals.registerHandleType("iconui"); registerTypingNatives(jassProgramVisitor, raceType, alliancetypeType, racepreferenceType, igamestateType, fgamestateType, playerstateType, playerscoreType, playergameresultType, unitstateType, diff --git a/core/src/com/etheller/warsmash/parsers/jass/scope/CommonTriggerExecutionScope.java b/core/src/com/etheller/warsmash/parsers/jass/scope/CommonTriggerExecutionScope.java index 51f736f..a5ab0ee 100644 --- a/core/src/com/etheller/warsmash/parsers/jass/scope/CommonTriggerExecutionScope.java +++ b/core/src/com/etheller/warsmash/parsers/jass/scope/CommonTriggerExecutionScope.java @@ -10,7 +10,7 @@ import com.etheller.warsmash.viewer5.handlers.w3x.simulation.CWidget; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.CAbility; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.targeting.AbilityPointTarget; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrder; -import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderCommandCardType; +import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderButtonType; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.players.CPlayerJass; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.region.CRegion; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.timers.CTimerJass; @@ -83,7 +83,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { private AbilityPointTarget spellTargetPoint; private War3ID spellAbilityId; private int spellAbilityOrderId; // Warsmash only - private JassOrderCommandCardType spellAbilityTargetType; // Warsmash only + private JassOrderButtonType spellAbilityTargetType; // Warsmash only private JassOrder spellAbilityOrderCommandCard; // Warsmash only private JassGameEventsWar3 triggerEventId; @@ -411,7 +411,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { return this.spellAbilityOrderId; } - public JassOrderCommandCardType getSpellAbilityTargetType() { + public JassOrderButtonType getSpellAbilityTargetType() { return this.spellAbilityTargetType; } @@ -583,7 +583,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityTargetScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final CUnit targetUnit, final War3ID spellAbilityId, - final int spellAbilityOrderId, final JassOrderCommandCardType spellAbilityTargetType, + final int spellAbilityOrderId, final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; @@ -598,7 +598,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityTargetScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final CItem targetItem, final War3ID spellAbilityId, - final int spellAbilityOrderId, final JassOrderCommandCardType spellAbilityTargetType, + final int spellAbilityOrderId, final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; @@ -613,7 +613,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityTargetScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final CDestructable targetDestructable, final War3ID spellAbilityId, - final int spellAbilityOrderId, final JassOrderCommandCardType spellAbilityTargetType, + final int spellAbilityOrderId, final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; @@ -628,7 +628,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityPointScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final AbilityPointTarget targetPoint, final War3ID spellAbilityId, - final int spellAbilityOrderId, final JassOrderCommandCardType spellAbilityTargetType, + final int spellAbilityOrderId, final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; @@ -643,7 +643,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityNoTargetScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final War3ID spellAbilityId, final int spellAbilityOrderId, - final JassOrderCommandCardType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { + final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; scope.spellAbilityUnit = spellAbilityUnit; @@ -678,7 +678,7 @@ public class CommonTriggerExecutionScope extends TriggerExecutionScope { public static CommonTriggerExecutionScope jassAbilityBasicScope(final CAbility spellAbility, final CUnit spellAbilityUnit, final War3ID spellAbilityId, final int spellAbilityOrderId, - final JassOrderCommandCardType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { + final JassOrderButtonType spellAbilityTargetType, final JassOrder spellAbilityOrderCommandCard) { final CommonTriggerExecutionScope scope = new CommonTriggerExecutionScope(null, TriggerExecutionScope.EMPTY); scope.spellAbility = spellAbility; scope.spellAbilityUnit = spellAbilityUnit; diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/rendersim/commandbuttons/CommandCardPopulatingAbilityVisitor.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/rendersim/commandbuttons/CommandCardPopulatingAbilityVisitor.java index 27fc401..211036f 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/rendersim/commandbuttons/CommandCardPopulatingAbilityVisitor.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/rendersim/commandbuttons/CommandCardPopulatingAbilityVisitor.java @@ -33,7 +33,7 @@ import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.queue.CAb import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.queue.CAbilityRally; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.queue.CAbilityReviveHero; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrder; -import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderCommandCardType; +import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.types.jass.CAbilityTypeJassDefinition.JassOrderButtonType; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilities.upgrade.CAbilityUpgrade; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.combat.attacks.CUnitAttack; import com.etheller.warsmash.viewer5.handlers.w3x.simulation.orders.OrderIds; @@ -187,7 +187,7 @@ public class CommandCardPopulatingAbilityVisitor implements CAbilityVisitor() { @@ -237,7 +237,7 @@ public class CAbilityTypeJassDefinition extends AbstractCAbilityTypeDefinition receiver) { final JassOrder orderCommandCardIcon = getOrderCommandCardIcon(game, unit, orderId); - if ((orderCommandCardIcon != null) && ((orderCommandCardIcon.type == JassOrderCommandCardType.UNIT_TARGET) - || (orderCommandCardIcon.type == JassOrderCommandCardType.UNIT_OR_POINT_TARGET))) { + if ((orderCommandCardIcon != null) && ((orderCommandCardIcon.type == JassOrderButtonType.UNIT_TARGET) + || (orderCommandCardIcon.type == JassOrderButtonType.UNIT_OR_POINT_TARGET))) { if (this.checkTargetJass != null) { CommonTriggerExecutionScope scope; scope = target.visit(new CWidgetVisitor() { @@ -346,8 +346,8 @@ public class CAbilityTypeJassDefinition extends AbstractCAbilityTypeDefinition receiver) { final JassOrder orderCommandCardIcon = getOrderCommandCardIcon(game, unit, orderId); - if ((orderCommandCardIcon != null) && ((orderCommandCardIcon.type == JassOrderCommandCardType.POINT_TARGET) - || (orderCommandCardIcon.type == JassOrderCommandCardType.UNIT_OR_POINT_TARGET))) { + if ((orderCommandCardIcon != null) && ((orderCommandCardIcon.type == JassOrderButtonType.POINT_TARGET) + || (orderCommandCardIcon.type == JassOrderButtonType.UNIT_OR_POINT_TARGET))) { if (this.checkTargetJass != null) { if (this.checkTargetJass.evaluate(this.jassGlobalScope, CommonTriggerExecutionScope.jassAbilityPointScope(abilityJass, unit, target, @@ -371,7 +371,7 @@ public class CAbilityTypeJassDefinition extends AbstractCAbilityTypeDefinition receiver) { final JassOrder orderCommandCardIcon = getOrderCommandCardIcon(game, unit, orderId); if ((orderCommandCardIcon != null) - && (orderCommandCardIcon.type == JassOrderCommandCardType.INSTANT_NO_TARGET)) { + && (orderCommandCardIcon.type == JassOrderButtonType.INSTANT_NO_TARGET)) { if (this.checkTargetJass != null) { if (this.checkTargetJass.evaluate(this.jassGlobalScope, CommonTriggerExecutionScope.jassAbilityNoTargetScope(abilityJass, unit, abilityJass.getAlias(), @@ -397,7 +397,7 @@ public class CAbilityTypeJassDefinition extends AbstractCAbilityTypeDefinition