• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.
Resource icon

Migdol's Resource Allocation - Mini Revision 1.0

migdol

Chieftain
Joined
Feb 10, 2025
Messages
2
I've created my first mod to address the simple issues of basic sorting in the Resource Allocation screen. I saw others grating over the experience and wanted to share what I created while we wait for Firaxis to update and refine.

Download and details here:

-----

I'm hoping to build a more robust screen with customizable sorting, assuming others don't beat me to the punch and my day job doesn't drain my appetite to code.

If ya'll have any more insights and guidance on diving into modding, I'm all ears. I connected into the Helpline Discord and this forum hoping to learn more.
 
Great mod, @migdol! Just wondering if you'd be willing to add a "Distant Lands" label for relevant settlements? It would be really helpful in the Exploration Age as a lot of resources are more powerful for those settlements. If you get the coordinate pair for the city and the local player you should just be able to check via this:
JavaScript:
localPlayer.isDistantLands(coordinate)
 
This is awesome, very useful. Would it be possible to also add a Cities filter so that when selected only Towns aer displayed in the list?
 
this is great! i concur with the other suggestions, plus it'd be nice if we had more checkbox filters. i usually want to focus on Distant Lands or unhappy settlements, so filters to hide the Homelands and happy settlements would be nice. thanks!
Same for rail station indication for modern age ;-)
 
the new 1.1.0 update introduced a change to resources, giving them a small bonus when unassigned. they also extended the resource tooltips in a way that isn't showing up on the modded resource screen (see below).

resource-update.jpg
 
@migdol i think this is because of the sortBySettlementName function. that isn't using a locale-sensitive sort, so it's probably not handling the accents correctly in that name. replace the current comparisons with something like return firstName.localeCompare(secondName) and it should handle these cases better.
While it's probably a good idea to compare locale-sensitive, that wasn't the issue here. The settlement name that showed as AL-FUSTĀT in that screenshot, is actually al-Fustāt (visible in the Global Yield Breakdown window). It starts with a lowercase "a", which sorts after all uppercase letters. Locale-sensitive sorting doesn't help for this. You'll need case-insenstive sorting (or case-converting before compare).
 
Last edited:
Back
Top Bottom