예제 #1
0
    public override void _EnterTree()
    {
        o2Generator = (O2Generator)building;
        btnGiveO2   = GetNode <Button>("back/BtnO2");

        RefreshBtnCompact();
    }
예제 #2
0
 private void TerminalRefresh()
 {
     if (MyAPIGateway.Gui.GetCurrentScreen == MyTerminalPageEnum.ControlPanel && Session.Instance.LastTerminalId == O2Generator.EntityId)
     {
         O2Generator.RefreshCustomInfo();
         MyCube.UpdateTerminal();
     }
 }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 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();
             }
         }
     }
 }