Jump to content
lauri0

How to update building tooltips (e.g. modded upkeep cost)?

3 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

I am in the process of making a financial rebalance mod for Cities: Skylines. One annoying issue I have with the changes I have made to service buildings is that the first time I load into a map after starting the game the tooltips show vanilla values. Clicking on the building after placing it shows the new modded building stats and if I reload the map then the tooltips are updated as well. However, I would prefer if the tooltips were correct already the first time I load into a map.

Here's a sample of what my code does: https://pastebin.com/2jt02HU5

I looked around the game code to perhaps find a method which I could call to update tooltip info after changing buildingAI variables, but I didn't find any. Any ideas?

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

OnLevelLoaded is executed too late in the initialization sequence.

For that reason I made PrefabHook. It allows you to access the prefabs right after they were loaded from disk, before any logic takes place.

You would declare it as a dependency of your mod.

Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=530771650

Source & API docs: https://github.com/boformer/PrefabHook

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Awesome. Using this does the trick.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections