From e4351601a7ced91bf5a2c516a38db714d43e6ecf Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 8 Jan 2024 22:28:02 +0100 Subject: send resources + adminer css --- views/gemini/send-resources/01-resource-types.twig | 4 +++ views/gemini/send-resources/02-villages.twig | 6 ++++ views/gemini/send-units/02-villages.twig | 2 +- views/gemini/village.twig | 33 ++++++++++++++++------ 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 views/gemini/send-resources/01-resource-types.twig create mode 100644 views/gemini/send-resources/02-villages.twig (limited to 'views') diff --git a/views/gemini/send-resources/01-resource-types.twig b/views/gemini/send-resources/01-resource-types.twig new file mode 100644 index 0000000..586aa1e --- /dev/null +++ b/views/gemini/send-resources/01-resource-types.twig @@ -0,0 +1,4 @@ +Sendable Resource Capability: {{ marketplace.getResourceCapabilities(village) }} +{% for resourceType in ['wood', 'clay', 'iron', 'food'] %} +=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/{{ resourceType }} {{ resourceType }} +{% endfor %} diff --git a/views/gemini/send-resources/02-villages.twig b/views/gemini/send-resources/02-villages.twig new file mode 100644 index 0000000..54ccc5c --- /dev/null +++ b/views/gemini/send-resources/02-villages.twig @@ -0,0 +1,6 @@ +{{ selectedResourceType }} +Sendable Resource Capability: {{ marketplace.getResourceCapabilities(village) }} + +{% for listVillage in villages %} +=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/{{ selectedResourceType }}/village/{{ listVillage.x }}/{{ listVillage.y }} {{ listVillage.name }} - {{ listVillage.x }} x {{ listVillage.y }} +{% endfor %} diff --git a/views/gemini/send-units/02-villages.twig b/views/gemini/send-units/02-villages.twig index 80f5326..ea2741c 100644 --- a/views/gemini/send-units/02-villages.twig +++ b/views/gemini/send-units/02-villages.twig @@ -1,5 +1,5 @@ {{ selectedUnit }} {% for listVillage in villages %} -=> /village/{{ village.x }}/{{ village.y }}/send-units/type/{{ selectedUnit }}/village/{{ listVillage.x }}/{{ listVillage.y }} {{ listVillage.name }} - {{ listVillage.x }} - {{ listVillage.y }} +=> /village/{{ village.x }}/{{ village.y }}/send-units/type/{{ selectedUnit }}/village/{{ listVillage.x }}/{{ listVillage.y }} {{ listVillage.name }} - {{ listVillage.x }} x {{ listVillage.y }} {% endfor %} diff --git a/views/gemini/village.twig b/views/gemini/village.twig index d351eb6..d448020 100644 --- a/views/gemini/village.twig +++ b/views/gemini/village.twig @@ -57,6 +57,27 @@ Canceled {% endfor %} {% endif %} +{% if events['SendResources'] %} +## Send Resources +{% for event in events['SendResources'] %} +### {{ village.get(event.source).name }} -> {{ village.get(event.destination).name }} +Wood: {{ event.wood }} +Clay: {{ event.clay }} +Iron: {{ event.iron }} +Food: {{ event.food }} +Source: {{ village.get(event.source).name }} +Destination: {{ village.get(event.destination).name }} +Finished: {{ event.event.time | date('c') }} +{% if event.isCanceled %} +Canceled +{% else %} +{% if event.event.villageId == village.id %} +=> /event/{{ event.event.id }}/cancel Cancel +{% endif %} +{% endif %} +{% endfor %} +{% endif %} + # Buildings @@ -120,15 +141,11 @@ Travel Time: {{ unit.getTravelTime(unit, village.getDistance(unit.getHomeVillage {% include 'send-units/01-units.twig' %} +{% if village.canSendResources(village) %} # Send Resources -TODO -* list possible resource types -=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/wood Wood -=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/clay Clay -=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/iron Iron -=> /village/{{ village.x }}/{{ village.y }}/send-resources/type/food Food -* list possible villages -* send INPUT request for amount +{% include 'send-resources/01-resource-types.twig' %} +{% endif %} + {% include 'footer.twig' %} -- cgit v1.2.3