public WaitMenu(StaticContext root, WaitAround mod) { this.Root = root; this.Mod = mod; this.Buttons = new List <MenuButton>(); Texture2D upArrowTex = getTextureFromTileSheet(this.Root.MouseCursors, 12, 64, 64); Texture2D downArrowTex = getTextureFromTileSheet(this.Root.MouseCursors, 11, 64, 64); Texture2D okButtonTex = getTextureFromTileSheet(this.Root.MouseCursors, 46, 64, 64); Buttons.Add(new MenuButton(64, 64, 0, -1 * ((64 + 10 + 64 + 10 + 64) / 2), new Vector2(-0.25f, 0.5f), this.MenuRect, upArrowTex, upButton)); Buttons.Add(new MenuButton(64, 64, 0, (-1 * ((64 + 10 + 64 + 10 + 64) / 2)) + 64 + 10, new Vector2(-0.25f, 0.5f), this.MenuRect, downArrowTex, downButton)); Buttons.Add(new MenuButton(64, 64, 0, (-1 * ((64 + 10 + 64 + 10 + 64) / 2)) + 64 + 10 + 64 + 10, new Vector2(-0.25f, 0.5f), this.MenuRect, okButtonTex, enterButton)); }
public Config(WaitAround mod) { var configLocation = Path.Combine(mod.PathOnDisk, "Config.json"); if (!File.Exists(configLocation)) { Console.WriteLine("The config file for WaitAround was not found, attempting creation..."); this.menuKey = "K"; File.WriteAllBytes(configLocation, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this))); } else { Dictionary <string, string> c = JsonConvert.DeserializeObject <Dictionary <string, string> >(Encoding.UTF8.GetString(File.ReadAllBytes(configLocation))); this.menuKey = c["menuKey"]; } Console.WriteLine("The config file for WaitAround has been loaded.\n\tmenuKey: {0}", this.menuKey); }
private void enterButton(MenuButton menuButton) { Root.TimeOfDay = WaitAround.getTimeFromOffset(Root.TimeOfDay, Mod.timeToWait); Mod.timeToWait = 0; this.Close(); }