private void AddSearchBar(UIElement searchArea)
        {
            UIImageButton uiImageButton1 = new UIImageButton((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", (AssetRequestMode)1));

            uiImageButton1.VAlign = 0.5f;
            uiImageButton1.HAlign = 0.0f;
            UIImageButton uiImageButton2 = uiImageButton1;

            uiImageButton2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea);
            uiImageButton2.SetHoverImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search_Border", (AssetRequestMode)1));
            uiImageButton2.SetVisibility(1f, 1f);
            uiImageButton2.SetSnapPoint("CreativeInfinitesSearch", 0, new Vector2?(), new Vector2?());
            searchArea.Append((UIElement)uiImageButton2);
            UIPanel uiPanel1 = new UIPanel();

            uiPanel1.Width  = new StyleDimension((float)(-(double)uiImageButton2.Width.Pixels - 3.0), 1f);
            uiPanel1.Height = new StyleDimension(0.0f, 1f);
            uiPanel1.VAlign = 0.5f;
            uiPanel1.HAlign = 1f;
            UIPanel uiPanel2 = uiPanel1;

            this._searchBoxPanel     = uiPanel2;
            uiPanel2.BackgroundColor = new Color(35, 40, 83);
            uiPanel2.BorderColor     = new Color(35, 40, 83);
            uiPanel2.SetPadding(0.0f);
            searchArea.Append((UIElement)uiPanel2);
            UISearchBar uiSearchBar1 = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f);

            uiSearchBar1.Width  = new StyleDimension(0.0f, 1f);
            uiSearchBar1.Height = new StyleDimension(0.0f, 1f);
            uiSearchBar1.HAlign = 0.0f;
            uiSearchBar1.VAlign = 0.5f;
            uiSearchBar1.Left   = new StyleDimension(0.0f, 0.0f);
            uiSearchBar1.IgnoresMouseInteraction = true;
            UISearchBar uiSearchBar2 = uiSearchBar1;

            this._searchBar   = uiSearchBar2;
            uiPanel2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea);
            uiSearchBar2.OnContentsChanged += new Action <string>(this.OnSearchContentsChanged);
            uiPanel2.Append((UIElement)uiSearchBar2);
            uiSearchBar2.OnStartTakingInput       += new Action(this.OnStartTakingInput);
            uiSearchBar2.OnEndTakingInput         += new Action(this.OnEndTakingInput);
            uiSearchBar2.OnNeedingVirtualKeyboard += new Action(this.OpenVirtualKeyboardWhenNeeded);
            uiSearchBar2.OnCancledTakingInput     += new Action(this.OnCancledInput);
        }
        private void AddSearchBar(UIElement searchArea)
        {
            UIImageButton uIImageButton = new UIImageButton(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", (AssetRequestMode)1))
            {
                VAlign = 0.5f,
                HAlign = 0f
            };

            uIImageButton.OnClick += Click_SearchArea;
            uIImageButton.SetHoverImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search_Border", (AssetRequestMode)1));
            uIImageButton.SetVisibility(1f, 1f);
            uIImageButton.SetSnapPoint("CreativeInfinitesSearch", 0);
            searchArea.Append(uIImageButton);
            UIPanel uIPanel = _searchBoxPanel = new UIPanel
            {
                Width  = new StyleDimension(0f - uIImageButton.Width.Pixels - 3f, 1f),
                Height = new StyleDimension(0f, 1f),
                VAlign = 0.5f,
                HAlign = 1f
            };

            uIPanel.BackgroundColor = new Color(35, 40, 83);
            uIPanel.BorderColor     = new Color(35, 40, 83);
            uIPanel.SetPadding(0f);
            searchArea.Append(uIPanel);
            UISearchBar uISearchBar = _searchBar = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f)
            {
                Width  = new StyleDimension(0f, 1f),
                Height = new StyleDimension(0f, 1f),
                HAlign = 0f,
                VAlign = 0.5f,
                Left   = new StyleDimension(0f, 0f),
                IgnoresMouseInteraction = true
            };

            uIPanel.OnClick += Click_SearchArea;
            uISearchBar.OnContentsChanged += OnSearchContentsChanged;
            uIPanel.Append(uISearchBar);
            uISearchBar.OnStartTakingInput       += OnStartTakingInput;
            uISearchBar.OnEndTakingInput         += OnEndTakingInput;
            uISearchBar.OnNeedingVirtualKeyboard += OpenVirtualKeyboardWhenNeeded;
            uISearchBar.OnCancledTakingInput     += OnCancledInput;
        }
예제 #3
0
        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);
        }
예제 #4
0
        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?());
        }
예제 #5
0
        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?());
        }
예제 #6
0
        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?());
        }
예제 #7
0
        // 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);
        }
예제 #8
0
        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);
        }