/// <summary> /// A special <see cref="RoundedRect"/> that can be coloured easily. /// If you are making custom <see cref="UIelement"/> that has this, Add this to <see cref="UIelement.subObjects"/>. /// </summary> /// <remarks>Example for custom <see cref="UIelement"/> constructor: <code> /// this.rect = new DyeableRect(menu, owner, this.pos, this.size, true); /// this.subObjects.Add(this.rect); /// </code></remarks> public DyeableRect(Menu.Menu menu, MenuObject owner, Vector2 pos, Vector2 size, bool filled = true) : base(menu, owner, pos, size, filled) { this.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey); this.colorF = Color.black; this.filled = filled; this.tab = false; if (filled) { tabInvisible = new List <FSprite> { this.sprites[2], this.sprites[6], this.sprites[7], this.sprites[11], this.sprites[15], this.sprites[16] }; } else { tabInvisible = new List <FSprite> { this.sprites[2], //3 this.sprites[6], this.sprites[7] }; } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Menu game = new Menu()) { game.Run(); } }
/// <summary> /// Initializes this class; Do NOT call this on your own /// </summary> internal static void Initialize(Menu.Menu menu) { tester = new MenuLabel(menu, menu.pages[0], "", new Vector2(10000f, 10000f), new Vector2(10000f, 100f), false); tester.label.alpha = 0f; tester.label.RemoveFromContainer(); testerB = new MenuLabel(menu, menu.pages[0], "", new Vector2(10000f, 10500f), new Vector2(10000f, 300f), true); testerB.label.alpha = 0f; testerB.label.RemoveFromContainer(); if (OptionScript.ComModExists) { float s = 1f / (int)OptionScript.ComMod.GetType().GetField("pMulti", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(OptionScript.ComMod); tester.label.scale = s; s = 1f / (int)OptionScript.ComMod.GetType().GetField("pdMulti", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(OptionScript.ComMod); testerB.label.scale = s; //Debug.Log($"ComMod detected: s:{s}, sd:{sd}"); } if (!hasChecked) { hasChecked = true; tester.text = "A"; testerB.text = "A"; _textHeight = tester.label.textRect.height; _textHeightB = testerB.label.textRect.height; tester.text = "A\nB"; testerB.text = "A\nB"; _lineHeight = tester.label.textRect.height - _textHeight; _lineHeightB = testerB.label.textRect.height - _textHeightB; //_textHeight *= s; _lineHeight *= s; _textHeightB *= sd; _lineHeightB *= sd; string meanTest = "ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcdefghijklmnopqrstuvwxyz. abcdefghijklmnopqrstuvwxyz! abcdefghijklmnopqrstuvwxyz?"; tester.text = meanTest; testerB.text = meanTest; //60473.68 _charMean = tester.label.textRect.width / meanTest.Length; _charMeanB = testerB.label.textRect.width / meanTest.Length; _charLim = Mathf.FloorToInt(60000f / (_lineHeight * _charMean)); _charLimB = Mathf.FloorToInt(60000f / (_lineHeightB * _charMeanB)); _font = (string)typeof(FLabel).GetField("_fontName", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(tester.label); _fontB = (string)typeof(FLabel).GetField("_fontName", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(testerB.label); Debug.Log($"CompletelyOptional) Label th: {_textHeight:0.0} thB: {_textHeightB:0.00} / lh: {_lineHeight:0.0} lhB: {_lineHeightB:0.0} / cm: {_charMean:0.0} cmB: {_charMeanB:0.0} / cl: {_charLim} clB: {_charLimB}"); } }
public MultiplayerChat(Menu.Menu menu, MenuObject owner, Vector2 pos, Vector2 size) : base(menu, owner, pos, size) { backgroundRect = new RoundedRect(menu, owner, pos, size, true); this.subObjects.Add(backgroundRect); slider = new VerticalSlider(menu, this, "Slider", new Vector2(-20f, 9f), new Vector2(30f, this.size.y - 40f), Slider.SliderID.LevelsListScroll, true); this.subObjects.Add(slider); }
public MultiplayerDisplayMenu(Menu.Menu menu, MenuObject owner, Vector2 pos, Vector2 size, Vector2 displayElementSize, float displayElementFade = 10) : base(menu, owner, pos, size) { backgroundRect = new RoundedRect(menu, owner, pos, size, true); this.subObjects.Add(backgroundRect); slider = new VerticalSlider(menu, this, "Slider", new Vector2(-20f, 9f), new Vector2(30f, this.size.y - 40f), Slider.SliderID.LevelsListScroll, true); this.subObjects.Add(slider); this.displayElementSize = displayElementSize; this.displayFadeStart = displayElementFade; }
public SoundTestPlayerUI(Menu.Menu menu, MenuObject owner, SoundTestOwner testOwner) : base(menu, owner, new Vector2(-1000f, -1000f), Vector2.zero) { this.lastPos = new Vector2(-1000f, -1000f); this.testOwner = testOwner; testOwner.ui = this; this.infoLabel = new MenuLabel(menu, this, "PlayerUI", new Vector2(this.size.x / 2f - 100f, 0f), new Vector2(200f, 20f), true); this.subObjects.Add(this.infoLabel); this.slugButton = new SlugButton(menu, this); this.subObjects.Add(this.slugButton); }
public void ctor(Menu.Menu menu, Menu.MenuObject owner, int pageIndex, int slugcatNumber) { string text = string.Empty; string text2 = string.Empty; orig_ctor(menu, owner, pageIndex, slugcatNumber); text = menu.Translate("THE WANDERER"); text2 = menu.Translate("Curious and calm, with a deep desire to discover the ancient mysteries around it.<LINE>In tune with the events of the world, your journey will have a significant impact on things much greater than yourself."); difficultyLabel = new Menu.MenuLabel(menu, this, text, new Vector2(-1000f, imagePos.y - 249f), new Vector2(200f, 30f), true); difficultyLabel.label.alignment = FLabelAlignment.Center; subObjects.Add(difficultyLabel); text2 = text2.Replace("<LINE>", Environment.NewLine); infoLabel = new Menu.MenuLabel(menu, this, text2, new Vector2(-1000f, imagePos.y - 249f - 40f), new Vector2(200f, 30f), false); infoLabel.label.alignment = FLabelAlignment.Center; subObjects.Add(infoLabel); difficultyLabel.label.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey); infoLabel.label.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey); }
public void Update(float dt, Menu world) { var t = System.DateTime.Now; BlackScreen.Update(dt, world); LoadingText.Update(dt, world); MapSeedField.Update(dt, world); MapSizeField.Update(dt, world); MessageCostField.Update(dt, world); MiningRateField.Update(dt, world); Planet.Update(dt, world); PlayButton.Update(dt, world); PlayerCountField.Update(dt, world); QuitButton.Update(dt, world); StartingResourcesField.Update(dt, world); TurnDurationField.Update(dt, world); WinConditionField.Update(dt, world); this.Rule0(dt, world); this.Rule1(dt, world); this.Rule2(dt, world); this.Rule3(dt, world); this.Rule4(dt, world); this.Rule5(dt, world); this.Rule6(dt, world); this.Rule7(dt, world); this.Rule8(dt, world); this.Rule9(dt, world); this.Rule10(dt, world); this.Rule11(dt, world); this.Rule12(dt, world); this.Rule13(dt, world); this.Rule14(dt, world); this.Rule15(dt, world); this.Rule16(dt, world); this.Rule17(dt, world); this.Rule18(dt, world); this.Rule19(dt, world); }
private static void Main(string[] args) { Menu menu = new Menu(); SubMenu file = new SubMenu("File"); file.AddItem("New"); file.AddItem("Save"); file.AddItem("Exit"); file.GetItem("Exit").Executed += (obj, e) => Environment.Exit(0); SubMenu edit = new SubMenu("Edit"); edit.AddItem("Cut"); edit.AddItem("Copy"); edit.AddItem("Paste"); SubMenu about = new SubMenu("About"); about.Executed += AboutHandler; menu.AddItem(file); menu.AddItem(edit); menu.AddItem(about); menu.Execute(); }
public patch_MenuScene(Menu.Menu menu, MenuObject owner, Menu.MenuScene.SceneID sceneID) : base(menu, owner, sceneID) { }
public DisplayElement(Menu.Menu menu, MenuObject owner) : base(menu, owner, Vector2.zero, Vector2.one * 100) { }
public void Rule9(float dt, Menu world){ switch (s9) { case -1: if(!(BackButton.IsPressed)) { s9 = -1; return; }else { goto case 2; } case 2: if(((CurrentScreenNumber) == (0))) { goto case 0; }else { goto case 1; } case 0: UnityEngine.Debug.Log("Quit"); CurrentScreenNumber = -1; BackButton.IsPressed = false; s9 = -1; return; case 1: ___previous90 = ((CurrentScreenNumber) - (1)); UnityEngine.Debug.Log(("Going to previous scene") + (___previous90)); CurrentScreenNumber = ___previous90; BackButton.IsPressed = false; s9 = -1; return; default: return;}}
public void Update(float dt, Menu world) { frame = Menu.frame; }
public MouseDragger(Menu.Menu menu, MenuObject owner) : base(menu, owner) { }
public void Rule13(float dt, Menu world){ switch (s13) { case -1: MapSizeField.MaxValue = 1000; MapSizeField.MinValue = 2; s13 = 0; return; case 0: if(!(false)) { s13 = 0; return; }else { s13 = -1; return; } default: return;}}
public void Rule19(float dt, Menu world){ switch (s19) { case -1: StartingResourcesField.MaxValue = 9000; StartingResourcesField.MinValue = 0; s19 = 0; return; case 0: if(!(false)) { s19 = 0; return; }else { s19 = -1; return; } default: return;}}
public extern void orig_ctor(Menu.Menu menu, MenuObject owner);
public void Rule17(float dt, Menu world){ switch (s17) { case -1: PlayerCountField.MaxValue = 100; PlayerCountField.MinValue = 2; s17 = 0; return; case 0: if(!(false)) { s17 = 0; return; }else { s17 = -1; return; } default: return;}}
public void Rule18(float dt, Menu world){ switch (s18) { case -1: TurnDurationField.MaxValue = 600; TurnDurationField.MinValue = 30; s18 = 0; return; case 0: if(!(false)) { s18 = 0; return; }else { s18 = -1; return; } default: return;}}
public void Rule16(float dt, Menu world){ switch (s16) { case -1: WinConditionField.MaxValue = 9000; WinConditionField.MinValue = 100; s16 = 0; return; case 0: if(!(false)) { s16 = 0; return; }else { s16 = -1; return; } default: return;}}
public void Rule15(float dt, Menu world){ switch (s15) { case -1: MessageCostField.MaxValue = 5000; MessageCostField.MinValue = 0; s15 = 0; return; case 0: if(!(false)) { s15 = 0; return; }else { s15 = -1; return; } default: return;}}
public void Rule14(float dt, Menu world){ switch (s14) { case -1: MiningRateField.MaxValue = 5000; MiningRateField.MinValue = 1; s14 = 0; return; case 0: if(!(false)) { s14 = 0; return; }else { s14 = -1; return; } default: return;}}
public patch_SlugcatPageContinue(Menu.Menu menu, MenuObject owner, int pageIndex, int slugcatNumber) : base(menu, owner, pageIndex, slugcatNumber) { }
public void Update(float dt, Menu world) { frame = Menu.frame; this.Rule1(dt, world); this.Rule0(dt, world); }
public void ctor(Menu.Menu menu, MenuObject owner, int pageIndex, int slugcatNumber) { orig_ctor(menu, owner, pageIndex, slugcatNumber); hud.ClearAllSprites(); hudContainers = new FContainer[2]; for (int i = 0; i < hudContainers.Length; i++) { hudContainers[i] = new FContainer(); Container.AddChild(hudContainers[i]); } hud = new HUD.HUD(hudContainers, menu.manager.rainWorld, this); saveGameData.karma = Custom.IntClamp(saveGameData.karma, 0, saveGameData.karmaCap); saveGameData.food = Custom.IntClamp(saveGameData.food, 0, SlugcatStats.SlugcatFoodMeter(slugcatNumber).y); hud.AddPart(new KarmaMeter(hud, hudContainers[1], new IntVector2(saveGameData.karma, saveGameData.karmaCap), saveGameData.karmaReinforced)); hud.AddPart(new FoodMeter(hud, SlugcatStats.SlugcatFoodMeter(slugcatNumber).x, SlugcatStats.SlugcatFoodMeter(slugcatNumber).y)); string text = String.Empty; if (saveGameData.shelterName != null && saveGameData.shelterName.Length > 2) { string text2 = saveGameData.shelterName.Substring(0, 2); switch (text2) { case "CC": text = "Chimney Canopy"; break; case "DS": text = "Drainage System"; break; case "HI": text = "Industrial Complex"; break; case "GW": text = "Garbage Wastes"; break; case "SI": text = "Sky Islands"; break; case "SU": text = "Outskirts"; break; case "SH": text = "Shaded Citadel"; break; case "IS": text = "Intake System"; break; case "SL": text = "Shoreline"; break; case "LF": text = "Farm Arrays"; break; case "UW": text = "The Exterior"; break; case "SB": text = "Subterranean"; break; case "SS": text = "Five Pebbles"; break; case "LM": text = "Looks To the Moon"; break; case "MW": text = "The Fragmented Exterior"; break; case "FS": text = "Forest Sanctuary"; break; } if (text.Length > 0) { text2 = text; text = string.Concat(new object[] { text2, " - ", menu.Translate("Cycle"), " ", (slugcatNumber != 2) ? saveGameData.cycle : (RedsIllness.RedsCycles(saveGameData.redsExtraCycles) - saveGameData.cycle) }); } } regionLabel = new MenuLabel(menu, this, text, new Vector2(-1000f, imagePos.y - 249f), new Vector2(200f, 30f), true); regionLabel.label.alignment = FLabelAlignment.Center; subObjects.Add(regionLabel); }
public void Rule11(float dt, Menu world){ switch (s11) { case -1: StartingResourcesField.Text = GameUtils.IntToString(500); s11 = 0; return; case 0: if(!(false)) { s11 = 0; return; }else { s11 = -1; return; } default: return;}}
public MultiplayerPlayerList(Menu.Menu menu, MenuObject owner, Vector2 pos, Vector2 size, Vector2 displayElementSize, float displayElementFade = 10) : base(menu, owner, pos, size, displayElementSize, displayElementFade) { }
public void Rule1(float dt, Menu world) { Rotation = (UnityEngine.Quaternion.Euler((RotationVelocity) * (dt))) * (Rotation); }
public SlugButton(Menu.Menu menu, MenuObject owner) : base(menu, owner, new Vector2(300f, 300f), 50f) { //this.behavior = this.oracle.oracleBehavior; //this.graphics = this.oracle.graphicsModule as MaxGraphics; }
public void Rule0(float dt, Menu world){ switch (s0) { case -1: OwnerColor = new UnityEngine.Color(0,0,0,0); TargetingPlayerColor = new UnityEngine.Color(0,0,0,0); s0 = 0; return; case 0: if(!(false)) { s0 = 0; return; }else { s0 = -1; return; } default: return;}}
public void Rule8(float dt, Menu world){ switch (s8) { case -1: MapSelecter = MapSelecter; s8 = -1; return; default: return;}}
/// <summary> /// Retrieves the region name to show it in the slugcat select menu /// </summary> private static void SlugcatPageContinue_ctor(On.Menu.SlugcatSelectMenu.SlugcatPageContinue.orig_ctor orig, Menu.SlugcatSelectMenu.SlugcatPageContinue self, Menu.Menu menu, Menu.MenuObject owner, int pageIndex, int slugcatNumber) { orig(self, menu, owner, pageIndex, slugcatNumber); if (self.saveGameData.shelterName != null && self.saveGameData.shelterName.Length > 2) { string regID = self.saveGameData.shelterName.Substring(0, 2); bool customRegion = true; List <string> vanillaRegions = CustomWorldMod.VanillaRegions().ToList(); for (int i = 0; i < vanillaRegions.Count; i++) { if (regID == vanillaRegions[i]) { customRegion = false; } } if (customRegion) { foreach (MenuObject label in self.subObjects) { if (label is MenuLabel && label == self.regionLabel && (label as MenuLabel).text.Length < 3) { string fullRegionName = "N / A"; //CustomWorldMod.activatedPacks.TryGetValue(text2, out fullRegionName); if (CustomWorldMod.activeModdedRegions.Contains(regID)) { foreach (KeyValuePair <string, string> entry in CustomWorldMod.activatedPacks) { if (CustomWorldMod.installedPacks[entry.Key].regions.Contains(regID)) { string regionName = CWorld.RegionHook.GetSubRegionName(entry.Value, regID); if (CustomWorldMod.installedPacks[entry.Key].useRegionName && regionName != null) { fullRegionName = regionName; CustomWorldMod.Log($"Displaying region name: [{fullRegionName}]. If your pack" + $"contains multiple regions, add \"useRegionName\" to the packInfo.json to use" + $"the Subregion field from the Properties.txt file"); } else { fullRegionName = entry.Key; CustomWorldMod.Log($"Displaying pack name: [{fullRegionName}]."); //[OUTDATED] If you pack contains multiple regions, contact @Garrakx."); } break; } } } if (fullRegionName != null) { if (fullRegionName.Length > 0) { regID = fullRegionName; fullRegionName = string.Concat(new object[] { regID, " - ", menu.Translate("Cycle"), " ", (slugcatNumber != 2) ? self.saveGameData.cycle : (RedsIllness.RedsCycles(self.saveGameData.redsExtraCycles) - self.saveGameData.cycle) }); } (label as MenuLabel).text = fullRegionName; break; } } } } } }
public void Rule10(float dt, Menu world){ switch (s10) { case -1: if(!(StartButton.IsPressed)) { s10 = -1; return; }else { goto case 2; } case 2: ___next100 = ((CurrentScreenNumber) + (1)); UnityEngine.Debug.Log(("Going to next scene: ") + (___next100)); CurrentScreenNumber = ___next100; StartButton.IsPressed = false; s10 = -1; return; default: return;}}
public void Update(float dt, Menu world) { var t = System.DateTime.Now; this.Rule0(dt, world); this.Rule1(dt, world); this.Rule2(dt, world); this.Rule3(dt, world); this.Rule4(dt, world); this.Rule5(dt, world); this.Rule6(dt, world); this.Rule7(dt, world); this.Rule8(dt, world); this.Rule9(dt, world); this.Rule10(dt, world); }
public void ctor(Menu.Menu menu, MenuObject owner, SandboxOverlayOwner overlayOwner) { //Delegate to call the base constructor Type[] constructorSignature = new Type[4]; constructorSignature[0] = typeof(Menu.Menu); constructorSignature[1] = typeof(MenuObject); constructorSignature[2] = typeof(Vector2); constructorSignature[3] = typeof(Vector2); RuntimeMethodHandle handle = typeof(RectangularMenuObject).GetConstructor(constructorSignature).MethodHandle; RuntimeHelpers.PrepareMethod(handle); IntPtr ptr = handle.GetFunctionPointer(); Action <Menu.Menu, MenuObject, Vector2, Vector2> funct = (Action <Menu.Menu, MenuObject, Vector2, Vector2>)Activator.CreateInstance(typeof(Action <Menu.Menu, MenuObject, Vector2, Vector2>), this, ptr); funct(menu, owner, new Vector2(-1000f, -1000f), new Vector2((float)SandboxEditorSelector.Width, (float)SandboxEditorSelector.Height) * SandboxEditorSelector.ButtonSize);//RectangularMenuObject Constructor this.lastPos = new Vector2(-1000f, -1000f); this.overlayOwner = overlayOwner; overlayOwner.selector = this; this.bkgRect = new RoundedRect(menu, this, new Vector2(-10f, -30f), this.size + new Vector2(20f, 60f), true); this.subObjects.Add(this.bkgRect); this.infoLabel = new MenuLabel(menu, this, string.Empty, new Vector2(this.size.x / 2f - 100f, 0f), new Vector2(200f, 20f), false); this.subObjects.Add(this.infoLabel); this.buttons = new SandboxEditorSelector.Button[SandboxEditorSelector.Width, SandboxEditorSelector.Height]; int num = 0; this.AddButton(new SandboxEditorSelector.RectButton(menu, this, SandboxEditorSelector.ActionButton.Action.ClearAll), ref num); for (int i = 0; i < 2; i++) { this.AddButton(null, ref num); } //Replaced Section foreach (MultiplayerUnlocks.SandboxUnlockID item in patch_MultiplayerUnlocks.ItemUnlockList) { if (this.unlocks.SandboxItemUnlocked(item)) { this.AddButton(new SandboxEditorSelector.CreatureOrItemButton(menu, this, MultiplayerUnlocks.SymbolDataForSandboxUnlock(item)), ref num); } else { this.AddButton(new SandboxEditorSelector.LockedButton(menu, this), ref num); } } foreach (MultiplayerUnlocks.SandboxUnlockID creature in patch_MultiplayerUnlocks.CreatureUnlockList) { if (this.unlocks.SandboxItemUnlocked(creature)) { this.AddButton(new SandboxEditorSelector.CreatureOrItemButton(menu, this, MultiplayerUnlocks.SymbolDataForSandboxUnlock(creature)), ref num); } else { this.AddButton(new SandboxEditorSelector.LockedButton(menu, this), ref num); } } //-=-=-=-=-=-=-=-=-=-=- this.AddButton(new SandboxEditorSelector.RectButton(menu, this, SandboxEditorSelector.ActionButton.Action.Play), SandboxEditorSelector.Width - 1, 0); this.AddButton(new SandboxEditorSelector.RandomizeButton(menu, this), SandboxEditorSelector.Width - 6, 0); this.AddButton(new SandboxEditorSelector.ConfigButton(menu, this, SandboxEditorSelector.ActionButton.Action.ConfigA, 0), SandboxEditorSelector.Width - 5, 0); this.AddButton(new SandboxEditorSelector.ConfigButton(menu, this, SandboxEditorSelector.ActionButton.Action.ConfigB, 1), SandboxEditorSelector.Width - 4, 0); this.AddButton(new SandboxEditorSelector.ConfigButton(menu, this, SandboxEditorSelector.ActionButton.Action.ConfigC, 2), SandboxEditorSelector.Width - 3, 0); for (int l = 0; l < SandboxEditorSelector.Width; l++) { for (int m = 0; m < SandboxEditorSelector.Height; m++) { if (this.buttons[l, m] != null) { this.buttons[l, m].Initiate(new IntVector2(l, m)); } } } this.cursors = new List <SandboxEditorSelector.ButtonCursor>(); }
public void Rule0(float dt, Menu world){ switch (s0) { case -1: if(((CurrentScreenNumber) == (1))) { goto case 0; }else { goto case 1; } case 0: ___LessB00 = new ButtonGUI("Canvas/LessP"); UnityEngine.Debug.Log("LessButton Created"); LessButton = (new Just<ButtonGUI>(___LessB00)); s0 = 3; return; case 3: if(!(false)) { s0 = 3; return; }else { s0 = -1; return; } case 1: UnityEngine.Debug.Log("LessButton Destroyed"); LessButton = (new Nothing<ButtonGUI>()); s0 = -1; return; default: return;}}
public extern void orig_ctor(Menu.Menu menu, MenuObject owner, SandboxOverlayOwner overlayOwner);
public void Rule1(float dt, Menu world){ switch (s1) { case -1: if(((CurrentScreenNumber) == (1))) { goto case 9; }else { goto case 10; } case 9: ___PlusB10 = new ButtonGUI("Canvas/MoreP"); UnityEngine.Debug.Log("PlusButton Created"); PlusButton = (new Just<ButtonGUI>(___PlusB10)); s1 = 12; return; case 12: if(!(false)) { s1 = 12; return; }else { s1 = -1; return; } case 10: UnityEngine.Debug.Log("PlusButton Destroyed"); PlusButton = (new Nothing<ButtonGUI>()); s1 = -1; return; default: return;}}
public patch_SandboxEditorSelector(Menu.Menu menu, MenuObject owner, SandboxOverlayOwner overlayOwner) : base(menu, owner, overlayOwner) { }
public void Rule2(float dt, Menu world){ switch (s2) { case -1: if(((CurrentScreenNumber) == (1))) { goto case 18; }else { goto case 19; } case 18: ___NextM20 = new ButtonGUI("Canvas/NextM"); UnityEngine.Debug.Log("NextMButton Created"); NextMButton = (new Just<ButtonGUI>(___NextM20)); s2 = 21; return; case 21: if(!(false)) { s2 = 21; return; }else { s2 = -1; return; } case 19: UnityEngine.Debug.Log("NextMButton Destroyed"); NextMButton = (new Nothing<ButtonGUI>()); s2 = -1; return; default: return;}}
public extern void orig_ctor(Menu.Menu menu, MenuObject owner, int pageIndex, int slugcatNumber);
public patch_EndgameTokens(Menu.Menu menu, MenuObject owner, Vector2 pos, FContainer container, KarmaLadder ladder) : base(menu, owner, pos, container, ladder) { }
public patch_SandboxSettingsInterface(Menu.Menu menu, MenuObject owner) : base(menu, owner) { }
public void ctor_EndgameTokens(Menu.Menu menu, MenuObject owner, Vector2 pos, FContainer container, KarmaLadder ladder) { //Created Delegate to call Menu.PositionedMenuObject constructor Type[] constructorSignature = new Type[3]; constructorSignature[0] = typeof(Menu.Menu); constructorSignature[1] = typeof(Menu.MenuObject); constructorSignature[2] = typeof(Vector2); RuntimeMethodHandle handle = typeof(Menu.PositionedMenuObject).GetConstructor(constructorSignature).MethodHandle; RuntimeHelpers.PrepareMethod(handle); IntPtr ptr = handle.GetFunctionPointer(); Action <Menu.Menu, Menu.MenuObject, Vector2> funct = (Action <Menu.Menu, Menu.MenuObject, Vector2>)Activator.CreateInstance(typeof(Action <Menu.Menu, Menu.MenuObject, Vector2>), this, ptr); funct(menu, owner, pos);//Menu.PositionedMenuObject constructor //Original Code: this.tokens = new List <EndgameTokens.Token>(); bool flag = false; this.addPassageButtonWhenTokenBecomesVisible = false; int num = 0; for (int i = 0; i < ladder.endGameMeters.Count; i++) { if (ladder.endGameMeters[i].fullfilledNow) { this.addPassageButtonWhenTokenBecomesVisible = true; } if (ladder.endGameMeters[i].tracker.GoalFullfilled && !ladder.endGameMeters[i].tracker.consumed) { if (ladder.endGameMeters[i].tracker.GoalAlreadyFullfilled && !flag) { flag = true; } this.tokens.Add(new EndgameTokens.Token(menu, this, default(Vector2), ladder.endGameMeters[i], container, num)); this.subObjects.Add(this.tokens[this.tokens.Count - 1]); num++; } if (ladder.endGameMeters[i].fullfilledNow) { this.forceShowTokenAdd = true; } } // New Code: if (menu is SleepAndDeathScreen) //To avoid calling menu as SleepAndDeathScreen when menu is MultiplayerSleepAndDeathScreen { if ((menu as SleepAndDeathScreen).winState != null) { for (int j = 0; j < (menu as SleepAndDeathScreen).winState.endgameTrackers.Count; j++) { if (!(menu as SleepAndDeathScreen).winState.endgameTrackers[j].GoalAlreadyFullfilled && (menu as SleepAndDeathScreen).winState.endgameTrackers[j].GoalFullfilled) { this.pingAchivements = true; break; } } } if (flag) { (menu as SleepAndDeathScreen).AddPassageButton(false); this.addPassageButtonWhenTokenBecomesVisible = false; } } else { if ((menu as MultiplayerSleepAndDeathScreen).winState != null) { for (int j = 0; j < (menu as MultiplayerSleepAndDeathScreen).winState.endgameTrackers.Count; j++) { if (!(menu as MultiplayerSleepAndDeathScreen).winState.endgameTrackers[j].GoalAlreadyFullfilled && (menu as MultiplayerSleepAndDeathScreen).winState.endgameTrackers[j].GoalFullfilled) { this.pingAchivements = true; break; } } } } }
public void ctor(Menu.Menu menu, MenuObject owner) { //Delegate to call the base constructor Type[] constructorSignature = new Type[3]; constructorSignature[0] = typeof(Menu.Menu); constructorSignature[1] = typeof(MenuObject); constructorSignature[2] = typeof(Vector2); RuntimeMethodHandle handle = typeof(Menu.PositionedMenuObject).GetConstructor(constructorSignature).MethodHandle; RuntimeHelpers.PrepareMethod(handle); IntPtr ptr = handle.GetFunctionPointer(); Action <Menu.Menu, MenuObject, Vector2> funct = (Action <Menu.Menu, MenuObject, Vector2>)Activator.CreateInstance(typeof(Action <Menu.Menu, MenuObject, Vector2>), this, ptr); funct(menu, owner, new Vector2(440f, 385f));//RectangularMenuObject Constructor this.scoreControllers = new List <SandboxSettingsInterface.ScoreController>(); IntVector2 intVector = new IntVector2(0, 0); //Replaced Code foreach (patch_MultiplayerUnlocks.SandboxUnlockID creature in patch_MultiplayerUnlocks.CreatureUnlockList) { if (creature != patch_MultiplayerUnlocks.SandboxUnlockID.Fly && creature != patch_MultiplayerUnlocks.SandboxUnlockID.Leech && creature != patch_MultiplayerUnlocks.SandboxUnlockID.SeaLeech && creature != patch_MultiplayerUnlocks.SandboxUnlockID.SmallNeedleWorm && creature != patch_MultiplayerUnlocks.SandboxUnlockID.Spider && creature != patch_MultiplayerUnlocks.SandboxUnlockID.VultureGrub && creature != patch_MultiplayerUnlocks.SandboxUnlockID.BigEel && creature != patch_MultiplayerUnlocks.SandboxUnlockID.Deer && creature != patch_MultiplayerUnlocks.SandboxUnlockID.WalkerBeast && creature != patch_MultiplayerUnlocks.SandboxUnlockID.SmallCentipede && creature != patch_MultiplayerUnlocks.SandboxUnlockID.TubeWorm && creature != patch_MultiplayerUnlocks.SandboxUnlockID.Hazer) { this.AddScoreButton((MultiplayerUnlocks.SandboxUnlockID)creature, ref intVector); } } //-=-=-=-=-=-=-=-=-=-=- //for (int j = 0; j < 1; j++) //{ // this.AddScoreButton(null, ref intVector); //} this.AddScoreButton(new SandboxSettingsInterface.MiscScore(menu, this, menu.Translate("Food"), "FOODSCORE"), ref intVector); this.AddScoreButton(new SandboxSettingsInterface.MiscScore(menu, this, menu.Translate("Survive"), "SURVIVESCORE"), ref intVector); this.AddScoreButton(new SandboxSettingsInterface.MiscScore(menu, this, menu.Translate("Spear hit"), "SPEARHITSCORE"), ref intVector); if (menu.CurrLang != InGameTranslator.LanguageID.English) { for (int k = 1; k < 4; k++) { SandboxSettingsInterface.ScoreController scoreController = this.scoreControllers[this.scoreControllers.Count - k]; scoreController.pos.x = scoreController.pos.x + 24f; } } this.subObjects.Add(new SymbolButton(menu, this, "Menu_Symbol_Clear_All", "CLEARSCORES", new Vector2(0f, -280f))); for (int l = 0; l < this.subObjects.Count; l++) { if (this.subObjects[l] is SandboxSettingsInterface.ScoreController) { (this.subObjects[l] as SandboxSettingsInterface.ScoreController).scoreDragger.UpdateScoreText(); } } }
public extern void OriginalConstructor(Menu.Menu menu, MenuObject owner, string text, Vector2 pos, Vector2 size, Slider.SliderID ID, bool subtleSlider);
public patch_MenuDepthIllustration(Menu.Menu menu, MenuObject owner, string folderName, string fileName, Vector2 pos, float depth, MenuShader shader) : base(menu, owner, folderName, fileName, pos, depth, shader) { }
public void Rule10(float dt, Menu world){ switch (s10) { case -1: TurnDurationField.Text = GameUtils.IntToString(120); s10 = 0; return; case 0: if(!(false)) { s10 = 0; return; }else { s10 = -1; return; } default: return;}}
static void Main(string[] args) { Boolean decision = true; String userInput; Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("Library System - Samantha West"); // Declare list of objects type library and book to store incoming csv data List <Book.Book> books = new List <Book.Book>(); List <Library.Library> libraries = new List <Library.Library>(); // Declare csv reader object to read and set library and book objects Utils.LibraryReader file_libraries = new Utils.LibraryReader("Libraries.txt"); Utils.BookReader file_books = new Utils.BookReader("LibraryBooks.txt"); // Read data from csv files file_libraries.ReadFile(libraries); file_books.ReadFile(books); // Add books to their corresponding libraries foreach (Library.Library library in libraries) { foreach (Book.Book book in books) { // Add book to library if matches library id & assign library to book if (book.LibraryId == library.LibraryId) { library.AddBook(book); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("SUCCESS: Book loaded into library."); } } } // Init Menu Menu.Menu menu = new Menu.Menu(); // From local file while (decision) { userInput = menu.MenuPrompt(); switch (userInput) { // List Books case "0": menu.PrintLibraries(libraries); break; // Add Book case "1": try { menu.AddBook(libraries, books); } catch (CustomErrors.BookNotFoundException e) { Console.WriteLine(e.Message); } break; // Update Book case "2": try { menu.UpdateBook(libraries, books); } catch (CustomErrors.BookNotFoundException e) { Console.WriteLine(e.Message); } break; // Remove Book case "3": try { menu.RemoveBook(libraries, books); } catch (CustomErrors.BookNotFoundException e) { Console.WriteLine(e.Message); } break; // Exit Program case "4": // Break Loop & Exit Program decision = menu.ExitMenu(file_libraries, file_books, books, libraries); break; // Default selection default: menu.DefaultSelectionMessage(); break; } } }
public void Rule9(float dt, Menu world){ switch (s9) { case -1: PlayerCountField.Text = GameUtils.IntToString(4); s9 = 0; return; case 0: if(!(false)) { s9 = 0; return; }else { s9 = -1; return; } default: return;}}
public void Rule3(float dt, Menu world){ switch (s3) { case -1: if(((CurrentScreenNumber) == (1))) { goto case 27; }else { goto case 28; } case 27: ___PreviousM30 = new ButtonGUI("Canvas/PreviousM"); UnityEngine.Debug.Log("PreviousM Created"); PreviousMButton = (new Just<ButtonGUI>(___PreviousM30)); s3 = 30; return; case 30: if(!(false)) { s3 = 30; return; }else { s3 = -1; return; } case 28: UnityEngine.Debug.Log("PreviousM Destroyed"); PreviousMButton = (new Nothing<ButtonGUI>()); s3 = -1; return; default: return;}}
public void Rule12(float dt, Menu world){ switch (s12) { case -1: MapSeedField.MaxValue = 100000; MapSeedField.MinValue = 0; s12 = 0; return; case 0: if(!(false)) { s12 = 0; return; }else { s12 = -1; return; } default: return;}}
public extern void OriginalConstructor(Menu.Menu menu, MenuObject owner, Vector2 pos, FContainer container, KarmaLadder ladder);
public void Rule4(float dt, Menu world){ switch (s4) { case -1: if(!(((LessButton.IsSome) && (PlusButton.IsSome)))) { s4 = -1; return; }else { goto case 14; } case 14: if(!(((LessButton.Value.IsPressed) || (PlusButton.Value.IsPressed)))) { s4 = 14; return; }else { goto case 13; } case 13: ___Minus40 = ((AmountOfPlayers) - (1)); ___Plus40 = ((AmountOfPlayers) + (1)); if(PlusButton.Value.IsPressed) { goto case 7; }else { goto case 0; } case 7: if(((4) > (AmountOfPlayers))) { goto case 9; }else { s4 = 0; return; } case 9: UnityEngine.Debug.Log(("Players become ") + (___Plus40)); AmountOfPlayers = ___Plus40; LessButton.Value.IsPressed = false; PlusButton.Value.IsPressed = false; s4 = 0; return; case 0: if(LessButton.Value.IsPressed) { goto case 1; }else { s4 = -1; return; } case 1: if(((AmountOfPlayers) > (1))) { goto case 3; }else { s4 = -1; return; } case 3: UnityEngine.Debug.Log(("Players become ") + (___Minus40)); AmountOfPlayers = ___Minus40; LessButton.Value.IsPressed = false; PlusButton.Value.IsPressed = false; s4 = -1; return; default: return;}}
public patch_Slider(Menu.Menu menu, MenuObject owner, string text, Vector2 pos, Vector2 size, Slider.SliderID ID, bool subtleSlider) : base(menu, owner, text, pos, size, ID, subtleSlider) { }
public void Rule5(float dt, Menu world){ switch (s5) { case -1: PlayerAmount = PlayerAmount; s5 = -1; return; default: return;}}
public void ctor_MainMenu(Menu.Menu menu, MenuObject owner, string text, Vector2 pos, Vector2 size, Slider.SliderID ID, bool subtleSlider) { OriginalConstructor(menu, owner, text, pos, size, ID, subtleSlider); }
public void Rule6(float dt, Menu world){ switch (s6) { case -1: if(!(((PreviousMButton.IsSome) && (NextMButton.IsSome)))) { s6 = -1; return; }else { goto case 11; } case 11: if(!(((PreviousMButton.Value.IsPressed) || (NextMButton.Value.IsPressed)))) { s6 = 11; return; }else { goto case 10; } case 10: UnityEngine.Debug.Log(MapSelectNumber); if(PreviousMButton.Value.IsPressed) { goto case 4; }else { goto case 0; } case 4: if(((MapSelectNumber) == (1))) { goto case 5; }else { goto case 6; } case 5: MapSelectNumber = MapSelectNumber; PreviousMButton.Value.IsPressed = false; NextMButton.Value.IsPressed = false; s6 = 0; return; case 6: MapSelectNumber = ((MapSelectNumber) - (1)); PreviousMButton.Value.IsPressed = false; NextMButton.Value.IsPressed = false; s6 = 0; return; case 0: if(NextMButton.Value.IsPressed) { goto case 1; }else { s6 = -1; return; } case 1: MapSelectNumber = ((MapSelectNumber) + (1)); PreviousMButton.Value.IsPressed = false; NextMButton.Value.IsPressed = false; s6 = -1; return; default: return;}}
public PlayerSelector(Menu.Menu menu, MenuObject owner, Vector2 pos) : base(menu, owner, pos, new Vector2(0f, 0f)) { buttons = new List <PlayerButton>(); // Non-SlugBase slugcats foreach (SlugcatStats.Name name in Enum.GetValues(typeof(SlugcatStats.Name))) { buttons.Add(new PlayerButton(this, new PlayerDescriptor((int)name), new Vector2())); } // SlugBase slugcats foreach (SlugBaseCharacter player in PlayerManager.customPlayers) { buttons.Add(new PlayerButton(this, new PlayerDescriptor(player), new Vector2())); } foreach (PlayerButton button in buttons) { subObjects.Add(button); } // Determine whether or not to have arrows float maxWidth; { float maxButtonWidth = 0f; for (int i = 0; i < buttons.Count; i++) { if (buttons[i].MaxWidth > maxButtonWidth) { maxButtonWidth = buttons[i].MaxWidth; } } maxWidth = maxButtonWidth + (height + spacing) * (buttons.Count - 1); } if (maxWidth > width + 2f) { hasArrows = true; } // Create the arrows if (hasArrows) { arrows = new ArrowButton[2]; arrows[0] = new ArrowButton(this, false, new Vector2(0f, 0f)); arrows[1] = new ArrowButton(this, true, new Vector2(width - arrowWidth, 0f)); foreach (ArrowButton arrow in arrows) { subObjects.Add(arrow); } viewWidth = width - (arrowWidth + spacing) * 2f; } else { arrows = new ArrowButton[0]; viewWidth = width; } // Create pages pages = GetPages(); for (int pg = 0; pg < pages.Length; pg++) { TogglePage(pg, false); } // Select one of the buttons to start with if (arenaCharacter.TryGet(menu.manager.arenaSetup, out var ply)) { // Load from a saved value for (int i = 0; i < buttons.Count; i++) { if (buttons[i].player.Equals(ply)) { for (int pg = pages.Length - 1; pg >= 0; pg--) { if (pg == 0 || (pages[pg].x <= i && pages[pg].y > i)) { TogglePage(pg, true); } } buttons[i].SetSelected(true); break; } } } else { // Default to the Survivor arenaCharacter[menu.manager.arenaSetup] = new PlayerDescriptor(0); buttons[0].SetSelected(true); TogglePage(0, true); } }
public void Rule7(float dt, Menu world){ switch (s7) { case -1: UnityEngine.Debug.Log(MapName); MapName = MapName; s7 = -1; return; default: return;}}