public static void Init() { Menu.ClearComponents(); Menu = new FrameworkMenu(new Point(200, 140)); AddToMenu(ContractBg); AddToMenu(FavorStar); AddToMenu(HeaderText); AddToMenu(FavorText); AddToMenu(SeasonalContracts, 2); AddToMenu(YearlyContracts, 2); AddToMenu(Reputation); AddToMenu(RepAmount, 2); AddToMenu(RankDisplay); AddToMenu(FavorAmount); AddToMenu(ContractButton); AddToMenu(ShopButton); AddToMenu(HelpButton); //TODO yearly contracts AddToMenu(new TextComponent(new Point(35, 80), "W.I.P.", true, 4F), 3); if (AssociationHandler.Main == null) { return; } int i = 0; foreach (var contract in AssociationHandler.Main.ActiveContracts) { foreach (var component in CreateContractBlob(i, contract)) { AddToMenu(component, 3); } i++; } }
public static void Init() { for (int i = 0; i < 8; i++) { if (i <= 3) { Bg[i] = new ClickableTextureComponent(new Rectangle(44 * i, 30, 48, 48), Game1.content.Load <Texture2D>("LooseSprites//DialogBoxGreen"), OnContractButton); var temp = new TextureComponent(new Rectangle(44 * i + 8, 30 + 8, 32, 32), Game1.content.Load <Texture2D>("LooseSprites//Cursors").getArea(new Rectangle(268, 470, 16, 16))); temp.Layer = 3; Crosses[i] = temp; } else { Bg[i] = new ClickableTextureComponent(new Rectangle(44 * (i - 4), 75, 48, 48), Game1.content.Load <Texture2D>("LooseSprites//DialogBoxGreen"), OnContractButton); var temp = new TextureComponent(new Rectangle(44 * (i - 4) + 8, 75 + 8, 32, 32), Game1.content.Load <Texture2D>("LooseSprites//Cursors").getArea(new Rectangle(268, 470, 16, 16))); temp.Layer = 3; Crosses[i] = temp; } } if (Menu != null) { Menu.ClearComponents(); } Menu = new FrameworkMenu(new Point(200, 140), false); foreach (var bg in Bg) { Menu.AddComponent(bg); } Menu.AddComponent(HeaderText); Menu.AddComponent(DescText1); Menu.AddComponent(DescText2); Menu.AddComponent(DescText3); Menu.AddComponent(DescText4); Menu.AddComponent(BackButton); }