From b21316248572cb27ed1f504529ad6680a473022e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 2 Jan 2024 20:42:01 +0100 Subject: gemini --- views/http/base.twig | 32 ++++ views/http/components/timer.twig | 26 +++ views/http/error.twig | 8 + views/http/login.twig | 17 ++ views/http/map.twig | 42 +++++ views/http/root.twig | 12 ++ views/http/village.twig | 361 +++++++++++++++++++++++++++++++++++++++ views/http/villages.twig | 38 +++++ 8 files changed, 536 insertions(+) create mode 100644 views/http/base.twig create mode 100644 views/http/components/timer.twig create mode 100644 views/http/error.twig create mode 100644 views/http/login.twig create mode 100644 views/http/map.twig create mode 100644 views/http/root.twig create mode 100644 views/http/village.twig create mode 100644 views/http/villages.twig (limited to 'views/http') diff --git a/views/http/base.twig b/views/http/base.twig new file mode 100644 index 0000000..15ddafd --- /dev/null +++ b/views/http/base.twig @@ -0,0 +1,32 @@ +{% extends 'root.twig' %} + +{% block body %} +
+
+ + Logged in as {{ session.user.username }} +
+ +
+ {% block main %}{% endblock %} +
+ +
+ +
+ +
+{% endblock %} diff --git a/views/http/components/timer.twig b/views/http/components/timer.twig new file mode 100644 index 0000000..ccb31a7 --- /dev/null +++ b/views/http/components/timer.twig @@ -0,0 +1,26 @@ + + + + diff --git a/views/http/error.twig b/views/http/error.twig new file mode 100644 index 0000000..f9d70cd --- /dev/null +++ b/views/http/error.twig @@ -0,0 +1,8 @@ +{% extends 'root.twig' %} + +{% block body %} +
+ {{ message }} + Back +
+{% endblock %} diff --git a/views/http/login.twig b/views/http/login.twig new file mode 100644 index 0000000..723d5d2 --- /dev/null +++ b/views/http/login.twig @@ -0,0 +1,17 @@ +{% extends 'root.twig' %} + +{% block body %} +
+
+ + + +
+
+{% endblock %} diff --git a/views/http/map.twig b/views/http/map.twig new file mode 100644 index 0000000..29f0294 --- /dev/null +++ b/views/http/map.twig @@ -0,0 +1,42 @@ +{% extends 'base.twig' %} + +{% block main %} +
+
+ + + +
+
+
+ + + +
+
+ {% for row in range(-range, range) %} + {% for column in range(-range, range) %} + {% set village = map[x + column][y + row] %} +
+ {% if village %} + + {{ map[x + column][y + row].name }} + + {% endif %} +
+ {% endfor %} + {% endfor %} +
+
+ + + +
+
+
+ + + +
+
+{% endblock %} diff --git a/views/http/root.twig b/views/http/root.twig new file mode 100644 index 0000000..35399c0 --- /dev/null +++ b/views/http/root.twig @@ -0,0 +1,12 @@ + + + + + + + + + + {% block body %}{% endblock %} + + diff --git a/views/http/village.twig b/views/http/village.twig new file mode 100644 index 0000000..c72018c --- /dev/null +++ b/views/http/village.twig @@ -0,0 +1,361 @@ +{% extends 'base.twig' %} + +{% block main %} +
+ +
+
+ + + {{ village.x }} x {{ village.y }} + + + — + {{ village.name }} +
+ +
+
+ + {{ 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() }} +
+ +
+ + {{ village.getStorage(village.id).getCapacity() }} +
+ + +

Storage Config

+
+ + + + + +
+
+
+
+ +
+

Events

+ + {% if events['UpgradeBuilding'] %} +

Upgrade Buildings

+ + + + + + + + + + {% for typeEvents in events['UpgradeBuilding'] %} + {% for event in typeEvents %} + + + + + + {% endfor %} + {% endfor %} + +
BuildingTime
{{ event.type }} + {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} + + + Cancel + +
+ {% endif %} + + {% if events['TrainUnits'] %} +

Train Units

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

Send Resources / Units

+ + + + + + + + + + + + + + {% for event in events['SendUnits'] %} + + + + + + + + + + {% endfor %} + +
TypeUnitAmountOriginDestinationTime
{{ event.type }}{{ event.unit }}{{ event.amount }}{{ village.get(event.source).name }}{{ village.get(event.destination).name }} + {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} + + {% if event.isCanceled %} + Canceled + {% else %} + {% if event.event.villageId == village.id %} +
+ +
+ {% endif %} + {% endif %} +
+ {% endif %} +
+ +
+
+

Buildings

+ + + + + + + + + + + + {% for building in buildings %} + + + + + + + + {% endfor %} + +
TypeLevelBuild TimeResources
{{ building.type | default(type) }}{{ building.level | default(0) }}{{ building.getBuildTimeForLevel(building.getEffectiveLevel() + 1) | buildTime }} + + + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['wood'] }} + +   + + + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['clay'] }} + +   + + + {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['iron'] }} + + +
+ +
+
+
+ +
+

Units

+ + + + + + + + + + + + + {% for unit in village.getUnits(village.id, 1, 3) %} + + + + + {% if not unit.isTraveling %} + + + + {% else %} + + {% endif %} + + {% endfor %} + +
TypeAmountBuild TimeResources
{{ unit.type }}{{ unit.amount }} + {{ unit.getBuildTime(1) | buildTime }} + + + + {{ unit.getResourceRequirements(unit, 1)['wood'] }} + +   + + + {{ unit.getResourceRequirements(unit, 1)['clay'] }} + +   + + + {{ unit.getResourceRequirements(unit, 1)['iron'] }} + +   + + + {{ unit.getResourceRequirements(unit, 1)['food'] ?? 0 }} + + +
+ + +
+
~traveling~
+ +

Supporting Units

+ + + + + + + + + + + + + + {% for unit in village.getUnits(village.id, 2) | merge(village.getUnits(village.id, 3)) %} + + + + + + + + + + {% endfor %} + +
TypeAmountOriginLocationTravel Time
{{ unit.type }}{{ 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 %} +
+ +

Send Units

+
+ + + + + +
+
+ + {% if village.getBuilding(village.id, 'Marketplace') %} +

Send Resources

+
+ + + + + + +
+ {% endif %} +
+
+{% endblock %} diff --git a/views/http/villages.twig b/views/http/villages.twig new file mode 100644 index 0000000..bdb87be --- /dev/null +++ b/views/http/villages.twig @@ -0,0 +1,38 @@ +{% extends 'base.twig' %} + +{% block main %} + + + + + + + + + + + + + + + {% for village in villages %} + + + + + + + + + + + {% endfor %} + +
NameCoordinatesWoodClayIronFoodStorageSatisfaction
+ + {{ village.name }} + + + { x: {{ village.x }}, y: {{ village.y }} } + {{ village.wood }}{{ village.clay }}{{ village.iron }}{{ village.food }}{{ village.getStorage(village.id).getCapacity() * (25 / 100) }}{{ village.satisfaction }}
+{% endblock %} -- cgit v1.2.3