public SeedWindow(Node parentNode, FarmColunm farmColunm) : base(parentNode) { foreach (var seed in GameData.GameStatus.Plants) { if (GameData.PlayerData.Seed.Length > seed.id) { SeedButton seedButton = new SeedButton(Texture.SeedButton, Texture.SeedButtonPush, seed.name, GameData.PlayerData.Seed[seed.id], seed.id); seedButtons.Add(seedButton); } } _farmColunm = farmColunm; }
public FarmPanel() { _isLevelup = false; page = 0; int showColumn = GameData.PlayerData.farms.Count; if (showColumn > Common.Parameter.FarmPageMaxColumn) { showColumn = Common.Parameter.FarmPageMaxColumn; } for (int index = 0; index < showColumn; index++) { FarmColunm farmColunm = new FarmColunm(); farmColunm.Icon.SetPosition(new Vector2F(iconXIndex, iconYIndex + columnInterval * index)); farmColunm.Window.SetPosition(new Vector2F(windowXIndex, windowYIndex + columnInterval * index)); farmColunm.CareButton.SetPosition(new Vector2F(careButtonXIndex, careButtonYIndex + columnInterval * index)); farmColunm.CareButton.SetScale(careButtonScale); farmColunm.CareButton.SetZOrder(Common.Parameter.ZOrder.Farm); farmColunm.WaterButton.SetPosition(new Vector2F(waterButtonXIndex, waterButtonYIndex + columnInterval * index)); farmColunm.WaterButton.SetScale(careButtonScale); farmColunm.WaterButton.SetZOrder(Common.Parameter.ZOrder.Farm); farmColunm.SetFarmData(GameData.PlayerData.farms[index]); farmColunms.Add(farmColunm); } _allCareButton = new Button(Texture.AllCareButton, Texture.AllCareButtonHover, Texture.AllCareButtonClick); _allCareButton.SetPosition(new Vector2F(careButtonXIndex, careButtonYIndex + columnInterval * -1)); _allCareButton.SetScale(careButtonScale); _allCareButton.SetZOrder(Common.Parameter.ZOrder.Farm); _allWaterButton = new Button(Texture.AllWaterButton, Texture.AllWaterButtonHover, Texture.AllWaterButtonClick); _allWaterButton.SetPosition(new Vector2F(waterButtonXIndex, waterButtonYIndex + columnInterval * -1)); _allWaterButton.SetScale(careButtonScale); _allWaterButton.SetZOrder(Common.Parameter.ZOrder.Farm); _prevPageButton = new Button(Texture.PrevPageButton, Texture.PrevPageButtonHover, Texture.PrevPageButtonClick); _prevPageButton.SetPosition(new Vector2F(careButtonXIndex, waterButtonYIndex + columnInterval * Common.Parameter.FarmPageMaxColumn + 1)); _prevPageButton.SetScale(careButtonScale); _prevPageButton.SetZOrder(Common.Parameter.ZOrder.Farm); _nextPageButton = new Button(Texture.NextPageButton, Texture.NextPageButtonHover, Texture.NextPageButtonClick); _nextPageButton.SetPosition(new Vector2F(waterButtonXIndex, careButtonYIndex + columnInterval * Common.Parameter.FarmPageMaxColumn + 1)); _nextPageButton.SetScale(careButtonScale); _nextPageButton.SetZOrder(Common.Parameter.ZOrder.Farm); }