yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.26k stars 1.55k forks source link

Feature request: Allow custom emoji packs for mods #10949

Open AutumnPizazz opened 7 months ago

AutumnPizazz commented 7 months ago

Before creating

Problem Description

I encountered some confusion while creating a module, including not finding a way to customize emoji characters. For example, I hope to define [Livability] as this icon Livability in the uniques text, but I can't do it. It seems that the current Unciv can only support five kinds of Stats emojis. I hope to allow module expansion (of course, I don't expect to be able to customize Stats, which is a huge amount of work).

Related Issue Links

No response

Desired Solution

Above.

Alternative Approaches

Above.

Additional Context

For example,

image

is not good, and 屏幕截图 2024-01-16 170019 this is good.

yairm210 commented 7 months ago

Is Livability a resource?

yairm210 commented 7 months ago

...it's not a stat, so it can't be in that unique anyway You should be doing that as a resource

AutumnPizazz commented 7 months ago

Yes. This is a Resource, but I hope to "disguise" it at the unique level

SomeTroglodyte commented 7 months ago

five kinds of Stats emojis

Isn't that seven? Seven Samurais, seven Flies, seven Dials, seven Bridges, seven Wizards...

AutumnPizazz commented 7 months ago

five kinds of Stats emojis

Isn't that seven? Seven Samurais, seven Flies, seven Dials, seven Bridges, seven Wizards...

It doesn't matter... I misremembered

AutumnPizazz commented 7 months ago

Seven Samurais, seven Flies, seven Dials, seven Bridges, seven Wizards...

I have difficulty capturing the original meaning of this passage, whether it's through a dictionary or GPT. What does it mean?

SomeTroglodyte commented 7 months ago

What does it mean

Just joking. Obscure references. A movie, a book, London, a song and Pratchett (as the eighth son might be a Sourcerer instead of a Wizzard).

SomeTroglodyte commented 7 months ago

hope to "disguise" it at the unique level

Then that should be a Comment Unique, and for those to support automatic ruleset object icons we would need nested brackets. Idea: Would uniques:["Comment [+2 {Livability}]"],... work? That should feed +2 {Livability} into the tr() function... Will the autoicons code trigger?

AutumnPizazz commented 7 months ago

Will the autoicons code trigger?

It doesn't work...

image image

And I store this png file in unciv\mods\CoeHarMod\Images\OtherIcons

SomeTroglodyte commented 7 months ago

image

... the icons do work this way, but what I had forgotten - because my example didn't have any - the text outside the {} will of course not be translated ... So we would need [] nesting after all. Which is officially not supported, but happens to work on Comment uniques by lucky happenstance.

image One mod atlas icon, one builtin icon, translated - aucun probléme.

    "uniques": [
          "Comment [Can build [Shaolin Monastery] improvements on tiles]",
          "Comment [[Great General] provides double combat bonus]",
          "Great General provides double combat bonus <hidden from users>",

... and only one of the comments can reuse an existing translation, so the other one is in the mod.

OtherIcons? You said it was a resource... No point otherwise.

AutumnPizazz commented 7 months ago

This does work in the country selection interface, but it's not as good in the civilization encyclopedia interface.

image image image
yairm210 commented 7 months ago

I see, this is because of a conscious choice to remove those extra icons so you won't have double images - one because of the link for Livability, and one for the resource name I think this is nicer this way

AutumnPizazz commented 4 months ago

Sry to bring up this issue again, but this feature is very useful for richer mods. Hope developers can pick up this project.

SomeTroglodyte commented 4 months ago

Idea - we could introduce a new syntax for tr() - like $Resource.AuxiliaryCounter1$ inserts the font codepoint where we rendered that ruleset object, no matter whether the parameter says no icons or not...? Delimiter open to discussion. Maybe :eyeglasses: ? No that needs two codepoints.

AutumnPizazz commented 4 months ago

It's cool.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

AutumnPizazz commented 1 month ago

This should be not stale.