public override void _EnterTree() { o2Generator = (O2Generator)building; btnGiveO2 = GetNode <Button>("back/BtnO2"); RefreshBtnCompact(); }
private void TerminalRefresh() { if (MyAPIGateway.Gui.GetCurrentScreen == MyTerminalPageEnum.ControlPanel && Session.Instance.LastTerminalId == O2Generator.EntityId) { O2Generator.RefreshCustomInfo(); MyCube.UpdateTerminal(); } }
private void ResetAirEmissives(double tenPercent) { for (int i = 0; i < 10; i++) { if (tenPercent < 0 || i > tenPercent) { O2Generator.SetEmissiveParts("Emissive" + i, Color.Transparent, 0f); } else { O2Generator.SetEmissiveParts("Emissive" + i, UtilsStatic.GetAirEmissiveColorFromDouble(i * 10), 1f); } } }
private void SettingsUpdate() { if (_count == 3) { if (SettingsUpdated) { if (Session.Enforced.Debug == 3) { Log.Line($"SettingsUpdated: server:{_isServer} - FixRooms:{O2Set.Settings.FixRoomPressure} - O2GeneratorId [{O2Generator.EntityId}]"); } SettingsUpdated = false; O2Set.SaveSettings(); O2State.SaveState(); if (!ClientUiUpdate && O2Set.Settings.FixRoomPressure) { RestartDoorFix(); } } } else if (_count == 4 && !SettingsUpdated) { if (ClientUiUpdate) { if (Session.Enforced.Debug == 3) { Log.Line($"ClientUiUpdate: server:{_isServer} - FixRooms:{O2Set.Settings.FixRoomPressure} - O2GeneratorId [{O2Generator.EntityId}]"); } ClientUiUpdate = false; MyCube.UpdateTerminal(); O2Generator.RefreshCustomInfo(); if (!_isServer) { O2Set.NetworkUpdate(); } if (O2Set.Settings.FixRoomPressure) { RestartDoorFix(); } } } }