示例#1
0
 public override IEnumerable <Gizmo> CompGetGizmosExtra()
 {
     if (Props.targetFuelLevelConfigurable)
     {
         Command_SetTargetFuelLevelMulti command_SetTargetFuelLevel = new Command_SetTargetFuelLevelMulti();
         command_SetTargetFuelLevel.refuelable   = this;
         command_SetTargetFuelLevel.defaultLabel = "3 CommandSetTargetFuelLevel".Translate();
         command_SetTargetFuelLevel.defaultDesc  = "3 CommandSetTargetFuelLevelDesc".Translate();
         command_SetTargetFuelLevel.icon         = SetTargetFuelLevelCommand;
         yield return(command_SetTargetFuelLevel);
     }
     if (Props.showFuelGizmo && Find.Selector.SingleSelectedThing == parent)
     {
         Gizmo_RefuelableFuelStatusMulti gizmo_RefuelableFuelStatus = new Gizmo_RefuelableFuelStatusMulti();
         gizmo_RefuelableFuelStatus.refuelable = this;
         yield return(gizmo_RefuelableFuelStatus);
     }
     if (Props.showAllowAutoRefuelToggle)
     {
         Command_Toggle command_Toggle = new Command_Toggle();
         command_Toggle.defaultLabel = "3 CommandToggleAllowAutoRefuel".Translate();
         command_Toggle.defaultDesc  = "3 CommandToggleAllowAutoRefuelDesc".Translate();
         command_Toggle.hotKey       = KeyBindingDefOf.Command_ItemForbid;
         command_Toggle.icon         = (allowAutoRefuel ? TexCommand.ForbidOff : TexCommand.ForbidOn);
         command_Toggle.isActive     = (() => allowAutoRefuel);
         command_Toggle.toggleAction = delegate
         {
             allowAutoRefuel = !allowAutoRefuel;
         };
         yield return(command_Toggle);
     }
 }
示例#2
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            if (Props.targetFuelLevelConfigurable)
            {
                Command_SetTargetFuelLevelMulti command_SetTargetFuelLevel = new Command_SetTargetFuelLevelMulti();
                command_SetTargetFuelLevel.refuelable   = this;
                command_SetTargetFuelLevel.defaultLabel = "4 CommandSetTargetFuelLevel".Translate();
                command_SetTargetFuelLevel.defaultDesc  = "4 CommandSetTargetFuelLevelDesc".Translate();
                command_SetTargetFuelLevel.icon         = SetTargetFuelLevelCommand;
                yield return(command_SetTargetFuelLevel);
            }
            if (Props.showFuelGizmo && Find.Selector.SingleSelectedThing == parent)
            {
                Gizmo_RefuelableFuelStatusMulti gizmo_RefuelableFuelStatus = new Gizmo_RefuelableFuelStatusMulti();
                gizmo_RefuelableFuelStatus.refuelable = this;
                yield return(gizmo_RefuelableFuelStatus);
            }
            if (Props.showAllowAutoRefuelToggle)
            {
                Command_Toggle command_Toggle = new Command_Toggle();
                command_Toggle.defaultLabel = "5 CommandToggleAllowAutoRefuel".Translate();
                command_Toggle.defaultDesc  = "5 CommandToggleAllowAutoRefuelDesc".Translate();
                command_Toggle.hotKey       = KeyBindingDefOf.Command_ItemForbid;
                command_Toggle.icon         = (allowAutoRefuel ? TexCommand.ForbidOff : TexCommand.ForbidOn);
                command_Toggle.isActive     = (() => allowAutoRefuel);
                command_Toggle.toggleAction = delegate
                {
                    allowAutoRefuel = !allowAutoRefuel;
                };
                yield return(command_Toggle);
            }
            var command_Action = new Command_SetAmmoType(this, this.parent.Map);

            command_Action.defaultLabel = "SetAmmoTypeSecond".Translate();
            command_Action.defaultDesc  = "SetAmmoTypeSecondDesc".Translate();
            command_Action.hotKey       = KeyBindingDefOf.Misc8;
            command_Action.icon         = ContentFinder <Texture2D> .Get("UI/Commands/LoadTransporter");

            yield return(command_Action);
        }
示例#3
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            if (Props.targetFuelLevelConfigurable)
            {
                Command_SetTargetFuelLevelMulti command_SetTargetFuelLevel = new Command_SetTargetFuelLevelMulti();
                command_SetTargetFuelLevel.refuelable   = this;
                command_SetTargetFuelLevel.defaultLabel = "CommandSetTargetFuelLevel".Translate();
                command_SetTargetFuelLevel.defaultDesc  = "CommandSetTargetFuelLevelDesc".Translate();
                command_SetTargetFuelLevel.icon         = SetTargetFuelLevelCommand;
                yield return(command_SetTargetFuelLevel);
            }
            if (Props.showFuelGizmo && Find.Selector.SingleSelectedThing == parent)
            {
                Gizmo_RefuelableFuelStatusMulti gizmo_RefuelableFuelStatus = new Gizmo_RefuelableFuelStatusMulti();
                gizmo_RefuelableFuelStatus.refuelable = this;
                yield return(gizmo_RefuelableFuelStatus);
            }
            if (Props.showAllowAutoRefuelToggle)
            {
                Command_Toggle command_Toggle = new Command_Toggle();
                command_Toggle.defaultLabel = "CommandToggleAllowAutoRefuel".Translate();
                command_Toggle.defaultDesc  = "CommandToggleAllowAutoRefuelDesc".Translate();
                command_Toggle.hotKey       = KeyBindingDefOf.Command_ItemForbid;
                command_Toggle.icon         = (allowAutoRefuel ? TexCommand.ForbidOff : TexCommand.ForbidOn);
                command_Toggle.isActive     = (() => allowAutoRefuel);
                command_Toggle.toggleAction = delegate
                {
                    allowAutoRefuel = !allowAutoRefuel;
                };
                yield return(command_Toggle);
            }
            if (Prefs.DevMode)
            {
                Command_Action command_Action = new Command_Action();
                command_Action.defaultLabel = "Debug: Set fuel to 0";
                command_Action.action       = delegate
                {
                    fuel = 0f;
                    parent.BroadcastCompSignal("Refueled");
                };
                yield return(command_Action);

                Command_Action command_Action2 = new Command_Action();
                command_Action2.defaultLabel = "Debug: Set fuel to 0.1";
                command_Action2.action       = delegate
                {
                    fuel = 0.1f;
                    parent.BroadcastCompSignal("Refueled");
                };
                yield return(command_Action2);

                Command_Action command_Action3 = new Command_Action();
                command_Action3.defaultLabel = "Debug: Set fuel to max";
                command_Action3.action       = delegate
                {
                    fuel = Props.fuelCapacity;
                    parent.BroadcastCompSignal("Refueled");
                };
                yield return(command_Action3);
            }
        }