From 94a3dd52da3ae180af37c6fd0e8c24b3562da388 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 4 Oct 2023 11:32:04 +0200 Subject: initial commit 2 --- views/base.twig | 6 +- views/map.twig | 32 +++++++++ views/root.twig | 2 + views/village.twig | 196 +++++++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 215 insertions(+), 21 deletions(-) create mode 100644 views/map.twig (limited to 'views') diff --git a/views/base.twig b/views/base.twig index 94e5037..0063e31 100644 --- a/views/base.twig +++ b/views/base.twig @@ -2,7 +2,11 @@ {% block body %}
-
+
+ +
{% block main %}{% endblock %} diff --git a/views/map.twig b/views/map.twig new file mode 100644 index 0000000..43f1a5b --- /dev/null +++ b/views/map.twig @@ -0,0 +1,32 @@ +{% extends 'base.twig' %} + +{% block main %} +
+
+ Up +
+
+
+ Left +
+
+ {% for row in range(-range, range) %} + {% for column in range(-range, range) %} + {% set village = map[x + column][y + row] %} + + {% endfor %} + {% endfor %} +
+
+ Right +
+
+
+ Down +
+
+{% endblock %} diff --git a/views/root.twig b/views/root.twig index 11dc665..35399c0 100644 --- a/views/root.twig +++ b/views/root.twig @@ -3,6 +3,8 @@ + + {% block body %}{% endblock %} diff --git a/views/village.twig b/views/village.twig index 7bb55b2..ea6635c 100644 --- a/views/village.twig +++ b/views/village.twig @@ -4,15 +4,69 @@
-
{{ village.x }} x {{ village.y }} — {{ village.name }}
+
+ + + {{ village.x }} x {{ village.y }} + + + — + {{ village.name }} +
- wood: {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} – {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }} - clay: {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} – {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }} - iron: {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} – {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }} - food: {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} – {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }} +
+ + {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} + + {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }} +
+
+ + {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} + + {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }} +
+
+ + {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} + + {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }} +
+
+ + {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} + + {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }} +
- capacity: {{ village.getStorage(village.id).getCapacity() }} +
+ + {{ village.getStorage(village.id).getCapacity() }} +
+ + +

Storage Config

+
+ + + + + +
+
@@ -47,12 +101,68 @@ {% endif %} - {% if events.train %} + {% if events['TrainUnits'] %}

Train Units

+ + + + + + + + + + {% for event in events['TrainUnits'] %} + + + + + + {% endfor %} + +
UnitTime
{{ event.data.type }} + {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} + + + Cancel + +
{% endif %} - {% if events.send %} + {% if events['SendUnits'] %}

Send Resources / Units

+ + + + + + + + + + + + + + {% for event in events['SendUnits'] %} + + + + + + + + + + {% endfor %} + +
TypeUnitAmountOriginDestinationTime
{{ event.data.type }}{{ event.data.unit }}{{ event.data.amount }}{{ village.get(event.data.source).name }}{{ village.get(event.data.destination).name }} + {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} + + + Cancel + +
{% endif %}
@@ -76,11 +186,20 @@ {{ building.level }} {{ building.getBuildTime() | buildTime }} - wood: {{ building.getResourceRequirements()['wood'] }} + + + {{ building.getResourceRequirements()['wood'] }} +   - clay: {{ building.getResourceRequirements()['clay'] }} + + + {{ building.getResourceRequirements()['clay'] }} +   - iron: {{ building.getResourceRequirements()['iron'] }} + + + {{ building.getResourceRequirements()['iron'] }} +
@@ -114,18 +233,30 @@ {{ unit.getBuildTime(1) | buildTime }} - wood: {{ unit.getResourceRequirements()['wood'] }} + + + {{ unit.getResourceRequirements(unit, 1)['wood'] }} +   - clay: {{ unit.getResourceRequirements()['clay'] }} + + + {{ unit.getResourceRequirements(unit, 1)['clay'] }} +   - iron: {{ unit.getResourceRequirements()['iron'] }} + + + {{ unit.getResourceRequirements(unit, 1)['iron'] }} +   - food: {{ unit.getResourceRequirements()['food'] ?? 0 }} + + + {{ unit.getResourceRequirements(unit, 1)['food'] ?? 0 }} + - +
@@ -141,6 +272,7 @@ Amount Origin Location + Travel Time @@ -151,18 +283,42 @@ {{ unit.amount }} {{ village.get(unit.homeVillageId).name }} {{ not unit.isTraveling ? village.get(unit.residenceVillageId).name : '~traveling~' }} + {{ unit.getTravelTime(unit, village.getDistance(unit.getHomeVillage().x, unit.getHomeVillage().x, unit.getResidenceVillage().x, unit.getResidenceVillage().y)) | buildTime }} {% if not unit.isTraveling %} -
- - -
+ {% if unit.homeVillageId == village.id %} +
+ + +
+ {% else %} +
+ + +
+ {% endif %} {% endif %} {% endfor %} + +

Send Units

+
+ + + + +
-- cgit v1.2.3