As much as I’d love to tell you that all the mods I write are great successes and that I find ways to make what I want happen come to life every single time, the truth is sometimes I spend 4-5 hours chasing my tail only to come up with nothing.
I do two things to draw inspiration for my mods: I watch Twitch streamers to see what frustrates them and their viewers the most, and I read the suggestion forums. While reading said forum yesterday I came across what seems like a good, simple and useful suggestion: the Mouse Rollover readout panel that shows soil info and other map cell information is hidden when you have an info panel or a tab open. If you’re trying to figure out where it’s warm so you can send a colonist or try to tell if a cell you want to set a growing stockpile on is soil or gravel you’re out of luck…you have to close what you are doing to get that information, then get back to what you were doing.
Some one asked if Tynan could make the location of that readout user movable. A quick look through the code and I see that the info about where to place the panel is in a private static field in the class. That’s easy enough to deal with by using reflection. I bang my head a bit trying to come up with the easiest way to implement changing it for the user that does the least amount of core code changing so that it’s compatible with as much as possible. I settle on making a new designator tab/button in the architecture tab drawer and using a designator in it as a button to bring up a settings dialog where you can change that location field…just to test it. I figured I’d make it work, then find a good place in the UI for it, and since I already have a good method for getting this code safely into the game I wouldn’t have to reinvent the wheel to test.
All goes well and the button makes the dialog pop up with no problem. I see the current value in the dialog and I change it. I only move it a little bit so I think maybe it’s still under the tab that’s open. I close the tab, and sure enough it’s no longer in the corner. So, I go back into the dialog (it defaults the x, y to 0, 0 so I make a note to fix that bug) and set it out to the middle of the screen.
I close out of the tab and poof, it pops up in the middle of the screen. Rut Roh, Raggy! A quick look at the decompiled source and sure enough: if the current system tab is not null, it exits the draw method and doesn’t print anything. Ok, this is going to be harder than I thought.
5 hours later, I’ve tried: making a new class that inherits the base class (no luck, the drawing function isn’t virtual, so can’t override it and a new function isn’t polymorphic so it still calls the base class), 4 different ways of running code to add the child class to another object and run it’s draw method in the new object’s draw method (no luck as a thing, window, designator or as an threaded method running constantly.)
I’m sure there’s a way to make this work, but it’s going on the shelf for now. Too much frustration with one project makes all the other projects stand still.
Time to go look at the feature request list and get to work again.