Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
Issue #48 Fix rendering of Deployment Cards
Browse files Browse the repository at this point in the history
  • Loading branch information
kingargyle committed Nov 2, 2017
1 parent 977673e commit 3df8007
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This generates an Army overlay for Imperial Assault. The text will
be left aligned.
-->
<#-- <#import "common/common_utils.ftl" as fun> -->
<#import "common/common_utils.ftl" as fun>
<html>
<head>
<#include "common/css_leftaligned_army.ftl"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#function findDeployment deployment>
<#list allDeployments as rdeployment>
<#if rdeployment.iaspecName = deployment.iaSpecName && rdeployment.faction == deployment.faction>
<#return rdeployment>
<#if rdeployment.deployment.iaspecname = deployment.iaspecname && rdeployment.deployment.faction == deployment.faction>
<#return rdeployment.deployment>
</#if>
</#list>
<#return null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ body {
margin: 5px;
color: #FFFFFF;
text-shadow: 4px 1px #000000;
text-align: right;
text-align: left;
font-size: 100%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<div id="army">
<hr/>
<#list iaspec.army.deployments as deployments>
<#assign dbDeployment>${fun.deploymentLookup(deployments.deployment)}</#assign>
<#if dbDeployment??>
<#if fun.findDeployment(deployments.deployment)??>
<div class="deployment">
<div class="name">
<span class="${dbDeployment.faction.toString()}"></span><span class="deploymentName">${dbDeployment.name}</span>
<span>(${dbDeployment.deploymentCost})</span>
<span class="${fun.findDeployment(deployments.deployment).faction.toString()}"></span><span class="deploymentName">${fun.findDeployment(deployments.deployment).name}</span>
<span>(${fun.findDeployment(deployments.deployment).deploymentCost})</span>
</div>
<#if dbDeployment.attack?? || dbDeployment.defense??>
<#if fun.findDeployment(deployments.deployment).attack?? || fun.findDeployment(deployments.deployment).defense??>
<div id="attack_defense">
<#if dbDeployment.attack.attackType.toString() == "range">
<#if fun.findDeployment(deployments.deployment).attack.attackType.toString() == "range">
<div class="left-text range"></div>
<#elseif dbDeployment.attack.attackType == "melee">
<#elseif fun.findDeployment(deployments.deployment).attack.attackType == "melee">
<div class="left-text melee"></div>
</#if>
<#if dbDeployment.attack.getDicePool()?? && dbDeployment.deploymentType.toString() == "deployment">
<#list dbDeployment.attack.getDicePool() as attackDice>
<#if fun.findDeployment(deployments.deployment).attack.getDicePool()?? && fun.findDeployment(deployments.deployment).deploymentType.toString() == "deployment">
<#list fun.findDeployment(deployments.deployment).attack.getDicePool() as attackDice>
<#switch attackDice.toString()>
<#case "red"><div class="box red">&nbsp;</div><#break>
<#case "blue"><div class="box blue">&nbsp;</div><#break>
Expand All @@ -28,9 +27,9 @@
<div class="spacer">&nbsp;</div>
</#list>
</#if>
<#if dbDeployment.getDefenseDicePool()?? && dbDeployment.deploymentType.toString() == "deployment">
<#if fun.findDeployment(deployments.deployment).getDefenseDicePool()?? && fun.findDeployment(deployments.deployment).deploymentType.toString() == "deployment">
<div class="left-text defense">&nbsp;&nbsp;E</div>
<#list dbDeployment.getDefenseDicePool() as defense>
<#list fun.findDeployment(deployments.deployment).getDefenseDicePool() as defense>
<#switch defense.toString()>
<#case "white"><div class="box white">&nbsp;</div><#break>
<#case "black"><div class="box black">&nbsp;</div><#break>
Expand All @@ -42,9 +41,10 @@
<br />
</div>
</#if>
<#if dbDeployment.deploymentType.toString() == "deployment">
<div class="vitals">${dbDeployment.getDeploymentCost()}&#10084; ${dbDeployment.getSpeed()}S ${dbDeployment.getUnitsInGroup()}U</div>
<#if fun.findDeployment(deployments.deployment).deploymentType.toString() == "deployment">
<div class="vitals">${fun.findDeployment(deployments.deployment).getDeploymentCost()}&#10084; ${fun.findDeployment(deployments.deployment).getSpeed()}S ${fun.findDeployment(deployments.deployment).getUnitsInGroup()}U</div>
</#if>
</div>
</#if>
</#list>

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected IStatus run(IProgressMonitor monitor) {
try {
realUrl = FileLocator.toFileURL(url);
File templateDirectory = FileUtils.toFile(realUrl);
templateInputDirectory = templateDirectory.getCanonicalPath().toString() + File.separator + "squads" + File.separator + "html";
templateInputDirectory = templateDirectory.getCanonicalPath().toString() + File.separator + "army" + File.separator + "html";
} catch (Exception ex) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
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());
setPreferenceStore(us.nineworlds.xstreamer.ia.Activator.getDefault().getPreferenceStore());
setDescription("Imperial Assault Generation Preferences");
}

Expand Down

0 comments on commit 3df8007

Please sign in to comment.