Disable/Enable Gizmo in a building ?

Started by aRandomKiwi, November 08, 2018, 07:42:26 PM

Previous topic - Next topic

aRandomKiwi

Hi guys,

Is it possible to disable/enable an Gizmo  (button) ? because i try to disable the gizmos of a specific cooler (i need to re-enable them later) to prevent the player to change the targetTemperature :


foreach (var item in cooler.TryGetComp<CompTempControl>().CompGetGizmosExtra())
                {
                    item.disabled = true;
                    item.Disable();
                }


But this dont work, and even if the Disable method work i dont see any Enable method to re-enable the gizmo... is it the correct way to do this ?

Thanks !

aRandomKiwi

Resolved with a harmony prefix patch to "CompTempControl.CompGetGizmosExtra" method.