Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Ore priority checkbox
- if (m_enablePriority != null)
- {
- m_enablePriority.Title = MyStringId.GetOrCompute("Priority Mining");
- m_enablePriority.Tooltip = MyStringId.GetOrCompute("Enables setting of AI ore priorities when mining. The default is: rare ore, ice, iron.");
- m_enablePriority.Getter = (b) => b.GameLogic.GetAs<LaserDrillTurret>().PriorityEnabled;
- m_enablePriority.Setter = (b, v) => MessageUtils.SendMessageToAll(new MessageToggleOrePriority() { EntityId = b.EntityId, OrePriority = v });
- m_enablePriority.Visible = (b) => b.BlockDefinition.SubtypeId == "Large_SC_LaserDrillTurret";
- m_enablePriority.Enabled = (b) => true;
- m_enablePriority.OnText = MyStringId.GetOrCompute("On");
- m_enablePriority.OffText = MyStringId.GetOrCompute("Off");
- MyAPIGateway.TerminalControls.AddControl<SpaceEngineers.Game.ModAPI.Ingame.IMyLargeGatlingTurret>(m_enablePriority);
- var action = MyAPIGateway.TerminalControls.CreateAction<SpaceEngineers.Game.ModAPI.Ingame.IMyLargeGatlingTurret>("Phoenix.BD.EnableOrePriority");
- if( action != null )
- {
- StringBuilder actionname = new StringBuilder();
- actionname.Append(m_enablePriority.Title).Append(" ").Append(m_enablePriority.OnText).Append("/").Append(m_enablePriority.OffText);
- action.Name = actionname;
- action.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action.ValidForGroups = true;
- action.Action = (b) => m_enablePriority.Setter(b, !m_enablePriority.Getter(b));
- action.Writer = (b, t) => t.Append(b.GameLogic.GetAs<LaserDrillTurret>().PriorityEnabled ? m_enablePriority.OnText : m_enablePriority.OffText);
- MyAPIGateway.TerminalControls.AddAction<SpaceEngineers.Game.ModAPI.Ingame.IMyLargeGatlingTurret>(action);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment