[c#] How to determine if the building is used or not?

Started by Red192, September 19, 2019, 08:00:08 AM

Previous topic - Next topic

LWM


Red192


LWM

Quote from: Red192 on October 10, 2019, 01:29:22 PM
Right know i'm thinking to: Make a new building_worktable derived class, inside that i override UsedThisTick() to take the building, search if there is a FireOverlayOnUse component attached to it, if yes, change a public bool on it

Change a public bool on it?  You're not going to draw a fire overlay?

I think you'll manage to get it working :)

Red192

#18
I might find on a better solution: rename Draw() on the FireOverlay component and remove the override, make custom building class WorkTableWithFire, override usedThisTick() on it with: base.UsedThisTick(); this.GetComp<CompFireOverlayOnUse>().ReDraw();, put the new class in the thingClass of the custom building xml and... It works perfectly :)

EDIT: basically what you was telling me to do from the very begging but i did not understanding it, thanks LWM