public UICharacterListItem(PlayerFileData data) { BorderColor = new Color(89, 116, 213) * 0.7f; _dividerTexture = TextureManager.Load("Images/UI/Divider"); _innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); _buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); _buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); _buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); _buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); _buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); _buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); Height.Set(96f, 0.0f); Width.Set(0.0f, 1f); SetPadding(6f); playerFileData = data; _playerPanel = new UICharacter(data.Player); _playerPanel.Left.Set(4f, 0.0f); _playerPanel.OnDoubleClick += new UIElement.MouseEvent(PlayGame); OnDoubleClick += new UIElement.MouseEvent(PlayGame); Append(_playerPanel); UIImageButton uiImageButton1 = new UIImageButton(_buttonPlayTexture); uiImageButton1.VAlign = 1f; uiImageButton1.Left.Set(4f, 0.0f); uiImageButton1.OnClick += new UIElement.MouseEvent(PlayGame); uiImageButton1.OnMouseOver += new UIElement.MouseEvent(PlayMouseOver); uiImageButton1.OnMouseOut += new UIElement.MouseEvent(ButtonMouseOut); Append(uiImageButton1); UIImageButton uiImageButton2 = new UIImageButton(playerFileData.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture); uiImageButton2.VAlign = 1f; uiImageButton2.Left.Set(28f, 0.0f); uiImageButton2.OnClick += new UIElement.MouseEvent(FavoriteButtonClick); uiImageButton2.OnMouseOver += new UIElement.MouseEvent(FavoriteMouseOver); uiImageButton2.OnMouseOut += new UIElement.MouseEvent(ButtonMouseOut); uiImageButton2.SetVisibility(1f, playerFileData.IsFavorite ? 0.8f : 0.4f); Append(uiImageButton2); UIImageButton uiImageButton4 = new UIImageButton(_buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; uiImageButton4.OnClick += new UIElement.MouseEvent(DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(DeleteMouseOut); _deleteButton = uiImageButton4; if (!playerFileData.IsFavorite) Append(uiImageButton4); _buttonLabel = new UIText("", 1f, false); _buttonLabel.VAlign = 1f; _buttonLabel.Left.Set(80f, 0.0f); _buttonLabel.Top.Set(-3f, 0.0f); Append(_buttonLabel); _deleteButtonLabel = new UIText("", 1f, false); _deleteButtonLabel.VAlign = 1f; _deleteButtonLabel.HAlign = 1f; _deleteButtonLabel.Left.Set(-30f, 0.0f); _deleteButtonLabel.Top.Set(-3f, 0.0f); Append(_deleteButtonLabel); }
public UIWorldListItem(WorldFileData data, int orderInList, bool canBePlayed) { _orderInList = orderInList; _data = data; _canBePlayed = canBePlayed; LoadTextures(); InitializeAppearance(); _worldIcon = new UIImage(GetIcon()); _worldIcon.Left.Set(4f, 0f); _worldIcon.OnDoubleClick += PlayGame; Append(_worldIcon); float num = 4f; UIImageButton uIImageButton = new UIImageButton(_buttonPlayTexture); uIImageButton.VAlign = 1f; uIImageButton.Left.Set(num, 0f); uIImageButton.OnClick += PlayGame; base.OnDoubleClick += PlayGame; uIImageButton.OnMouseOver += PlayMouseOver; uIImageButton.OnMouseOut += ButtonMouseOut; Append(uIImageButton); num += 24f; UIImageButton uIImageButton2 = new UIImageButton(_data.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture); uIImageButton2.VAlign = 1f; uIImageButton2.Left.Set(num, 0f); uIImageButton2.OnClick += FavoriteButtonClick; uIImageButton2.OnMouseOver += FavoriteMouseOver; uIImageButton2.OnMouseOut += ButtonMouseOut; uIImageButton2.SetVisibility(1f, _data.IsFavorite ? 0.8f : 0.4f); Append(uIImageButton2); num += 24f; if (SocialAPI.Cloud != null) { UIImageButton uIImageButton3 = new UIImageButton(_data.IsCloudSave ? _buttonCloudActiveTexture : _buttonCloudInactiveTexture); uIImageButton3.VAlign = 1f; uIImageButton3.Left.Set(num, 0f); uIImageButton3.OnClick += CloudButtonClick; uIImageButton3.OnMouseOver += CloudMouseOver; uIImageButton3.OnMouseOut += ButtonMouseOut; uIImageButton3.SetSnapPoint("Cloud", orderInList); Append(uIImageButton3); num += 24f; } if (Main.UseSeedUI && _data.WorldGeneratorVersion != 0L) { UIImageButton uIImageButton4 = new UIImageButton(_buttonSeedTexture); uIImageButton4.VAlign = 1f; uIImageButton4.Left.Set(num, 0f); uIImageButton4.OnClick += SeedButtonClick; uIImageButton4.OnMouseOver += SeedMouseOver; uIImageButton4.OnMouseOut += ButtonMouseOut; uIImageButton4.SetSnapPoint("Seed", orderInList); Append(uIImageButton4); num += 24f; } UIImageButton uIImageButton5 = new UIImageButton(_buttonDeleteTexture) { VAlign = 1f, HAlign = 1f }; if (!_data.IsFavorite) { uIImageButton5.OnClick += DeleteButtonClick; } uIImageButton5.OnMouseOver += DeleteMouseOver; uIImageButton5.OnMouseOut += DeleteMouseOut; _deleteButton = uIImageButton5; Append(uIImageButton5); num += 4f; _buttonLabel = new UIText(""); _buttonLabel.VAlign = 1f; _buttonLabel.Left.Set(num, 0f); _buttonLabel.Top.Set(-3f, 0f); Append(_buttonLabel); _deleteButtonLabel = new UIText(""); _deleteButtonLabel.VAlign = 1f; _deleteButtonLabel.HAlign = 1f; _deleteButtonLabel.Left.Set(-30f, 0f); _deleteButtonLabel.Top.Set(-3f, 0f); Append(_deleteButtonLabel); uIImageButton.SetSnapPoint("Play", orderInList); uIImageButton2.SetSnapPoint("Favorite", orderInList); uIImageButton5.SetSnapPoint("Delete", orderInList); }
public UICharacterListItem(PlayerFileData data) { BorderColor = new Color(89, 116, 213) * 0.7f; _dividerTexture = TextureManager.Load("Images/UI/Divider"); _innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); _buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); _buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); _buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); _buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); _buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); _buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); Height.Set(96f, 0f); Width.Set(0f, 1f); SetPadding(6f); _data = data; _playerPanel = new UICharacter(data.Player); _playerPanel.Left.Set(4f, 0f); _playerPanel.OnDoubleClick += PlayGame; base.OnDoubleClick += PlayGame; Append(_playerPanel); UIImageButton uIImageButton = new UIImageButton(_buttonPlayTexture); uIImageButton.VAlign = 1f; uIImageButton.Left.Set(4f, 0f); uIImageButton.OnClick += PlayGame; uIImageButton.OnMouseOver += PlayMouseOver; uIImageButton.OnMouseOut += ButtonMouseOut; Append(uIImageButton); UIImageButton uIImageButton2 = new UIImageButton(_data.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture); uIImageButton2.VAlign = 1f; uIImageButton2.Left.Set(28f, 0f); uIImageButton2.OnClick += FavoriteButtonClick; uIImageButton2.OnMouseOver += FavoriteMouseOver; uIImageButton2.OnMouseOut += ButtonMouseOut; uIImageButton2.SetVisibility(1f, _data.IsFavorite ? 0.8f : 0.4f); Append(uIImageButton2); if (SocialAPI.Cloud != null) { UIImageButton uIImageButton3 = new UIImageButton(_data.IsCloudSave ? _buttonCloudActiveTexture : _buttonCloudInactiveTexture); uIImageButton3.VAlign = 1f; uIImageButton3.Left.Set(52f, 0f); uIImageButton3.OnClick += CloudButtonClick; uIImageButton3.OnMouseOver += CloudMouseOver; uIImageButton3.OnMouseOut += ButtonMouseOut; Append(uIImageButton3); } UIImageButton uIImageButton4 = new UIImageButton(_buttonDeleteTexture); uIImageButton4.VAlign = 1f; uIImageButton4.HAlign = 1f; uIImageButton4.OnClick += DeleteButtonClick; uIImageButton4.OnMouseOver += DeleteMouseOver; uIImageButton4.OnMouseOut += DeleteMouseOut; _deleteButton = uIImageButton4; if (!_data.IsFavorite) { Append(uIImageButton4); } _buttonLabel = new UIText(""); _buttonLabel.VAlign = 1f; _buttonLabel.Left.Set(80f, 0f); _buttonLabel.Top.Set(-3f, 0f); Append(_buttonLabel); _deleteButtonLabel = new UIText(""); _deleteButtonLabel.VAlign = 1f; _deleteButtonLabel.HAlign = 1f; _deleteButtonLabel.Left.Set(-30f, 0f); _deleteButtonLabel.Top.Set(-3f, 0f); Append(_deleteButtonLabel); }
public UICharacterListItem(PlayerFileData data, int snapPointIndex) { this.BorderColor = new Color(89, 116, 213) * 0.7f; this._dividerTexture = TextureManager.Load("Images/UI/Divider"); this._innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this._buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); this._buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); this._buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); this._buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); this._buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); this._buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); this.Height.Set(96f, 0.0f); this.Width.Set(0.0f, 1f); this.SetPadding(6f); this._data = data; this._playerPanel = new UICharacter(data.Player); this._playerPanel.Left.Set(4f, 0.0f); this._playerPanel.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); this.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); this.Append((UIElement)this._playerPanel); UIImageButton uiImageButton1 = new UIImageButton(this._buttonPlayTexture); uiImageButton1.VAlign = 1f; uiImageButton1.Left.Set(4f, 0.0f); uiImageButton1.OnClick += new UIElement.MouseEvent(this.PlayGame); uiImageButton1.OnMouseOver += new UIElement.MouseEvent(this.PlayMouseOver); uiImageButton1.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); this.Append((UIElement)uiImageButton1); UIImageButton uiImageButton2 = new UIImageButton(this._data.IsFavorite ? this._buttonFavoriteActiveTexture : this._buttonFavoriteInactiveTexture); uiImageButton2.VAlign = 1f; uiImageButton2.Left.Set(28f, 0.0f); uiImageButton2.OnClick += new UIElement.MouseEvent(this.FavoriteButtonClick); uiImageButton2.OnMouseOver += new UIElement.MouseEvent(this.FavoriteMouseOver); uiImageButton2.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton2.SetVisibility(1f, this._data.IsFavorite ? 0.8f : 0.4f); this.Append((UIElement)uiImageButton2); if (SocialAPI.Cloud != null) { UIImageButton uiImageButton3 = new UIImageButton(this._data.IsCloudSave ? this._buttonCloudActiveTexture : this._buttonCloudInactiveTexture); uiImageButton3.VAlign = 1f; uiImageButton3.Left.Set(52f, 0.0f); uiImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); this.Append((UIElement)uiImageButton3); uiImageButton3.SetSnapPoint("Cloud", snapPointIndex, new Vector2?(), new Vector2?()); } UIImageButton uiImageButton4 = new UIImageButton(this._buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; uiImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uiImageButton4; if (!this._data.IsFavorite) { this.Append((UIElement)uiImageButton4); } this._buttonLabel = new UIText("", 1f, false); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(80f, 0.0f); this._buttonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._buttonLabel); this._deleteButtonLabel = new UIText("", 1f, false); this._deleteButtonLabel.VAlign = 1f; this._deleteButtonLabel.HAlign = 1f; this._deleteButtonLabel.Left.Set(-30f, 0.0f); this._deleteButtonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._deleteButtonLabel); uiImageButton1.SetSnapPoint("Play", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton2.SetSnapPoint("Favorite", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton4.SetSnapPoint("Delete", snapPointIndex, new Vector2?(), new Vector2?()); }
public UIWorldListItem(WorldFileData data, int snapPointIndex) { this.BorderColor = new Color(89, 116, 213) * 0.7f; this._dividerTexture = TextureManager.Load("Images/UI/Divider"); this._innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this._buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); this._buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); this._buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); this._buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); this._buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); this._buttonSeedTexture = TextureManager.Load("Images/UI/ButtonSeed"); this._buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); this.Height.Set(96f, 0.0f); this.Width.Set(0.0f, 1f); this.SetPadding(6f); this._data = data; this._worldIcon = new UIImage(this.GetIcon()); this._worldIcon.Left.Set(4f, 0.0f); this._worldIcon.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); this.Append((UIElement)this._worldIcon); float pixels1 = 4f; UIImageButton uiImageButton1 = new UIImageButton(this._buttonPlayTexture); uiImageButton1.VAlign = 1f; uiImageButton1.Left.Set(pixels1, 0.0f); uiImageButton1.OnClick += new UIElement.MouseEvent(this.PlayGame); this.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); uiImageButton1.OnMouseOver += new UIElement.MouseEvent(this.PlayMouseOver); uiImageButton1.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); this.Append((UIElement)uiImageButton1); float pixels2 = 28f; UIImageButton uiImageButton2 = new UIImageButton(this._data.IsFavorite ? this._buttonFavoriteActiveTexture : this._buttonFavoriteInactiveTexture); uiImageButton2.VAlign = 1f; uiImageButton2.Left.Set(pixels2, 0.0f); uiImageButton2.OnClick += new UIElement.MouseEvent(this.FavoriteButtonClick); uiImageButton2.OnMouseOver += new UIElement.MouseEvent(this.FavoriteMouseOver); uiImageButton2.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton2.SetVisibility(1f, this._data.IsFavorite ? 0.8f : 0.4f); this.Append((UIElement)uiImageButton2); float pixels3 = pixels2 + 24f; if (SocialAPI.Cloud != null) { UIImageButton uiImageButton3 = new UIImageButton(this._data.IsCloudSave ? this._buttonCloudActiveTexture : this._buttonCloudInactiveTexture); uiImageButton3.VAlign = 1f; uiImageButton3.Left.Set(pixels3, 0.0f); uiImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton3.SetSnapPoint("Cloud", snapPointIndex, new Vector2?(), new Vector2?()); this.Append((UIElement)uiImageButton3); pixels3 += 24f; } if (Main.UseSeedUI && (long)this._data.WorldGeneratorVersion != 0L) { UIImageButton uiImageButton3 = new UIImageButton(this._buttonSeedTexture); uiImageButton3.VAlign = 1f; uiImageButton3.Left.Set(pixels3, 0.0f); uiImageButton3.OnClick += new UIElement.MouseEvent(this.SeedButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.SeedMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton3.SetSnapPoint("Seed", snapPointIndex, new Vector2?(), new Vector2?()); this.Append((UIElement)uiImageButton3); pixels3 += 24f; } UIImageButton uiImageButton4 = new UIImageButton(this._buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; uiImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uiImageButton4; if (!this._data.IsFavorite) { this.Append((UIElement)uiImageButton4); } float pixels4 = pixels3 + 4f; this._buttonLabel = new UIText("", 1f, false); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(pixels4, 0.0f); this._buttonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._buttonLabel); this._deleteButtonLabel = new UIText("", 1f, false); this._deleteButtonLabel.VAlign = 1f; this._deleteButtonLabel.HAlign = 1f; this._deleteButtonLabel.Left.Set(-30f, 0.0f); this._deleteButtonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._deleteButtonLabel); uiImageButton1.SetSnapPoint("Play", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton2.SetSnapPoint("Favorite", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton4.SetSnapPoint("Delete", snapPointIndex, new Vector2?(), new Vector2?()); }
public UIModPackItem(string name, string[] mods) { this.filename = name; this.mods = mods; this.numMods = mods.Length; modMissing = new bool[mods.Length]; numModsEnabled = 0; numModsDisabled = 0; numModsMissing = 0; for (int i = 0; i < mods.Length; i++) { string modname = mods[i]; bool found = false; foreach (var item in UIModPacks.mods) { if (item.name == modname) { found = true; if (ModLoader.IsEnabled(item)) { numModsEnabled++; } else { numModsDisabled++; } break; } } if (!found) { modMissing[i] = true; numModsMissing++; } } this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this.modName = new UIText(name, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel<string> viewListButton = new UITextPanel<string>("View List", 1f, false); viewListButton.Width.Set(100f, 0f); viewListButton.Height.Set(30f, 0f); viewListButton.Left.Set(430f, 0f); viewListButton.Top.Set(40f, 0f); viewListButton.PaddingTop -= 2f; viewListButton.PaddingBottom -= 2f; viewListButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); viewListButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); viewListButton.OnClick += new UIElement.MouseEvent(ViewListInfo); base.Append(viewListButton); enableListButton = new UITextPanel<string>("Enable this List", 1f, false); enableListButton.Width.Set(100f, 0f); enableListButton.Height.Set(30f, 0f); enableListButton.Left.Set(275f, 0f); enableListButton.Top.Set(40f, 0f); enableListButton.PaddingTop -= 2f; enableListButton.PaddingBottom -= 2f; enableListButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); enableListButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); enableListButton.OnClick += new UIElement.MouseEvent(EnableList); base.Append(enableListButton); enableListOnlyButton = new UITextPanel<string>("Enable only this List", 1f, false); enableListOnlyButton.Width.Set(100f, 0f); enableListOnlyButton.Height.Set(30f, 0f); enableListOnlyButton.Left.Set(75f, 0f); enableListOnlyButton.Top.Set(40f, 0f); enableListOnlyButton.PaddingTop -= 2f; enableListOnlyButton.PaddingBottom -= 2f; enableListOnlyButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); enableListOnlyButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); enableListOnlyButton.OnClick += new UIElement.MouseEvent(EnableListOnly); base.Append(enableListOnlyButton); deleteButton = new UIImageButton(TextureManager.Load("Images/UI/ButtonDelete")); deleteButton.Top.Set(40f, 0f); deleteButton.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); base.Append(deleteButton); }
public UICharacterListItem(PlayerFileData data) { BorderColor = new Color(89, 116, 213) * 0.7f; _dividerTexture = TextureManager.Load("Images/UI/Divider"); _innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); _buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); _buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); _buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); _buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); _buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); _buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); Height.Set(96f, 0.0f); Width.Set(0.0f, 1f); SetPadding(6f); playerFileData = data; _playerPanel = new UICharacter(data.Player); _playerPanel.Left.Set(4f, 0.0f); _playerPanel.OnDoubleClick += new UIElement.MouseEvent(PlayGame); OnDoubleClick += new UIElement.MouseEvent(PlayGame); Append(_playerPanel); UIImageButton uiImageButton1 = new UIImageButton(_buttonPlayTexture); uiImageButton1.VAlign = 1f; uiImageButton1.Left.Set(4f, 0.0f); uiImageButton1.OnClick += new UIElement.MouseEvent(PlayGame); uiImageButton1.OnMouseOver += new UIElement.MouseEvent(PlayMouseOver); uiImageButton1.OnMouseOut += new UIElement.MouseEvent(ButtonMouseOut); Append(uiImageButton1); UIImageButton uiImageButton2 = new UIImageButton(playerFileData.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture); uiImageButton2.VAlign = 1f; uiImageButton2.Left.Set(28f, 0.0f); uiImageButton2.OnClick += new UIElement.MouseEvent(FavoriteButtonClick); uiImageButton2.OnMouseOver += new UIElement.MouseEvent(FavoriteMouseOver); uiImageButton2.OnMouseOut += new UIElement.MouseEvent(ButtonMouseOut); uiImageButton2.SetVisibility(1f, playerFileData.IsFavorite ? 0.8f : 0.4f); Append(uiImageButton2); UIImageButton uiImageButton4 = new UIImageButton(_buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; uiImageButton4.OnClick += new UIElement.MouseEvent(DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(DeleteMouseOut); _deleteButton = uiImageButton4; if (!playerFileData.IsFavorite) { Append(uiImageButton4); } _buttonLabel = new UIText("", 1f, false); _buttonLabel.VAlign = 1f; _buttonLabel.Left.Set(80f, 0.0f); _buttonLabel.Top.Set(-3f, 0.0f); Append(_buttonLabel); _deleteButtonLabel = new UIText("", 1f, false); _deleteButtonLabel.VAlign = 1f; _deleteButtonLabel.HAlign = 1f; _deleteButtonLabel.Left.Set(-30f, 0.0f); _deleteButtonLabel.Top.Set(-3f, 0.0f); Append(_deleteButtonLabel); }
public UIWorldListItem(WorldFileData data, int snapPointIndex) { this._data = data; this.LoadTextures(); this.InitializeAppearance(); this._worldIcon = new UIImage(this.GetIcon()); this._worldIcon.Left.Set(4f, 0.0f); this._worldIcon.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); this.Append((UIElement)this._worldIcon); float pixels1 = 4f; UIImageButton uiImageButton1 = new UIImageButton(this._buttonPlayTexture); uiImageButton1.VAlign = 1f; uiImageButton1.Left.Set(pixels1, 0.0f); uiImageButton1.OnClick += new UIElement.MouseEvent(this.PlayGame); this.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); uiImageButton1.OnMouseOver += new UIElement.MouseEvent(this.PlayMouseOver); uiImageButton1.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); this.Append((UIElement)uiImageButton1); float pixels2 = pixels1 + 24f; UIImageButton uiImageButton2 = new UIImageButton(this._data.IsFavorite ? this._buttonFavoriteActiveTexture : this._buttonFavoriteInactiveTexture); uiImageButton2.VAlign = 1f; uiImageButton2.Left.Set(pixels2, 0.0f); uiImageButton2.OnClick += new UIElement.MouseEvent(this.FavoriteButtonClick); uiImageButton2.OnMouseOver += new UIElement.MouseEvent(this.FavoriteMouseOver); uiImageButton2.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton2.SetVisibility(1f, this._data.IsFavorite ? 0.8f : 0.4f); this.Append((UIElement)uiImageButton2); float pixels3 = pixels2 + 24f; if (SocialAPI.Cloud != null) { UIImageButton uiImageButton3 = new UIImageButton(this._data.IsCloudSave ? this._buttonCloudActiveTexture : this._buttonCloudInactiveTexture); uiImageButton3.VAlign = 1f; uiImageButton3.Left.Set(pixels3, 0.0f); uiImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton3.SetSnapPoint("Cloud", snapPointIndex, new Vector2?(), new Vector2?()); this.Append((UIElement)uiImageButton3); pixels3 += 24f; } if (Main.UseSeedUI && (long)this._data.WorldGeneratorVersion != 0L) { UIImageButton uiImageButton3 = new UIImageButton(this._buttonSeedTexture); uiImageButton3.VAlign = 1f; uiImageButton3.Left.Set(pixels3, 0.0f); uiImageButton3.OnClick += new UIElement.MouseEvent(this.SeedButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.SeedMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uiImageButton3.SetSnapPoint("Seed", snapPointIndex, new Vector2?(), new Vector2?()); this.Append((UIElement)uiImageButton3); pixels3 += 24f; } UIImageButton uiImageButton4 = new UIImageButton(this._buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; uiImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uiImageButton4; if (!this._data.IsFavorite) { this.Append((UIElement)uiImageButton4); } float pixels4 = pixels3 + 4f; this._buttonLabel = new UIText("", 1f, false); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(pixels4, 0.0f); this._buttonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._buttonLabel); this._deleteButtonLabel = new UIText("", 1f, false); this._deleteButtonLabel.VAlign = 1f; this._deleteButtonLabel.HAlign = 1f; this._deleteButtonLabel.Left.Set(-30f, 0.0f); this._deleteButtonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement)this._deleteButtonLabel); uiImageButton1.SetSnapPoint("Play", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton2.SetSnapPoint("Favorite", snapPointIndex, new Vector2?(), new Vector2?()); uiImageButton4.SetSnapPoint("Delete", snapPointIndex, new Vector2?(), new Vector2?()); }
public UIWorldListItem(WorldFileData data) { this.BorderColor = new Color(89, 116, 213) * 0.7f; this._dividerTexture = TextureManager.Load("Images/UI/Divider"); this._innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this._buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); this._buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); this._buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); this._buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); this._buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); this._buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); this.Height.Set(96f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this._data = data; this._worldIcon = new UIImage(this.GetIcon()); this._worldIcon.Left.Set(4f, 0f); this._worldIcon.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); base.Append(this._worldIcon); UIImageButton uIImageButton = new UIImageButton(this._buttonPlayTexture); uIImageButton.VAlign = 1f; uIImageButton.Left.Set(4f, 0f); uIImageButton.OnClick += new UIElement.MouseEvent(this.PlayGame); base.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); uIImageButton.OnMouseOver += new UIElement.MouseEvent(this.PlayMouseOver); uIImageButton.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); base.Append(uIImageButton); UIImageButton uIImageButton2 = new UIImageButton(this._data.IsFavorite ? this._buttonFavoriteActiveTexture : this._buttonFavoriteInactiveTexture); uIImageButton2.VAlign = 1f; uIImageButton2.Left.Set(28f, 0f); uIImageButton2.OnClick += new UIElement.MouseEvent(this.FavoriteButtonClick); uIImageButton2.OnMouseOver += new UIElement.MouseEvent(this.FavoriteMouseOver); uIImageButton2.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uIImageButton2.SetVisibility(1f, this._data.IsFavorite ? 0.8f : 0.4f); base.Append(uIImageButton2); if (SocialAPI.Cloud != null) { UIImageButton uIImageButton3 = new UIImageButton(this._data.IsCloudSave ? this._buttonCloudActiveTexture : this._buttonCloudInactiveTexture); uIImageButton3.VAlign = 1f; uIImageButton3.Left.Set(52f, 0f); uIImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uIImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uIImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); base.Append(uIImageButton3); } UIImageButton uIImageButton4 = new UIImageButton(this._buttonDeleteTexture); uIImageButton4.VAlign = 1f; uIImageButton4.HAlign = 1f; uIImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uIImageButton4.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uIImageButton4.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uIImageButton4; if (!this._data.IsFavorite) { base.Append(uIImageButton4); } this._buttonLabel = new UIText("", 1f, false); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(80f, 0f); this._buttonLabel.Top.Set(-3f, 0f); base.Append(this._buttonLabel); this._deleteButtonLabel = new UIText("", 1f, false); this._deleteButtonLabel.VAlign = 1f; this._deleteButtonLabel.HAlign = 1f; this._deleteButtonLabel.Left.Set(-30f, 0f); this._deleteButtonLabel.Top.Set(-3f, 0f); base.Append(this._deleteButtonLabel); }
// Token: 0x0600115C RID: 4444 RVA: 0x0040B5E0 File Offset: 0x004097E0 public UIWorldListItem(WorldFileData data, int snapPointIndex) { this._data = data; this.LoadTextures(); this.InitializeAppearance(); this._worldIcon = new UIImage(this.GetIcon()); this._worldIcon.Left.Set(4f, 0f); this._worldIcon.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); base.Append(this._worldIcon); float num = 4f; UIImageButton uIImageButton = new UIImageButton(this._buttonPlayTexture); uIImageButton.VAlign = 1f; uIImageButton.Left.Set(num, 0f); uIImageButton.OnClick += new UIElement.MouseEvent(this.PlayGame); base.OnDoubleClick += new UIElement.MouseEvent(this.PlayGame); uIImageButton.OnMouseOver += new UIElement.MouseEvent(this.PlayMouseOver); uIImageButton.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); base.Append(uIImageButton); num += 24f; UIImageButton uIImageButton2 = new UIImageButton(this._data.IsFavorite ? this._buttonFavoriteActiveTexture : this._buttonFavoriteInactiveTexture); uIImageButton2.VAlign = 1f; uIImageButton2.Left.Set(num, 0f); uIImageButton2.OnClick += new UIElement.MouseEvent(this.FavoriteButtonClick); uIImageButton2.OnMouseOver += new UIElement.MouseEvent(this.FavoriteMouseOver); uIImageButton2.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uIImageButton2.SetVisibility(1f, this._data.IsFavorite ? 0.8f : 0.4f); base.Append(uIImageButton2); num += 24f; if (SocialAPI.Cloud != null) { UIImageButton uIImageButton3 = new UIImageButton(this._data.IsCloudSave ? this._buttonCloudActiveTexture : this._buttonCloudInactiveTexture); uIImageButton3.VAlign = 1f; uIImageButton3.Left.Set(num, 0f); uIImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uIImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uIImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uIImageButton3.SetSnapPoint("Cloud", snapPointIndex, null, null); base.Append(uIImageButton3); num += 24f; } if (Main.UseSeedUI && this._data.WorldGeneratorVersion != 0uL) { UIImageButton uIImageButton4 = new UIImageButton(this._buttonSeedTexture); uIImageButton4.VAlign = 1f; uIImageButton4.Left.Set(num, 0f); uIImageButton4.OnClick += new UIElement.MouseEvent(this.SeedButtonClick); uIImageButton4.OnMouseOver += new UIElement.MouseEvent(this.SeedMouseOver); uIImageButton4.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); uIImageButton4.SetSnapPoint("Seed", snapPointIndex, null, null); base.Append(uIImageButton4); num += 24f; } UIImageButton uIImageButton5 = new UIImageButton(this._buttonDeleteTexture); uIImageButton5.VAlign = 1f; uIImageButton5.HAlign = 1f; uIImageButton5.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uIImageButton5.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uIImageButton5.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uIImageButton5; if (!this._data.IsFavorite) { base.Append(uIImageButton5); } num += 4f; this._buttonLabel = new UIText("", 1f, false); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(num, 0f); this._buttonLabel.Top.Set(-3f, 0f); base.Append(this._buttonLabel); this._deleteButtonLabel = new UIText("", 1f, false); this._deleteButtonLabel.VAlign = 1f; this._deleteButtonLabel.HAlign = 1f; this._deleteButtonLabel.Left.Set(-30f, 0f); this._deleteButtonLabel.Top.Set(-3f, 0f); base.Append(this._deleteButtonLabel); uIImageButton.SetSnapPoint("Play", snapPointIndex, null, null); uIImageButton2.SetSnapPoint("Favorite", snapPointIndex, null, null); uIImageButton5.SetSnapPoint("Delete", snapPointIndex, null, null); }
public UICharacterListItem(PlayerFileData data, int snapPointIndex) { BorderColor = new Color(89, 116, 213) * 0.7f; _dividerTexture = Main.Assets.Request <Texture2D>("Images/UI/Divider", Main.content, (AssetRequestMode)1); _innerPanelTexture = Main.Assets.Request <Texture2D>("Images/UI/InnerPanelBackground", Main.content, (AssetRequestMode)1); _buttonCloudActiveTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonCloudActive", Main.content, (AssetRequestMode)1); _buttonCloudInactiveTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonCloudInactive", Main.content, (AssetRequestMode)1); _buttonFavoriteActiveTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonFavoriteActive", Main.content, (AssetRequestMode)1); _buttonFavoriteInactiveTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonFavoriteInactive", Main.content, (AssetRequestMode)1); _buttonPlayTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonPlay", Main.content, (AssetRequestMode)1); _buttonDeleteTexture = Main.Assets.Request <Texture2D>("Images/UI/ButtonDelete", Main.content, (AssetRequestMode)1); Height.Set(96f, 0f); Width.Set(0f, 1f); SetPadding(6f); _data = data; _playerPanel = new UICharacter(data.Player); _playerPanel.Left.Set(4f, 0f); _playerPanel.OnDoubleClick += PlayGame; base.OnDoubleClick += PlayGame; Append(_playerPanel); UIImageButton uIImageButton = new UIImageButton(_buttonPlayTexture); uIImageButton.VAlign = 1f; uIImageButton.Left.Set(4f, 0f); uIImageButton.OnClick += PlayGame; uIImageButton.OnMouseOver += PlayMouseOver; uIImageButton.OnMouseOut += ButtonMouseOut; Append(uIImageButton); UIImageButton uIImageButton2 = new UIImageButton(_data.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture); uIImageButton2.VAlign = 1f; uIImageButton2.Left.Set(28f, 0f); uIImageButton2.OnClick += FavoriteButtonClick; uIImageButton2.OnMouseOver += FavoriteMouseOver; uIImageButton2.OnMouseOut += ButtonMouseOut; uIImageButton2.SetVisibility(1f, _data.IsFavorite ? 0.8f : 0.4f); Append(uIImageButton2); if (SocialAPI.Cloud != null) { UIImageButton uIImageButton3 = new UIImageButton(_data.IsCloudSave ? _buttonCloudActiveTexture : _buttonCloudInactiveTexture); uIImageButton3.VAlign = 1f; uIImageButton3.Left.Set(52f, 0f); uIImageButton3.OnClick += CloudButtonClick; uIImageButton3.OnMouseOver += CloudMouseOver; uIImageButton3.OnMouseOut += ButtonMouseOut; Append(uIImageButton3); uIImageButton3.SetSnapPoint("Cloud", snapPointIndex); } UIImageButton uIImageButton4 = new UIImageButton(_buttonDeleteTexture) { VAlign = 1f, HAlign = 1f }; if (!_data.IsFavorite) { uIImageButton4.OnClick += DeleteButtonClick; } uIImageButton4.OnMouseOver += DeleteMouseOver; uIImageButton4.OnMouseOut += DeleteMouseOut; _deleteButton = uIImageButton4; Append(uIImageButton4); _buttonLabel = new UIText(""); _buttonLabel.VAlign = 1f; _buttonLabel.Left.Set(80f, 0f); _buttonLabel.Top.Set(-3f, 0f); Append(_buttonLabel); _deleteButtonLabel = new UIText(""); _deleteButtonLabel.VAlign = 1f; _deleteButtonLabel.HAlign = 1f; _deleteButtonLabel.Left.Set(-30f, 0f); _deleteButtonLabel.Top.Set(-3f, 0f); Append(_deleteButtonLabel); uIImageButton.SetSnapPoint("Play", snapPointIndex); uIImageButton2.SetSnapPoint("Favorite", snapPointIndex); uIImageButton4.SetSnapPoint("Delete", snapPointIndex); }