[Mod Request] show colony wealth

Started by Purzi, January 21, 2021, 05:16:56 AM

Previous topic - Next topic

Purzi

I would like a mod that shows the total colony wealth permanently in the overlay.
Maybe in the overview at the bottom right where temperature, time, season and so on are displayed.

RawCode

this is  how game render "real time" if feature is enabled

public static void DoRealtimeClock(float leftX, float width, ref float curBaseY)
{
Rect clockRect = new Rect(leftX - 20f, curBaseY - 26f, width + 20f - 7f, 26f);
Text.Anchor = TextAnchor.MiddleRight;
Widgets.Label(clockRect, DateTime.Now.ToString("HH:mm"));
Text.Anchor = TextAnchor.UpperLeft;
curBaseY -= 26f;
}


adding new rendering does not require code injection, you can add GameComponent subclass as XML def and custom class with GameComponentOnGUI that will render whatever you want on screen.

just make sure to cache results and implement your rendering as fast as possible, because your method will fire 60 times per second and will consume global tick time.

request is interesting but low effort, it's literally 10 minutes to make including "original research" time.