Resource icon

C15's TopPanel Extension 1.0

Chrisy15

Flower, Beautiful
Joined
Jul 9, 2015
Messages
2,134
Updated:
*Swapped various things around
*Now shows Net Amenities like it does on the CityPanel; should make more sense than a fraction
Known issues;
Amenities don't update instantly: should be easy fix but cbf rn
 
Updated:
*Amenity and Housing meters now update when an improvement is fiinished.
 
Updated for new patch! No longer replaces TopPanel.lua, and so is compatible with all mods that affect it so long as they've been updated for the latest patch too! Thanks to Suk for helping with this!
 
Updated for Fall Patch; if you are a UI Modder please read the Workshop Description to see how to handle the fact that the mod once again replaces TopPanel.lua.
 
I was looking at Sukritact's Simple UI Adjustments the other day, and I discovered his method for extending the minimap buttons without overriding the MinimapPanel scripts. The basic technique is to find the <Stack> containing the minimap buttons, and insert his new control into it. I wonder whether that technique would also work for extending the top panel?
 
I was looking at Sukritact's Simple UI Adjustments the other day, and I discovered his method for extending the minimap buttons without overriding the MinimapPanel scripts. The basic technique is to find the <Stack> containing the minimap buttons, and insert his new control into it. I wonder whether that technique would also work for extending the top panel?

I'm pretty sure this is what I do already, using include to have my Lua file insert functions into a table in TopPanel.lua which then adds the entries in this table into the Yields stack. The issue is that Firaxis removed this functionality in the Fall Patch, so I have to overwrite TopPanel.lua to reintroduce it but since the alteration is pretty simple and not at all intrusive other mods which overwrite TopPanel.lua can easily implement the support themselves.
 
Right, I am familiar with that mechanism. I just wonder whether it’s necessary to rewrite the RefreshYields() function in TopPanel.lua, or if it’s possible to have a completely separate module that hooks in solely by changing parents in the UI like Sukritact’s Simple UI Adjustments does. Specifically, maybe your graphic could hook the Lua event that triggers RefreshYields(), instead of inserting itself into RefreshYields()? I don’t have the source code handy to explain in greater detail, but maybe I can throw together a proof of concept later.
 
Updated for GS and to not overwrite the TopPanel anymore.
 
Back
Top Bottom