本文整理汇总了C#中MyTerminalControlOnOffSwitch.EnableToggleAction方法的典型用法代码示例。如果您正苦于以下问题:C# MyTerminalControlOnOffSwitch.EnableToggleAction方法的具体用法?C# MyTerminalControlOnOffSwitch.EnableToggleAction怎么用?C# MyTerminalControlOnOffSwitch.EnableToggleAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyTerminalControlOnOffSwitch
的用法示例。
在下文中一共展示了MyTerminalControlOnOffSwitch.EnableToggleAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyCollector
static MyCollector()
{
var useConvSystem = new MyTerminalControlOnOffSwitch<MyCollector>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConvSystem.Getter = (x) => (x as IMyInventoryOwner).UseConveyorSystem;
useConvSystem.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
useConvSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConvSystem);
}
示例2: MyReactor
static MyReactor()
{
var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyReactor>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyorSystem.Getter = (x) => (x).UseConveyorSystem;
useConveyorSystem.Setter = (x, v) => (x).UseConveyorSystem = v;
useConveyorSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyorSystem);
}
示例3: MySmallMissileLauncher
static MySmallMissileLauncher()
{
var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyor.Getter = (x) => x.m_useConveyorSystem;
useConveyor.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
useConveyor.Visible = (x) => x.CubeGrid.GridSizeEnum == MyCubeSize.Large; // Only large missile launchers can use conveyor system
useConveyor.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyor);
}
示例4: MySmallMissileLauncherReload
static MySmallMissileLauncherReload()
{
var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyor.Getter = (x) => x.UseConveyorSystem;
useConveyor.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
useConveyor.Visible = (x) => (true);
useConveyor.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyor);
}
示例5: MyAirtightDoorGeneric
static MyAirtightDoorGeneric()
{
var open = new MyTerminalControlOnOffSwitch<MyAirtightDoorGeneric>("Open", MySpaceTexts.Blank, on: MySpaceTexts.BlockAction_DoorOpen, off: MySpaceTexts.BlockAction_DoorClosed);
open.Getter = (x) => x.Open;
open.Setter = (x, v) => x.m_open.Value = v;
open.EnableToggleAction();
open.EnableOnOffActions();
MyTerminalControlFactory.AddControl(open);
}
示例6: CreateTerminalControls
static void CreateTerminalControls()
{
if (MyTerminalControlFactory.AreControlsCreated<MyReactor>())
return;
var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyReactor>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyorSystem.Getter = (x) => (x).UseConveyorSystem;
useConveyorSystem.Setter = (x, v) => (x).UseConveyorSystem = v;
useConveyorSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyorSystem);
}
示例7: MyFunctionalBlock
static MyFunctionalBlock()
{
var onOffSwitch = new MyTerminalControlOnOffSwitch<MyFunctionalBlock>("OnOff", MySpaceTexts.BlockAction_Toggle);
onOffSwitch.Getter = (x) => x.Enabled;
onOffSwitch.Setter = (x, v) => x.RequestEnable(v);
onOffSwitch.EnableToggleAction();
onOffSwitch.EnableOnOffActions();
MyTerminalControlFactory.AddControl(0, onOffSwitch);
MyTerminalControlFactory.AddControl(1, new MyTerminalControlSeparator<MyTerminalBlock>());
}
示例8: CreateTerminalControls
static void CreateTerminalControls()
{
if (MyTerminalControlFactory.AreControlsCreated<MySmallMissileLauncher>())
return;
var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyor.Getter = (x) => x.UseConveyorSystem;
useConveyor.Setter = (x, v) => x.UseConveyorSystem = v;
useConveyor.Visible = (x) => (true);
useConveyor.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyor);
}
示例9: CreateTerminalControls
protected override void CreateTerminalControls()
{
if (MyTerminalControlFactory.AreControlsCreated<MyDoorBase>())
return;
base.CreateTerminalControls();
var open = new MyTerminalControlOnOffSwitch<MyDoorBase>("Open", MySpaceTexts.Blank, on: MySpaceTexts.BlockAction_DoorOpen, off: MySpaceTexts.BlockAction_DoorClosed);
open.Getter = (x) => x.Open;
open.Setter = (x, v) => x.SetOpenRequest(v, x.OwnerId);
open.EnableToggleAction();
open.EnableOnOffActions();
MyTerminalControlFactory.AddControl(open);
}
示例10: CreateTerminalControls
protected override void CreateTerminalControls()
{
if (MyTerminalControlFactory.AreControlsCreated<MyLargeConveyorTurretBase>())
return;
base.CreateTerminalControls();
var separator = new MyTerminalControlSeparator<MyLargeConveyorTurretBase>();
MyTerminalControlFactory.AddControl(separator);
var useConvSystem = new MyTerminalControlOnOffSwitch<MyLargeConveyorTurretBase>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConvSystem.Getter = (x) => (x).UseConveyorSystem;
useConvSystem.Setter = (x, v) => x.UseConveyorSystem = v;
useConvSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConvSystem);
}
示例11: CreateTerminalControls
static void CreateTerminalControls()
{
if (MyTerminalControlFactory.AreControlsCreated<MyFunctionalBlock>())
return;
var onOffSwitch = new MyTerminalControlOnOffSwitch<MyFunctionalBlock>("OnOff", MySpaceTexts.BlockAction_Toggle);
onOffSwitch.Getter = (x) => x.Enabled;
onOffSwitch.Setter = (x, v) => x.Enabled = v;
onOffSwitch.EnableToggleAction();
onOffSwitch.EnableOnOffActions();
MyTerminalControlFactory.AddControl(0, onOffSwitch);
MyTerminalControlFactory.AddControl(1, new MyTerminalControlSeparator<MyFunctionalBlock>());
}
示例12: MyUserControllableGun
static MyUserControllableGun()
{
if (MyFakes.ENABLE_WEAPON_TERMINAL_CONTROL)
{
var shootOnce = new MyTerminalControlButton<MyUserControllableGun>("ShootOnce", MySpaceTexts.Terminal_ShootOnce, MySpaceTexts.Blank, (b) => b.OnShootOncePressed());
shootOnce.EnableAction();
MyTerminalControlFactory.AddControl(shootOnce);
var shoot = new MyTerminalControlOnOffSwitch<MyUserControllableGun>("Shoot", MySpaceTexts.Terminal_Shoot);
shoot.Getter = (x) => x.m_isShooting;
shoot.Setter = (x, v) => x.OnShootPressed(v);
shoot.EnableToggleAction();
shoot.EnableOnOffActions();
MyTerminalControlFactory.AddControl(shoot);
MyTerminalControlFactory.AddControl(new MyTerminalControlSeparator<MyUserControllableGun>());
}
}
示例13: MyOxygenGenerator
static MyOxygenGenerator()
{
var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyOxygenGenerator>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyorSystem.Getter = (x) => (x as IMyInventoryOwner).UseConveyorSystem;
useConveyorSystem.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
useConveyorSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyorSystem);
var refillButton = new MyTerminalControlButton<MyOxygenGenerator>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
refillButton.Enabled = (x) => x.CanRefill();
refillButton.EnableAction();
MyTerminalControlFactory.AddControl(refillButton);
var autoRefill = new MyTerminalControlCheckbox<MyOxygenGenerator>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
autoRefill.Getter = (x) => x.m_autoRefill;
autoRefill.Setter = (x, v) => x.m_autoRefill = v;
autoRefill.EnableAction();
MyTerminalControlFactory.AddControl(autoRefill);
}
示例14: MyGasGenerator
static MyGasGenerator()
{
var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyGasGenerator>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
useConveyorSystem.Getter = (x) => x.UseConveyorSystem;
useConveyorSystem.Setter = (x, v) => x.UseConveyorSystem = v ;
useConveyorSystem.EnableToggleAction();
MyTerminalControlFactory.AddControl(useConveyorSystem);
var refillButton = new MyTerminalControlButton<MyGasGenerator>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
refillButton.Enabled = (x) => x.CanRefill();
refillButton.EnableAction();
MyTerminalControlFactory.AddControl(refillButton);
var autoRefill = new MyTerminalControlCheckbox<MyGasGenerator>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
autoRefill.Getter = (x) => x.AutoRefill;
autoRefill.Setter = (x, v) => x.ChangeAutoRefill(v);
autoRefill.EnableAction();
MyTerminalControlFactory.AddControl(autoRefill);
}
示例15: MyOxygenTank
static MyOxygenTank()
{
var isStockpiling = new MyTerminalControlOnOffSwitch<MyOxygenTank>("Stockpile", MySpaceTexts.BlockPropertyTitle_Stockpile, MySpaceTexts.BlockPropertyDescription_Stockpile);
isStockpiling.Getter = (x) => x.IsStockpiling;
isStockpiling.Setter = (x, v) => x.SyncObject.ChangeStockpileMode(v);
isStockpiling.EnableToggleAction();
isStockpiling.EnableOnOffActions();
MyTerminalControlFactory.AddControl(isStockpiling);
var refillButton = new MyTerminalControlButton<MyOxygenTank>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
refillButton.Enabled = (x) => x.CanRefill();
refillButton.EnableAction();
MyTerminalControlFactory.AddControl(refillButton);
var autoRefill = new MyTerminalControlCheckbox<MyOxygenTank>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
autoRefill.Getter = (x) => x.m_autoRefill;
autoRefill.Setter = (x, v) => x.SyncObject.ChangeAutoRefill(v);
autoRefill.EnableAction();
MyTerminalControlFactory.AddControl(autoRefill);
}