yairm210 / Unciv

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

Civilopedia Unique parameter autolinking cannot react to ruleset change #4656

Closed SomeTroglodyte closed 3 years ago

SomeTroglodyte commented 3 years ago

Another note to self, though anybody is welcome to patch...

As the title says. That auto-mapping is done in FormattedLine.Companion using a cache map initialized by lazy from the current ruleset. Consequences are:

Possible approach: Drop the nice lazy and implement caching more traditionally. Let the 'CivilopediaText' modules receive a notification when the ruleset changes like ImageGetter gets (Or, monitor a ruleset change by comparing hashes on every access - no thanks). Manage cache rebuild using that.

AdityaMH commented 3 years ago

If you want add civilopedia to main menu. My suggestion is just add ruleset mod menu above and refreshed every changing mod selection. Also make it hidden when game was loaded.

SomeTroglodyte commented 3 years ago

civilopedia to main menu

Nope, not what I said. "engine", not the screen.

AdityaMH commented 3 years ago

if the engine is used from main menu

What benefit using "that engine" from main menu?

SomeTroglodyte commented 3 years ago

Way to reproduce: