jensbuehl / aoe4-guides

Source code for aoe4guides.com: Yet another Age of Empires IV build order tool
https://aoe4guides.com
MIT License
17 stars 7 forks source link

Support icons in build order steps #16

Closed jensbuehl closed 1 year ago

jensbuehl commented 1 year ago

E.g. use villager icon instead of plain text in the step description field. Inspired by: https://age4builder.com/

CraftySalamander commented 1 year ago

Suggestion to make the task easier for Overlay export.

You can copy this folder with all the images, without changing its architecture (same images for AoE4 Overlay & RTS Overlay, see my explanation in the overlay export issue).

In the overlay, each image is indicated as its path relative to this folder. For instance, "@unit_worker/villager.png@" will look for the image "villager.png" in the folder "unit_worker".

If you use these images without any change in the architecture, adapting the overlay export (and potentially the overlay JSON import function) will be super easy because the names and paths will be identical.

In case you want to use your own images and paths, it can still work, but you will need to define a dictionary (like this one).

jensbuehl commented 1 year ago

Great, thanks for your valuable input!

jensbuehl commented 1 year ago

Current state of imported images from AoE4_Overlay: Screenshot 2023-04-13 135357

TODO: Editor + optional tooltips

jensbuehl commented 1 year ago

@CraftySalamander While adapting the code for icon support, I found at least one missing image. How did you grab these images? (without background to be consistent)

So far I noticed that the Fertile Crescent Abbasid technology is missing.

CraftySalamander commented 1 year ago

I found them on aoe4world, see for instance https://aoe4world.com/explorer/civs/abbasid/technologies/fertile-crescent

This one makes sense since it was not part of the game when I made the last image update.

Once you are done adding all the missing images, can you give me the list (with folders) of new images? I will then be able to add them on RTS Overlay (and AoE4 Overlay if fine for Maguro)?

jensbuehl commented 1 year ago

Sure, will keep you posted so that the images stay in sync!

CraftySalamander commented 1 year ago

FYI, I prepared the code update in RTS Overlay to link to aoe4guides.com (see here). It will be part of release 1.5.1.

I will suggest the same to Maguro for AoE4 Overlay once the illustration format is ready.

jensbuehl commented 1 year ago

Illustrations will go live today. Just pull the pictures folder and diff it on your end - should include all (or most) of the Season 4 changes. https://github.com/jensbuehl/aoe4-guides/tree/main/public/assets/pictures

CraftySalamander commented 1 year ago

Very nice!

RTS Overlay update, see here.

AoE4 Overlay pull request, see here.

CraftySalamander commented 1 year ago

@jensbuehl There seems to be a bug when using the Overlay Tool copy function.

This BO export seems perfectly fine, I get notes like this: "5 @unit_worker/villager.png@ to @resource/sheep.png@, 1 @unit_worker/villager.png@ to build a @building_economy/house.png@ and a @building_economy/mill.png@ (queue vills)"

But this BO export seems buggy, I get notes like this: "Split the first 6&nbsp;<img src=\"https://aoe4guides.com/assets/pictures/unit_worker/villager.png\" class=\"icon\">between&nbsp;<img src=\"https://aoe4guides.com/assets/pictures/resource/resource_food.png\" class=\"icon\">(1)&nbsp;<img src=\"https://aoe4guides.com/assets/pictures/resource/resource_stone.png\" class=\"icon\">(5)."

Additional point, it is "builder" and not "builders" (no s) to use in "resources".

jensbuehl commented 1 year ago

@CraftySalamander Thanks for the feedback and testing. builders > builder fixed locally. Will deploy soonish.

The export issue is related to preserved empty spaces that slip in when e.g. multiple spaces in a row or using line breaks. So the spaces are really part of the data and exported "correctly".

I have to take a look - might slip into next week, though. Idea: Remove these redundant spaces when exporting. (string.replace(...))

jensbuehl commented 1 year ago

Can be verified using this BO on dev: https://aoe4-guides-dev.web.app/builds/gADkt4R7YvqSAisUDPVx

(Line 1 is exported fine. Line 2 is broken due to the preserved spaces.)

jensbuehl commented 1 year ago

There was a second issue regarding the format. Did not work when closing tag was missing. I fixed both. Both BOs work fine in the Overlay tool now.

Greetings and have a nice weekend :)

CraftySalamander commented 1 year ago

Great :-) Enjoy the weekend!