Example #1
0
        public CButton(CButton button)
        {
            _PartyModeID = button._PartyModeID;
            _Theme       = new SThemeButton
            {
                Skin         = button._Theme.Skin,
                SkinSelected = button._Theme.SkinSelected
            };

            MaxRect    = button.MaxRect;
            Color      = button.Color;
            SelColor   = button.SelColor;
            Texture    = button.Texture;
            SelTexture = button.SelTexture;

            Text        = new CText(button.Text);
            _SelText    = _SelText == null ? null : new CText(button._SelText);
            Selected    = false;
            EditMode    = false;
            _Selectable = button._Selectable;

            _Reflection       = button._Reflection;
            _ReflectionHeight = button._ReflectionHeight;
            _ReflectionSpace  = button._ReflectionSpace;

            _SelReflection       = button._SelReflection;
            _SelReflectionHeight = button._SelReflectionHeight;
            _SelReflectionSpace  = button._SelReflectionSpace;
        }
Example #2
0
        public void LoadSkin()
        {
            _Theme.Color.Get(_PartyModeID, out _Color);
            _Theme.ProcessedColor.Get(_PartyModeID, out _ColorProcessed);

            MaxRect = _Theme.Rect;
            _Text   = new CText(X, Y, Z, H, W, EAlignment.Left, EStyle.Bold, "Normal", _Color, String.Empty);
        }
Example #3
0
 public CButton(int partyModeID)
 {
     _PartyModeID = partyModeID;
     Text         = new CText(_PartyModeID);
     _SelText     = new CText(_PartyModeID);
     Selected     = false;
     EditMode     = false;
 }
Example #4
0
        public CButton(SThemeButton theme, int partyModeID, bool buttonText = false)
        {
            _PartyModeID = partyModeID;
            _Theme       = theme;

            Text     = new CText(_Theme.Text, _PartyModeID, buttonText);
            _SelText = _Theme.SelText.HasValue ? new CText(_Theme.SelText.Value, _PartyModeID, buttonText) : null;

            Selected = false;
            EditMode = false;

            ThemeLoaded = true;
        }
Example #5
0
        public CLyric(SThemeLyrics theme, int partyModeID)
        {
            _PartyModeID = partyModeID;
            _Theme       = theme;

            _Line  = new CSongLine();
            _Text  = new CText(_PartyModeID);
            _Width = 1f;

            LyricStyle = ELyricStyle.TR_CONFIG_LYRICSTYLE_FILL;

            ThemeLoaded = true;
        }
Example #6
0
        public CLyric(int partyModeID)
        {
            _PartyModeID    = partyModeID;
            _Theme          = new SThemeLyrics();
            ThemeLoaded     = false;
            _Color          = new SColorF();
            _ColorProcessed = new SColorF();

            _Line = new CSongLine();
            _Text = new CText(_PartyModeID);

            LyricStyle = ELyricStyle.TR_CONFIG_LYRICSTYLE_FILL;
        }
Example #7
0
        public void LoadSkin()
        {
            if (!ThemeLoaded)
            {
                return;
            }
            _Theme.Color.Get(_PartyModeID, out _Color);
            _Theme.ProcessedColor.Get(_PartyModeID, out _ColorProcessed);

            MaxRect = _Theme.Rect;
            if (_Theme.Align.HasValue)
            {
                Align = _Theme.Align.Value;
            }
            _Text = new CText(X, Y, Z, H, W, EAlignment.Left, EStyle.Bold, "Normal", _Color, String.Empty);
        }
Example #8
0
        private void _LoadThemeBasics(CXmlReader xmlReader)
        {
            // Backgrounds
            var background = new CBackground(PartyModeID);
            int i          = 1;

            while (background.LoadTheme("//root/" + ThemeName, "Background" + i, xmlReader))
            {
                _AddBackground(background);
                background = new CBackground(PartyModeID);
                i++;
            }

            // Statics
            var stat = new CStatic(PartyModeID);

            i = 1;
            while (stat.LoadTheme("//root/" + ThemeName, "Static" + i, xmlReader))
            {
                _AddStatic(stat);
                stat = new CStatic(PartyModeID);
                i++;
            }

            // Texts
            var text = new CText(PartyModeID);

            i = 1;
            while (text.LoadTheme("//root/" + ThemeName, "Text" + i, xmlReader))
            {
                _AddText(text);
                text = new CText(PartyModeID);
                i++;
            }

            // ParticleEffects
            var partef = new CParticleEffect(PartyModeID);

            i = 1;
            while (partef.LoadTheme("//root/" + ThemeName, "ParticleEffect" + i, xmlReader))
            {
                _AddParticleEffect(partef);
                partef = new CParticleEffect(PartyModeID);
                i++;
            }
        }
Example #9
0
        public CLyric(CLyric l)
        {
            _PartyModeID = l._PartyModeID;
            _Theme       = l._Theme;

            _Color          = l._Color;
            _ColorProcessed = l._ColorProcessed;
            MaxRect         = l.MaxRect;

            _Line    = l._Line;
            _Text    = new CText(l._Text);
            Width    = l.Width;
            MaxWidth = l.MaxWidth;

            _Align = l._Align;

            LyricStyle = l.LyricStyle;
        }
Example #10
0
        public void LoadSkin()
        {
            if (!ThemeLoaded)
            {
                return;
            }
            Text = new CText(_Theme.Text, _PartyModeID);
            Text.LoadSkin();
            Text.Selected = Selected;

            if (_Theme.SelText.HasValue)
            {
                _SelText = new CText(_Theme.SelText.Value, _PartyModeID);
                _SelText.LoadSkin();
            }

            _Theme.Color.Get(_PartyModeID, out Color);
            _Theme.SelColor.Get(_PartyModeID, out SelColor);

            MaxRect = _Theme.Rect;

            _Reflection = _Theme.Reflection.HasValue;
            if (_Reflection)
            {
                Debug.Assert(_Theme.Reflection != null);
                _ReflectionHeight = _Theme.Reflection.Value.Height;
                _ReflectionSpace  = _Theme.Reflection.Value.Space;
            }

            _SelReflection = _Theme.Reflection.HasValue;
            if (_SelReflection)
            {
                Debug.Assert(_Theme.SelReflection != null);
                _SelReflectionHeight = _Theme.SelReflection.Value.Height;
                _SelReflectionSpace  = _Theme.SelReflection.Value.Space;
            }

            if (_Theme.Rect.Z < Text.Z)
            {
                Text.Z = _Theme.Rect.Z;
            }
        }
Example #11
0
        public CText(CText text)
        {
            _PartyModeID   = text._PartyModeID;
            _TranslationID = text._TranslationID;

            MaxRect = text.MaxRect;
            _Rect   = text._Rect;
            _PositionNeedsUpdate = false;
            _Align       = text._Align;
            _ResizeAlign = text._ResizeAlign;
            Font         = new CFont(text.Font); //Use setter to set observer

            Color             = text.Color;
            SelColor          = text.SelColor;
            _ReflectionSpace  = text._ReflectionSpace;
            _ReflectionHeight = text._ReflectionHeight;

            Text    = text.Text;
            Visible = text.Visible;
            Alpha   = text.Alpha;

            _EditMode = text._EditMode;
        }
Example #12
0
 private void _PrepareTiles()
 {
     _Tiles.Clear();
     for (int i = 0; i < _Theme.Tiles.NumH; i++)
     {
         for (int j = 0; j < _Theme.Tiles.NumW; j++)
         {
             var rect = new SRectF(MaxRect.X + j * (_Theme.Tiles.W + _Theme.Tiles.SpaceW), MaxRect.Y + i * (_Theme.Tiles.H + _Theme.Tiles.SpaceH),
                                   _Theme.Tiles.W, _Theme.Tiles.H, MaxRect.Z);
             var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, _ColorEmptyTile, rect)
             {
                 Aspect = EAspect.Crop
             };
             var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.Tiles.Name.Space, rect.Z, _Theme.Tiles.Name.Height, rect.W, EAlignment.Center,
                                      _Theme.Tiles.Name.Style, _Theme.Tiles.Name.Font, _ColorNameTile, "");
             _Tiles.Add(new CTile(tileStatic, tileText, -1));
         }
     }
     _Rect.X      = MaxRect.X;
     _Rect.Y      = MaxRect.Y;
     _Rect.Right  = _Tiles[_Tiles.Count - 1].Avatar.Rect.Right;
     _Rect.Bottom = _Tiles[_Tiles.Count - 1].Name.Rect.Bottom;
     _Rect.Z      = MaxRect.Z;
 }
Example #13
0
 protected void _AddText(CText text, String key = null)
 {
     _AddElement(_Texts.Add(text, key), EType.Text);
 }
Example #14
0
 public CTile(CStatic av, CText tex, int pID)
 {
     Avatar    = av;
     Name      = tex;
     ProfileID = pID;
 }
Example #15
0
        private void _Revalidate()
        {
            if (!_NeedsRevalidate)
            {
                return;
            }
            _NeedsRevalidate = false;
            int numvis = Math.Min(_NumVisible, _Values.Count);

            if (numvis != _VisibleElements.Count)
            {
                _VisibleElements.Clear();
                for (int i = 0; i < numvis; i++)
                {
                    var el = new CElement
                    {
                        Text = new CText(0, 0, 0, _TextH, _MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, _TextColor, "T", _PartyModeID),
                        Img  = new CStatic(_PartyModeID)
                    };
                    el.Img.Aspect = EAspect.Crop;
                    _VisibleElements.Add(el);
                }
            }
            if (numvis == 0)
            {
                return;
            }

            float elWidth = (Rect.W - _TextRelativeX * 2) / numvis;
            //Center point of the first entry
            float xStart = Rect.X + _TextRelativeX + elWidth / 2f;

            int offset = _GetCurOffset();

            for (int i = 0; i < numvis; i++)
            {
                CText      text = _VisibleElements[i].Text;
                RectangleF textBounds;
                float      curX = xStart + elWidth * i;
                if (String.IsNullOrEmpty(_Values[i + offset].Text))
                {
                    text.Visible = false;
                    textBounds   = new RectangleF();
                }
                else
                {
                    text.Visible       = true;
                    text.Text          = _Values[i + offset].Text;
                    text.TranslationID = _Values[i + offset].TranslationId;
                    text.Color         = (i + offset == Selection) ? _SelTextColor : _TextColor;
                    textBounds         = CBase.Fonts.GetTextBounds(text);
                    text.X             = curX;
                    text.Z             = Rect.Z;
                }

                CStatic img = _VisibleElements[i].Img;
                if (!DrawTextures || _Values[i + offset].Texture == null)
                {
                    if (text.Visible)
                    {
                        text.Y = Rect.Y + (Rect.H - textBounds.Height) / 2 - _TextRelativeY;
                    }
                    img.Visible = false;
                    _VisibleElements[i].Bounds = new SRectF(text.X - textBounds.Width / 2f, text.Y, textBounds.Width, textBounds.Height, Rect.Z);
                }
                else
                {
                    text.Y      = (int)(Rect.Y + Rect.H - textBounds.Height - _TextRelativeY);
                    img.Texture = _Values[i + offset].Texture;
                    float alpha = (i + offset == _Selection) ? 1f : 0.35f;
                    img.Color = new SColorF(1f, 1f, 1f, alpha);
                    float size = Rect.H - textBounds.Height - 2 * _TextRelativeY;
                    if (size > elWidth)
                    {
                        size = elWidth;
                    }
                    var imgRect = new SRectF(curX - size / 2, Rect.Y + _TextRelativeY, size, size, Rect.Z);
                    img.MaxRect = imgRect;
                    _VisibleElements[i].Bounds = imgRect;
                }
            }
        }
Example #16
0
 public static CText GetNewText(CText text)
 {
     return(new CText(text));
 }
Example #17
0
        public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
        {
            string item = xmlPath + "/" + elementName;

            ThemeLoaded = true;

            ThemeLoaded &= xmlReader.GetValue(item + "/Skin", out _Theme.Skin, String.Empty);
            ThemeLoaded &= xmlReader.GetValue(item + "/SkinSelected", out _Theme.SkinSelected, String.Empty);

            ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/X", ref _Theme.Rect.X);
            ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Y", ref _Theme.Rect.Y);
            ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Z", ref _Theme.Rect.Z);
            ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/W", ref _Theme.Rect.W);
            ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref _Theme.Rect.H);

            if (xmlReader.GetValue(item + "/Color", out _Theme.Color.Name, String.Empty))
            {
                ThemeLoaded &= _Theme.Color.Get(_PartyModeID, out Color);
            }
            else
            {
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/G", ref Color.G);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/B", ref Color.B);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref Color.A);
            }

            if (xmlReader.GetValue(item + "/SColor", out _Theme.SelColor.Name, String.Empty))
            {
                ThemeLoaded &= _Theme.SelColor.Get(_PartyModeID, out SelColor);
            }
            else
            {
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SR", ref SelColor.R);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SG", ref SelColor.G);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SB", ref SelColor.B);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SA", ref SelColor.A);
            }

            ThemeLoaded &= Text.LoadTheme(item, "Text", xmlReader, true);
            Text.Z       = Rect.Z;
            if (xmlReader.ItemExists(item + "/SText"))
            {
                ThemeLoaded &= _SelText.LoadTheme(item, "SText", xmlReader, true);
                _SelText.Z   = Rect.Z;
            }
            else
            {
                _SelText = null;
            }


            //Reflections
            if (xmlReader.ItemExists(item + "/Reflection"))
            {
                _Reflection  = true;
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref _ReflectionSpace);
                ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Height", ref _ReflectionHeight);

                _Theme.Reflection = new SReflection(_ReflectionHeight, _ReflectionSpace);
            }
            else
            {
                _Reflection       = false;
                _Theme.Reflection = null;
            }

            if (xmlReader.ItemExists(item + "/SReflection"))
            {
                _SelReflection = true;
                ThemeLoaded   &= xmlReader.TryGetFloatValue(item + "/SReflection/Space", ref _SelReflectionSpace);
                ThemeLoaded   &= xmlReader.TryGetFloatValue(item + "/SReflection/Height", ref _SelReflectionHeight);

                _Theme.SelReflection = new SReflection(_SelReflectionHeight, _SelReflectionSpace);
            }
            else
            {
                _SelReflection       = false;
                _Theme.SelReflection = null;
            }

            if (ThemeLoaded)
            {
                _Theme.Name           = elementName;
                _Theme.Color.Color    = Color;
                _Theme.SelColor.Color = SelColor;
                _ReadSubThemeElements();

                LoadSkin();
            }
            return(ThemeLoaded);
        }