public void CreateModulatorUi(IMyTerminalBlock block)
        {
            try
            {
                if (ModControl)
                {
                    return;
                }
                var comp = block?.GameLogic?.GetAs <Modulators>();
                ModSep1   = TerminalHelpers.Separator(comp?.Modulator, "DS-M_sep1");
                ModDamage = TerminalHelpers.AddSlider(comp?.Modulator, "DS-M_DamageModulation", Localization.GetText("TerminalModDamageTitle"), Localization.GetText("TerminalModDamageTooltip"), ModUi.GetDamage, ModUi.SetDamage);
                ModDamage.SetLimits(20, 180);
                ModSep2      = TerminalHelpers.Separator(comp?.Modulator, "DS-M_sep2");
                ModReInforce = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateReInforceProt", Localization.GetText("TerminalModReInforceTitle"), Localization.GetText("TerminalModReInforceTooltip"), ModUi.GetReInforceProt, ModUi.SetReInforceProt);
                ModVoxels    = TerminalHelpers.AddCheckbox(comp?.Modulator, " DS-M_ModulateVoxels", Localization.GetText("TerminalModVoxelsTitle"), Localization.GetText("TerminalModVoxelsTooltip"), ModUi.GetVoxels, ModUi.SetVoxels);
                ModGrids     = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateGrids", Localization.GetText("TerminalModGridsTitle"), Localization.GetText("TerminalModGridsTooltip"), ModUi.GetGrids, ModUi.SetGrids);
                ModAllies    = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateAllies", Localization.GetText("TerminalModAlliesTitle"), Localization.GetText("TerminalModAlliesTooltip"), ModUi.GetAllies, ModUi.SetAllies);
                ModEmp       = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateEmpProt", Localization.GetText("TerminalModEmpTitle"), Localization.GetText("TerminalModEmpTooltip"), ModUi.GetEmpProt, ModUi.SetEmpProt);

                CreateActionDamageModRate <IMyUpgradeModule>(ModDamage);

                CreateAction <IMyUpgradeModule>(ModVoxels);
                CreateAction <IMyUpgradeModule>(ModGrids);
                CreateAction <IMyUpgradeModule>(ModEmp);
                CreateAction <IMyUpgradeModule>(ModReInforce);
                ModControl = true;
            }
            catch (Exception ex) { Log.Line($"Exception in CreateModulatorUi: {ex}"); }
        }
Example #2
0
        public void CreateModulatorUi(IMyTerminalBlock block)
        {
            try
            {
                if (ModControl)
                {
                    return;
                }
                var comp = block?.GameLogic?.GetAs <Modulators>();
                ModSep1   = TerminalHelpers.Separator(comp?.Modulator, "DS-M_sep1");
                ModDamage = TerminalHelpers.AddSlider(comp?.Modulator, "DS-M_DamageModulation", "Balance Shield Protection", "Balance Shield Protection", ModUi.GetDamage, ModUi.SetDamage);
                ModDamage.SetLimits(20, 180);
                ModSep2      = TerminalHelpers.Separator(comp?.Modulator, "DS-M_sep2");
                ModReInforce = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateReInforceProt", "Enhance structural integrity", "Enhance structural integrity, prevents damage from collisions", ModUi.GetReInforceProt, ModUi.SetReInforceProt);
                ModVoxels    = TerminalHelpers.AddCheckbox(comp?.Modulator, " DS-M_ModulateVoxels", "Terrain is ignored by shield", "Let voxels bypass shield", ModUi.GetVoxels, ModUi.SetVoxels);
                ModGrids     = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateGrids", "Entities may pass the shield", "Let grid bypass shield", ModUi.GetGrids, ModUi.SetGrids);
                ModAllies    = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateAllies", "Allied players can bypass", "Let ally players bypass shield", ModUi.GetAllies, ModUi.SetAllies);
                ModEmp       = TerminalHelpers.AddCheckbox(comp?.Modulator, "DS-M_ModulateEmpProt", "Protects against EMP damage", "But generates heat 10x faster", ModUi.GetEmpProt, ModUi.SetEmpProt);

                CreateActionDamageModRate <IMyUpgradeModule>(ModDamage);

                CreateAction <IMyUpgradeModule>(ModVoxels);
                CreateAction <IMyUpgradeModule>(ModGrids);
                CreateAction <IMyUpgradeModule>(ModEmp);
                CreateAction <IMyUpgradeModule>(ModReInforce);
                ModControl = true;
            }
            catch (Exception ex) { Log.Line($"Exception in CreateModulatorUi: {ex}"); }
        }