This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #48 Add basic support of Template Generation
Ads basic support for the Imperial Asssault Army overlay generation. Pages have been split out to the common types vs the game specific types.
- Loading branch information
1 parent
4c0fc56
commit 977673e
Showing
15 changed files
with
221 additions
and
101 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
bundles/us.nineworlds.xstreamer.ia.data/templates/army/html/common/common_utils.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<#function findDeployment deployment> | ||
<#list allDeployments as rdeployment> | ||
<#if rdeployment.iaspecName = deployment.iaSpecName && rdeployment.faction == deployment.faction> | ||
<#return rdeployment> | ||
</#if> | ||
</#list> | ||
<#return null> | ||
</#function> |
79 changes: 34 additions & 45 deletions
79
bundles/us.nineworlds.xstreamer.ia.data/templates/army/html/leftaligned_army_detail.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,50 @@ | ||
<div id="army"> | ||
<hr/> | ||
<#list iaspec.army.deployments as deployments> | ||
<#assign dbDeployment>${fun.deploymentLookup(deployments.deployment)}</#assign> | ||
<#if dbDeployment??> | ||
<div class="deployment"> | ||
<div class="name"> | ||
<span class="mercenary"></span><span class="deploymentName">${deployments.deployment.name}</span> | ||
<span>(${deployments.deployment.deploymentCost})</span> | ||
<span class="${dbDeployment.faction.toString()}"></span><span class="deploymentName">${dbDeployment.name}</span> | ||
<span>(${dbDeployment.deploymentCost})</span> | ||
</div> | ||
<#if dbDeployment.attack?? || dbDeployment.defense??> | ||
<div id="attack_defense"> | ||
<#if deployments.deployment.attack.attackType == "range"> | ||
<#if dbDeployment.attack.attackType.toString() == "range"> | ||
<div class="left-text range"></div> | ||
<#else> | ||
<#elseif dbDeployment.attack.attackType == "melee"> | ||
<div class="left-text melee"></div> | ||
</#if> | ||
<div class="box red"> </div> | ||
<div class="spacer"> </div> | ||
<div class="box blue"> </div> | ||
<#if dbDeployment.attack.getDicePool()?? && dbDeployment.deploymentType.toString() == "deployment"> | ||
<#list dbDeployment.attack.getDicePool() as attackDice> | ||
<#switch attackDice.toString()> | ||
<#case "red"><div class="box red"> </div><#break> | ||
<#case "blue"><div class="box blue"> </div><#break> | ||
<#case "green"><div class="box green"> </div><#break> | ||
<#case "yellow"><div class="box yellow"> </div><#break> | ||
<#case "any"><div class="box any"> </div><#break> | ||
<#default><#break> | ||
</#switch> | ||
<div class="spacer"> </div> | ||
</#list> | ||
</#if> | ||
<#if dbDeployment.getDefenseDicePool()?? && dbDeployment.deploymentType.toString() == "deployment"> | ||
<div class="left-text defense"> E</div> | ||
<div class="box black"> </div> | ||
<#list dbDeployment.getDefenseDicePool() as defense> | ||
<#switch defense.toString()> | ||
<#case "white"><div class="box white"> </div><#break> | ||
<#case "black"><div class="box black"> </div><#break> | ||
<#default><#break> | ||
</#switch> | ||
</#list> | ||
<div class="spacer"> </div> | ||
<div class="box white"> </div> | ||
</#if> | ||
<br /> | ||
</div> | ||
|
||
<#if pilot.pilotSkill??> | ||
<span>${fun.pilotAliveDead(pilot)}</span> | ||
</#if> | ||
<span> ${pilot.name} </span> | ||
<#if pilot.hasCriticalDamage()> | ||
<span> <i class="xwing-miniatures-font xwing-miniatures-font-token-crit red"></i></span> | ||
</#if> | ||
</#if> | ||
<#if dbDeployment.deploymentType.toString() == "deployment"> | ||
<div class="vitals">${dbDeployment.getDeploymentCost()}❤ ${dbDeployment.getSpeed()}S ${dbDeployment.getUnitsInGroup()}U</div> | ||
</#if> | ||
</div> | ||
<div> | ||
<span><span class="attack-symbol">%</span> <b class="attack">${fun.findShipAttack(pilot.ship)} </b></span> | ||
<span><span class="agility-symbol">^</span> <b class="agility">${fun.findShipAgility(pilot.ship)} </b> </span> | ||
<span><span class="hull-symbol">&</span> <b class="hull">${(pilot.hull)!"0"} </b> </span> | ||
<span><span class="shields-symbol">*</span> <b class="shields">${(pilot.shields)!"0"}</b> </span> | ||
<#if pilot.pilotId!?length gt 0> | ||
<span class="idtag"><b>${pilot.pilotId}</b></span> | ||
</#if> | ||
<span> [${pilot.points}]</span> | ||
</div> | ||
|
||
<#if pilot.upgrades??> | ||
<#if pilot.upgrades.additionalProperties??> | ||
<div class="upgrades"> | ||
<#list pilot.upgrades.additionalProperties as key, value> | ||
${fun.upgradeIconMarkup(key)} | ||
<#list value as upgradeType> | ||
<#if upgradeType?has_next> | ||
<span>${fun.findUpgrade(upgradeType)}, </span> | ||
<#else> | ||
<span>${fun.findUpgrade(upgradeType)}</span><br/> | ||
</#if> | ||
</#list> | ||
</#list> | ||
</div> | ||
</#if> | ||
</#if> | ||
</#if> | ||
</#list> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...s/us.nineworlds.xstreamer.ia/src/us/nineworlds/xstreamer/ia/events/GenerateArmyEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package us.nineworlds.xstreamer.ia.events; | ||
|
||
public class GenerateArmyEvent { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...nineworlds.xstreamer.ia/src/us/nineworlds/xstreamer/ia/preferences/ArmyPrefencesPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package us.nineworlds.xstreamer.ia.preferences; | ||
|
||
import org.eclipse.jface.preference.*; | ||
import org.eclipse.ui.IWorkbenchPreferencePage; | ||
|
||
import us.nineworlds.xstreamer.Activator; | ||
import us.nineworlds.xstreamer.preferences.widgets.LabelFieldEditor; | ||
import us.nineworlds.xstreamer.preferences.widgets.SpacerFieldEditor; | ||
|
||
import org.eclipse.ui.IWorkbench; | ||
|
||
public class ArmyPrefencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { | ||
|
||
public ArmyPrefencesPage() { | ||
super(GRID); | ||
setPreferenceStore(Activator.getDefault().getPreferenceStore()); | ||
setDescription("Imperial Assault Generation Preferences"); | ||
} | ||
|
||
public void createFieldEditors() { | ||
addField(new DirectoryFieldEditor(PreferenceConstants.TEMPLATE_XSTREAMER_IA_OUTPUT_DIRECTORY, | ||
"XStreamer Output Directory:", getFieldEditorParent())); | ||
} | ||
|
||
public void init(IWorkbench workbench) { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.