public static IEnumerable <Gizmo> CopyPasteGizmosFor(StorageSettings s) { yield return(new Command_Action { icon = ContentFinder <Texture2D> .Get("UI/Commands/CopySettings", true), defaultLabel = "CommandCopyZoneSettingsLabel".Translate(), defaultDesc = "CommandCopyZoneSettingsDesc".Translate(), action = delegate() { SoundDefOf.Tick_High.PlayOneShotOnCamera(null); StorageSettingsClipboard.Copy(s); }, hotKey = KeyBindingDefOf.Misc4 }); Command_Action paste = new Command_Action(); paste.icon = ContentFinder <Texture2D> .Get("UI/Commands/PasteSettings", true); paste.defaultLabel = "CommandPasteZoneSettingsLabel".Translate(); paste.defaultDesc = "CommandPasteZoneSettingsDesc".Translate(); paste.action = delegate() { SoundDefOf.Tick_High.PlayOneShotOnCamera(null); StorageSettingsClipboard.PasteInto(s); }; paste.hotKey = KeyBindingDefOf.Misc5; if (!StorageSettingsClipboard.HasCopiedSettings) { paste.Disable(null); } yield return(paste); yield break; }
public override IEnumerable <Gizmo> GetGizmos() { using (IEnumerator <Gizmo> enumerator = base.GetGizmos().GetEnumerator()) { if (enumerator.MoveNext()) { Gizmo g2 = enumerator.Current; yield return(g2); /*Error: Unable to find new state assignment for yield return*/; } } using (IEnumerator <Gizmo> enumerator2 = StorageSettingsClipboard.CopyPasteGizmosFor(settings).GetEnumerator()) { if (enumerator2.MoveNext()) { Gizmo g = enumerator2.Current; yield return(g); /*Error: Unable to find new state assignment for yield return*/; } } yield break; IL_014f: /*Error near IL_0150: Unexpected return in MoveNext()*/; }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo g in base.GetGizmos()) { yield return(g); } if (this.StorageTabVisible) { foreach (Gizmo g2 in StorageSettingsClipboard.CopyPasteGizmosFor(this.storageSettings)) { yield return(g2); } } if (!this.HasCorpse) { yield return(new Command_Action { defaultLabel = "CommandGraveAssignColonistLabel".Translate(), icon = ContentFinder <Texture2D> .Get("UI/Commands/AssignOwner", true), defaultDesc = "CommandGraveAssignColonistDesc".Translate(), action = delegate { Find.WindowStack.Add(new Dialog_AssignBuildingOwner(this.$this)); }, hotKey = KeyBindingDefOf.Misc3 }); } }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; switch (num) { case 0u: { Command_Action copy = new Command_Action(); copy.icon = ContentFinder <Texture2D> .Get("UI/Commands/CopySettings", true); copy.defaultLabel = "CommandCopyZoneSettingsLabel".Translate(); copy.defaultDesc = "CommandCopyZoneSettingsDesc".Translate(); copy.action = delegate() { SoundDefOf.Tick_High.PlayOneShotOnCamera(null); StorageSettingsClipboard.Copy(s); }; copy.hotKey = KeyBindingDefOf.Misc4; this.$current = copy; if (!this.$disposing) { this.$PC = 1; } return(true); } case 1u: paste = new Command_Action(); paste.icon = ContentFinder <Texture2D> .Get("UI/Commands/PasteSettings", true); paste.defaultLabel = "CommandPasteZoneSettingsLabel".Translate(); paste.defaultDesc = "CommandPasteZoneSettingsDesc".Translate(); paste.action = delegate() { SoundDefOf.Tick_High.PlayOneShotOnCamera(null); StorageSettingsClipboard.PasteInto(< CopyPasteGizmosFor > c__AnonStorey.s); }; paste.hotKey = KeyBindingDefOf.Misc5; if (!StorageSettingsClipboard.HasCopiedSettings) { paste.Disable(null); } this.$current = paste; if (!this.$disposing) { this.$PC = 2; } return(true); case 2u: this.$PC = -1; break; } return(false); }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo g in base.GetGizmos()) { yield return(g); } foreach (Gizmo g2 in StorageSettingsClipboard.CopyPasteGizmosFor(this.settings)) { yield return(g2); } }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo gizmo in base.GetGizmos()) { yield return(gizmo); } foreach (Gizmo item in StorageSettingsClipboard.CopyPasteGizmosFor(settings)) { yield return(item); } }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo g in this.< GetGizmos > __BaseCallProxy0()) { yield return(g); } foreach (Gizmo g2 in StorageSettingsClipboard.CopyPasteGizmosFor(this.settings)) { yield return(g2); } yield break; }
public static IEnumerable <Gizmo> CopyPasteGizmosFor(StorageSettings s) { yield return((Gizmo) new Command_Action { icon = ContentFinder <Texture2D> .Get("UI/Commands/CopySettings", true), defaultLabel = "CommandCopyZoneSettingsLabel".Translate(), defaultDesc = "CommandCopyZoneSettingsDesc".Translate(), action = delegate { SoundDefOf.TickHigh.PlayOneShotOnCamera(null); StorageSettingsClipboard.Copy(s); }, hotKey = KeyBindingDefOf.Misc4 }); /*Error: Unable to find new state assignment for yield return*/; }
public override IEnumerable <Gizmo> GetGizmos() { using (IEnumerator <Gizmo> enumerator = base.GetGizmos().GetEnumerator()) { if (enumerator.MoveNext()) { Gizmo g2 = enumerator.Current; yield return(g2); /*Error: Unable to find new state assignment for yield return*/; } } if (StorageTabVisible) { using (IEnumerator <Gizmo> enumerator2 = StorageSettingsClipboard.CopyPasteGizmosFor(storageSettings).GetEnumerator()) { if (enumerator2.MoveNext()) { Gizmo g = enumerator2.Current; yield return(g); /*Error: Unable to find new state assignment for yield return*/; } } } if (!HasCorpse) { yield return((Gizmo) new Command_Action { defaultLabel = "CommandGraveAssignColonistLabel".Translate(), icon = ContentFinder <Texture2D> .Get("UI/Commands/AssignOwner"), defaultDesc = "CommandGraveAssignColonistDesc".Translate(), action = delegate { Find.WindowStack.Add(new Dialog_AssignBuildingOwner(((_003CGetGizmos_003Ec__Iterator1) /*Error near IL_01bb: stateMachine*/)._0024this)); }, hotKey = KeyBindingDefOf.Misc3 }); /*Error: Unable to find new state assignment for yield return*/; } yield break; IL_0205: /*Error near IL_0206: Unexpected return in MoveNext()*/; }
public override IEnumerable <Gizmo> GetGizmos() { foreach (Gizmo gizmo in base.GetGizmos()) { yield return(gizmo); } if (CanExtractShell) { CompChangeableProjectile compChangeableProjectile = gun.TryGetComp <CompChangeableProjectile>(); Command_Action command_Action = new Command_Action(); command_Action.defaultLabel = "CommandExtractShell".Translate(); command_Action.defaultDesc = "CommandExtractShellDesc".Translate(); command_Action.icon = compChangeableProjectile.LoadedShell.uiIcon; command_Action.iconAngle = compChangeableProjectile.LoadedShell.uiIconAngle; command_Action.iconOffset = compChangeableProjectile.LoadedShell.uiIconOffset; command_Action.iconDrawScale = GenUI.IconDrawScale(compChangeableProjectile.LoadedShell); command_Action.action = delegate { ExtractShell(); }; yield return(command_Action); } CompChangeableProjectile compChangeableProjectile2 = gun.TryGetComp <CompChangeableProjectile>(); if (compChangeableProjectile2 != null) { StorageSettings storeSettings = compChangeableProjectile2.GetStoreSettings(); foreach (Gizmo item in StorageSettingsClipboard.CopyPasteGizmosFor(storeSettings)) { yield return(item); } } if (CanSetForcedTarget) { Command_VerbTarget command_VerbTarget = new Command_VerbTarget(); command_VerbTarget.defaultLabel = "CommandSetForceAttackTarget".Translate(); command_VerbTarget.defaultDesc = "CommandSetForceAttackTargetDesc".Translate(); command_VerbTarget.icon = ContentFinder <Texture2D> .Get("UI/Commands/Attack"); command_VerbTarget.verb = AttackVerb; command_VerbTarget.hotKey = KeyBindingDefOf.Misc4; command_VerbTarget.drawRadius = false; if (base.Spawned && IsMortarOrProjectileFliesOverhead && base.Position.Roofed(base.Map)) { command_VerbTarget.Disable("CannotFire".Translate() + ": " + "Roofed".Translate().CapitalizeFirst()); } yield return(command_VerbTarget); } if (forcedTarget.IsValid) { Command_Action command_Action2 = new Command_Action(); command_Action2.defaultLabel = "CommandStopForceAttack".Translate(); command_Action2.defaultDesc = "CommandStopForceAttackDesc".Translate(); command_Action2.icon = ContentFinder <Texture2D> .Get("UI/Commands/Halt"); command_Action2.action = delegate { ResetForcedTarget(); SoundDefOf.Tick_Low.PlayOneShotOnCamera(); }; if (!forcedTarget.IsValid) { command_Action2.Disable("CommandStopAttackFailNotForceAttacking".Translate()); } command_Action2.hotKey = KeyBindingDefOf.Misc5; yield return(command_Action2); } if (!CanToggleHoldFire) { yield break; } Command_Toggle command_Toggle = new Command_Toggle(); command_Toggle.defaultLabel = "CommandHoldFire".Translate(); command_Toggle.defaultDesc = "CommandHoldFireDesc".Translate(); command_Toggle.icon = ContentFinder <Texture2D> .Get("UI/Commands/HoldFire"); command_Toggle.hotKey = KeyBindingDefOf.Misc6; command_Toggle.toggleAction = delegate { holdFire = !holdFire; if (holdFire) { ResetForcedTarget(); } }; command_Toggle.isActive = () => holdFire; yield return(command_Toggle); }