Inheritance: MonoBehaviour
Exemplo n.º 1
0
        public bool Equals(IXLPhonetics other)
        {
            if (other == null)
            {
                return(false);
            }

            Int32 phoneticsCount = _phonetics.Count;

            for (Int32 i = 0; i < phoneticsCount; i++)
            {
                if (!_phonetics[i].Equals(other.ElementAt(i)))
                {
                    return(false);
                }
            }

            return
                (Bold == other.Bold &&
                 Italic == other.Italic &&
                 Underline == other.Underline &&
                 Strikethrough == other.Strikethrough &&
                 VerticalAlignment == other.VerticalAlignment &&
                 Shadow == other.Shadow &&
                 FontSize == other.FontSize &&
                 FontColor.Equals(other.FontColor) &&
                 FontName == other.FontName &&
                 FontFamilyNumbering == other.FontFamilyNumbering);
        }
Exemplo n.º 2
0
        private SQLiteParameter[] GetSqlParameters()
        {
            List <SQLiteParameter> SqlParmColl = new List <SQLiteParameter>();

            try
            {
                SqlParmColl.Add(CommonDB.AddSqlParm("@ID", ID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DisplayID", DisplayID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@oIndex", oIndex, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DlgType", DlgType, DbType.Byte));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DlgIndex", DlgIndex, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Left", Left, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Right", Right, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Top", Top, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Bottom", Bottom, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ScanTime", ScanTime, DbType.Int16));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ViewLable", ViewLable, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Index", Index, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@BackColor", BackColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@TrendColor", TrendColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@TrendWidth", TrendWidth, DbType.Int16));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Fill", Fill, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Font", Font, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@FontColor", FontColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@LastRev", LastRev, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@CompiledExp", CompiledExp, DbType.Binary));
                SqlParmColl.Add(CommonDB.AddSqlParm("@validexpression", validexpression, DbType.Boolean));
                return(SqlParmColl.ToArray());
            }
            catch (SQLiteException Exc)
            {
                throw Exc;
            }
        }
Exemplo n.º 3
0
        public override void Draw(BaseScreen.Resources screenResources, SmartSpriteBatch spriteBatch, ScreenAbstractor screen, float opacity, FloatRectangle?clip = null, Texture2D bgTexture = null, Vector2?scrollOffset = null)
        {
            string txt = Text.Value();

            if (!string.IsNullOrWhiteSpace(Symbol.Value()))
            {
                MDL2Symbols symbol = (MDL2Symbols)Enum.Parse(typeof(MDL2Symbols), Symbol.Value());
                txt = symbol.AsChar();
            }

            if (FontName.Value != null)
            {
                this.ActualSize = DrawFontAsset(spriteBatch, screen, opacity, txt, FontColor.Value(),
                                                ActualPosition, FontSize.Value(), LineHeight.Value(), FontName.Value(), PseudoAntiAlias.Value(), WordWrap.Value(),
                                                Justification.Value(), FontMargin.Value(), Margin.Value(), OutlineColor.Value(), Clip, bgTexture, scrollOffset, CaretPos.Value(),
                                                MultiLine.Value(), ScissorRect);
            }


            if (Position.Value.Height == 0)
            {
                autoSize = true;
            }

            if (autoSize)
            {
                this.Position.Value = new FloatRectangle(Position.Value.X, Position.Value.Y, Position.Value.Width, ActualSize.Y);
            }
        }
Exemplo n.º 4
0
 public void SetHeaderColor(string targetName, FontColor color)
 {
     if (StatusLists.TryGetValue(targetName, out var statusList))
     {
         statusList.SetHeaderColor(color);
     }
 }
Exemplo n.º 5
0
 public override BitmapBase Draw(Tank tank)
 {
     return(Ut.NewBitmapGdi(ParentStyle.IconWidth, ParentStyle.IconHeight, dc =>
     {
         string text = GetText(tank);
         if (!string.IsNullOrEmpty(Format) && (text != null))
         {
             if (isSeveralValue)
             {
                 string format = Format;
                 MatchCollection args = Regex.Matches(text, @"(\d+)");
                 foreach (Match match in Regex.Matches(Format, @"(\{\d+?\:?[\w\.]*\})"))
                 {
                     int numI;
                     string val = Regex.Match(match.Value, @"((?<=\{)\s*\d+\s*(?=[\:\}]))").Value;
                     if (int.TryParse(val, out numI) && (numI < args.Count))
                     {
                         format = format.Replace(match.Value, FormatText(match.Value.Replace(val, "0"), args[numI].Value));
                     }
                 }
                 text = format;
             }
             else
             {
                 text = FormatText(Format, text);
             }
         }
         var style = (FontBold ? FontStyle.Bold : 0) | (FontItalic ? FontStyle.Italic : 0);
         dc.TextRenderingHint = FontSmoothing.ToGdi();
         dc.DrawString(text, new SolidBrush(FontColor.GetColorGdi(tank)), FontFamily, FontSize, style, X, Y, Anchor,
                       Width <= 0 ? null : (int?)Width, Height <= 0 ? null : (int?)Height, Baseline);
     }));
 }
Exemplo n.º 6
0
        public override LayerBase Clone()
        {
            var result = (TextLayer)base.Clone();

            result.FontColor = FontColor.Clone();
            return(result);
        }
Exemplo n.º 7
0
        private SQLiteParameter[] GetSqlParameters()
        {
            List <SQLiteParameter> SqlParmColl = new List <SQLiteParameter>();

            try
            {
                SqlParmColl.Add(CommonDB.AddSqlParm("@ID", ID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DisplayID", DisplayID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@oIndex", oIndex, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Left", Left, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Right", Right, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Top", Top, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Bottom", Bottom, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ButtonText", ButtonText, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@BackColor", BackColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Font", Font, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@FontColor", FontColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@NavigateTo", NavigateTo, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@IsTransparent", IsTransparent, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@LastRev", LastRev, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@CompiledExp", CompiledExp, DbType.Binary));
                return(SqlParmColl.ToArray());
            }
            catch (SQLiteException Exc)
            {
                throw Exc;
            }
        }
Exemplo n.º 8
0
 public bool AppendPost(int postId, string text, FontColor color)
 {
     if (PostHistory.TryGetValue(postId, out string targetName))
     {
         if (StatusLists.TryGetValue(targetName, out var statusList))
         {
             if (statusList.AppendPost(postId, text, color))
             {
                 return(true);
             }
             //else
             //{
             //    Plugin.log?.Debug($"Failed to append PostId {postId} for {targetName} at AppendPost({postId}, {text}, {color})");
             //    var postIds = string.Join(", ", statusList.PostTexts.Select(l => l.PostId).ToList());
             //    Plugin.log?.Debug($"Valid PostIds: {postIds}");
             //}
         }
         //else
         //    Plugin.log?.Debug($"Failed to append PostId {postId} for {targetName} at StatusLists.TryGetValue({targetName})");
     }
     //else
     //    Plugin.log?.Debug($"Failed to append PostId {postId} at PostHistory.TryGetValue({postId})");
     PostHistory.TryRemove(postId, out var _); // Doesn't exist anymore, remove
     return(false);
 }
Exemplo n.º 9
0
        public void CreateImage()
        {
            if (FontTop == null || FontLeft == null || TxtFontSize == null)
            {
                return;
            }
            ImagePreview.Width  = Overlay.Width = PreviewCanvas.Width = WIDTH / FACTOR;
            ImagePreview.Height = Overlay.Height = PreviewCanvas.Height = HEIGHT / FACTOR;
            MainText.Text       = UserText.Text;
            MainText.FontSize   = TxtFontSize.Value / FACTOR;
            MainText.Margin     = new Windows.UI.Xaml.Thickness(FontLeft.Value / FACTOR, FontTop.Value / FACTOR, 0, 0);
            byte R = Convert.ToByte(FontColor.Substring(1, 2), 16);
            byte G = Convert.ToByte(FontColor.Substring(3, 2), 16);
            byte B = Convert.ToByte(FontColor.Substring(5, 2), 16);

            MainText.Foreground = new SolidColorBrush(Color.FromArgb(255, R, G, B));
            if (ImageUri.StartsWith("#"))
            {
                R                       = Convert.ToByte(ImageUri.Substring(1, 2), 16);
                G                       = Convert.ToByte(ImageUri.Substring(3, 2), 16);
                B                       = Convert.ToByte(ImageUri.Substring(5, 2), 16);
                Overlay.Fill            = new SolidColorBrush(Color.FromArgb(255, R, G, B));
                ImagePreview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                Overlay.Fill            = new SolidColorBrush(Color.FromArgb(68, 0, 0, 0));
                ImagePreview.Visibility = Windows.UI.Xaml.Visibility.Visible;
                ImagePreview.Source     = new BitmapImage(new Uri(ImageUri));
            }
        }
Exemplo n.º 10
0
 public Glyph(byte width, IList <byte> bytes)
 {
     Width  = width;
     Pixels = new FontColor[14 * 10];
     for (int i = 0; i < bytes.Count; i++)
     {
         CopyByteToPixels(bytes[i], Pixels, i * 4);
     }
 }
         public bool Equals(FontColor p)
         {
             if ((object)p == null)
             {
                 return false;
             }
 
             return (this.Name == p.Name) && (this.Brush.Equals(p.Brush));
         }
Exemplo n.º 12
0
 public Glyph( byte width, IList<byte> bytes )
 {
     Width = width;
     Pixels = new FontColor[14 * 10];
     for( int i = 0; i < bytes.Count; i++ )
     {
         CopyByteToPixels( bytes[i], Pixels, i * 4 );
     }
 }
Exemplo n.º 13
0
    public static string GetString(string key, FontColor fc = FontColor.White)
    {
        if (!DataManager.StringTable.ContainsKey(key))
        {
            return("");
        }
        StringTableItem item = DataManager.StringTable[key] as StringTableItem;

        return(fc == FontColor.White ? item.str : StringWithColor(fc, item.str));
    }
Exemplo n.º 14
0
 public void SetHeader(string targetName, string text, FontColor color)
 {
     if (StatusLists.TryGetValue(targetName, out var statusList))
     {
         statusList.Header = text;
         if (color != FontColor.None)
         {
             statusList.SetHeaderColor(color);
         }
     }
 }
Exemplo n.º 15
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            var label = VisualizerFactory.InstantiateLabelVisualizerPrefab();

            label.Initialize(this, payload);


            var meshRenderer = label.TextComponent.GetComponent <MeshRenderer>();

            var targetFont = FontFactory.GetFontPair(FontName.GetFirstValue(payload.Data));

            var newMaterial = FontFactory.GenerateNewSpatialMaterial(targetFont.FontTexture);

            label.TextComponent.font = targetFont.Font;

            label.TextComponent.fontSize  = Mathf.FloorToInt(FontSize.GetFirstValue(payload.Data) * targetFont.FontScale);
            label.transform.localPosition = new Vector3(0f, label.TextComponent.fontSize * targetFont.VerticalOffset, 0f);

            label.CharactersPerLine = CharactersPerLine.GetFirstValue(payload.Data);

            label.MaxLines = MaxLines.GetFirstValue(payload.Data);

            newMaterial.color = FontColor.GetFirstValue(payload.Data);

            meshRenderer.material = newMaterial;


            label.BackgroundPadding = BackgroundPadding.GetFirstValue(payload.Data);
            label.BackgroundDepth   = BackgroundDepth.GetFirstValue(payload.Data);

            label.LateralJustification = Justification.GetFirstValue(payload.Data);

            label.VerticalJustification = VerticalJustification.GetFirstValue(payload.Data);

            label.MinHeight = MinHeight.GetFirstValue(payload.Data);
            label.MaxHeight = MaxHeight.GetFirstValue(payload.Data);

            label.Orientation = Orientation.GetFirstValue(payload.Data);

            label.SetClickState(ClickState);

            label.RemoveBackground = !ShowBackground.GetFirstValue(payload.Data);

            label.Text = LabelText.GetFirstValue(payload.Data);

            var newPayload = new VisualPayload(payload.Data, new VisualDescription(label.Bound));

            var iterator = DefaultState.Transmit(newPayload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
        protected new void Initialize(CodeActivityContext context)
        {
            base.Initialize(context);

            bold      = Bold;
            italic    = Italic;
            underline = Underline;
            font      = Font.ToString();
            fontColor = FontColor.ToString();
            fontSize  = FontSize.Get(context);
            //if (fontSize == 0) fontSize = 5;
        }
Exemplo n.º 17
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (FontName != null ? FontName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FontSize;
         //hashCode = (hashCode * 397) ^ (int)TextStyle;
         hashCode = (hashCode * 397) ^ FontColor.GetHashCode();
         hashCode = (hashCode * 397) ^ (Aligment != null ? Aligment.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 18
0
    public static string GetErrorString(ERROR_CODE errorcode, FontColor fc = FontColor.White)
    {
        int code = (int)errorcode;

        if (!DataManager.ErrorCodeStringTable.ContainsKey(code))
        {
            return("");
        }
        ErrorStringTableItem item = DataManager.ErrorCodeStringTable[code] as ErrorStringTableItem;

        return(fc == FontColor.White ? item.str : StringWithColor(fc, item.str));
    }
Exemplo n.º 19
0
        public override void Draw(Graphics g)
        {
            if (!Border)
            {
                LineAlpha     = 0;
                LineThickness = 0;
            }

            PrivateFontCollection collection = new PrivateFontCollection();
            FontFamily            family     = new FontFamily(FontName);

            System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular;
            switch (FontStyle)
            {
            case "Bold":
                style = System.Drawing.FontStyle.Bold;
                break;

            case "Italic":
                style = System.Drawing.FontStyle.Italic;
                break;

            case "Underline":
                style = System.Drawing.FontStyle.Underline;
                break;

            case "Strikeout":
                style = System.Drawing.FontStyle.Strikeout;
                break;

            default:
                style = System.Drawing.FontStyle.Regular;
                break;
            }

            if (EmbeddedFont)
            {
                collection.AddFontFile(FontLocation);
                FontName = collection.Families[0].Name;
                family   = collection.Families[0];
            }

            base.Draw(g);

            if (WordWrap)
            {
                g.DrawString(Text, new Font(family, FontSize, style), new SolidBrush(FontColor.ToColor()), new RectangleF(X + LineThickness + Padding, Y + LineThickness + Padding, Width - Padding, Height - Padding), new StringFormat(Formatting));
            }
            else
            {
                g.DrawString(Text, new Font(family, FontSize, style), new SolidBrush(FontColor.ToColor()), X + LineThickness + Padding, Y + LineThickness + Padding);
            }
        }
Exemplo n.º 20
0
    void setCurTitle(int titleId)
    {
        TitleItemTableItem item = TitleModule.GetTitleItemById(titleId);

        if (item == null)
        {
            return;
        }

        UIAtlasHelper.SetSpriteImage(mIconSp, item.picName, true);

        mAttrisLb[0].text = item.detail1;
        mAttrisLb[1].text = item.detail2;
        mAttrisLb[2].text = item.detail3;
        mAttrisLb[3].text = item.detail4;

        mGradeLb.text = item.grade.ToString();

        PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (pdm == null)
        {
            return;
        }

        bool ishave = pdm.IsHasTitleByID(titleId);

        string detail = "";

        switch (item.contentId)
        {
        case 0:
            FontColor fc  = ishave ? FontColor.Green : FontColor.Red;
            string    tmp = StringHelper.StringWithColor(fc, pdm.GetLevel() + "/" + item.conditionVal);
            detail = string.Format(item.contentDetail, tmp);
            break;

        default:
            detail = item.contentDetail;
            break;
        }

        mConditionLb.text = detail;

        UISprite btnBg = mEquipBtn.GetComponent <UISprite>();

        if (btnBg != null)
        {
            UIAtlasHelper.SetSpriteShaderGrey(btnBg, !ishave);
        }

        mEquipBtnLb.text = pdm.GetCurTitle() == titleId ? "卸下" : "穿戴";
    }
Exemplo n.º 21
0
 public override int GetHashCode()
 {
     return(Bold.GetHashCode()
            ^ Italic.GetHashCode()
            ^ (Int32)Underline
            ^ Strikethrough.GetHashCode()
            ^ (Int32)VerticalAlignment
            ^ Shadow.GetHashCode()
            ^ FontSize.GetHashCode()
            ^ FontColor.GetHashCode()
            ^ FontName.GetHashCode()
            ^ (Int32)FontFamilyNumbering);
 }
         public override bool Equals(System.Object obj)
         {
             if (obj == null)
             {
                 return false;
             }
 
             FontColor p = obj as FontColor;
             if ((System.Object)p == null)
             {
                 return false;
             }
 
             return (this.Name == p.Name) && (this.Brush.Equals(p.Brush));
         }
Exemplo n.º 23
0
 public bool ReplacePost(int postId, string text, FontColor color)
 {
     if (PostHistory.TryGetValue(postId, out string targetName))
     {
         if (StatusLists.TryGetValue(targetName, out var statusList))
         {
             if (statusList.ReplacePost(postId, text, color))
             {
                 return(true);
             }
         }
     }
     PostHistory.TryRemove(postId, out var _); // Doesn't exist anymore, remove
     return(false);
 }
Exemplo n.º 24
0
        private void DrawCharacter(Character character, Vector3 origin, float w, float h, float kerning, TextInfo info)
        {
            var cw = character.Bounds.Width;
            var ch = character.Bounds.Height;
            var cu = character.Bounds.Left;
            var cv = character.Bounds.Top;

            // CCW from top left
            var a = new Vector2(origin.X + kerning, origin.Y);
            var b = new Vector2(origin.X + kerning, origin.Y + ch);
            var c = new Vector2(origin.X + cw + kerning, origin.Y);
            var d = new Vector2(origin.X + cw + kerning, origin.Y + ch);

            var uv_a = new Vector2(cu / w, cv / h);
            var uv_b = new Vector2(cu / w, (cv + ch) / h);
            var uv_c = new Vector2((cu + cw) / w, cv / h);
            var uv_d = new Vector2((cu + cw) / w, (cv + ch) / h);

            Positions.Add(info.Origin);
            Positions.Add(info.Origin);
            Positions.Add(info.Origin);
            Positions.Add(info.Origin);
            Positions.Add(info.Origin);
            Positions.Add(info.Origin);

            var color = FontColor.ToColor4();

            Colors.Add(color);
            Colors.Add(color);
            Colors.Add(color);
            Colors.Add(color);
            Colors.Add(color);
            Colors.Add(color);

            TextureCoordinates.Add(uv_b);
            TextureCoordinates.Add(uv_d);
            TextureCoordinates.Add(uv_a);
            TextureCoordinates.Add(uv_a);
            TextureCoordinates.Add(uv_d);
            TextureCoordinates.Add(uv_c);

            info.Offsets.Add(a);
            info.Offsets.Add(c);
            info.Offsets.Add(b);
            info.Offsets.Add(b);
            info.Offsets.Add(c);
            info.Offsets.Add(d);
        }
Exemplo n.º 25
0
        private void SetFontColor(eFloatFontType type)
        {
            for (var i = 0; i < FontColorConfig.Count; i++)
            {
                FontColor color = FontColorConfig[i];
                if (color.textType == type)
                {
                    FontLabel.gradientTop    = color.topColor;
                    FontLabel.gradientBottom = color.bottomColor;
                    FontLabel.effectColor    = color.outlineColor;
                    FontLabel.fontSize       = color.fontSize;

                    break;
                }
            }
        }
Exemplo n.º 26
0
        public void SetFontColor(FontColor color)
        {
            switch (color)
            {
            case FontColor.Black:
                _valueText.Font = Resource.getPaletteFont();
                break;

            case FontColor.Red:
                _valueText.Font = Resource.getFontRed();
                break;

            default:
                break;
            }
        }
Exemplo n.º 27
0
 public Boolean Equals(IXLRichString other)
 {
     return
         (Text == other.Text &&
          Bold.Equals(other.Bold) &&
          Italic.Equals(other.Italic) &&
          Underline.Equals(other.Underline) &&
          Strikethrough.Equals(other.Strikethrough) &&
          VerticalAlignment.Equals(other.VerticalAlignment) &&
          Shadow.Equals(other.Shadow) &&
          FontSize.Equals(other.FontSize) &&
          FontColor.Equals(other.FontColor) &&
          FontName.Equals(other.FontName) &&
          FontFamilyNumbering.Equals(other.FontFamilyNumbering)
         );
 }
Exemplo n.º 28
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>
 /// A 32-bit signed integer that is the hash code for this instance.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Text?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DropShadow.GetHashCode();
         hashCode = (hashCode * 397) ^ (FontFamily?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)Style;
         hashCode = (hashCode * 397) ^ FontColor.GetHashCode();
         hashCode = (hashCode * 397) ^ Opacity;
         hashCode = (hashCode * 397) ^ FontSize;
         hashCode = (hashCode * 397) ^ Position.GetHashCode();
         hashCode = (hashCode * 397) ^ Vertical.GetHashCode();
         hashCode = (hashCode * 397) ^ RightToLeft.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 29
0
        public override int GetHashCode()
        {
            var hashCode = 1158783753;

            hashCode = hashCode * -1521134295 + Bold.GetHashCode();
            hashCode = hashCode * -1521134295 + Italic.GetHashCode();
            hashCode = hashCode * -1521134295 + Underline.GetHashCode();
            hashCode = hashCode * -1521134295 + Strikethrough.GetHashCode();
            hashCode = hashCode * -1521134295 + VerticalAlignment.GetHashCode();
            hashCode = hashCode * -1521134295 + Shadow.GetHashCode();
            hashCode = hashCode * -1521134295 + FontSize.GetHashCode();
            hashCode = hashCode * -1521134295 + FontColor.GetHashCode();
            hashCode = hashCode * -1521134295 + StringComparer.InvariantCultureIgnoreCase.GetHashCode(FontName);
            hashCode = hashCode * -1521134295 + FontFamilyNumbering.GetHashCode();
            hashCode = hashCode * -1521134295 + FontCharSet.GetHashCode();
            return(hashCode);
        }
Exemplo n.º 30
0
    public static string StringWithColor(FontColor color, string text)
    {
        string head = "";

        switch (color)
        {
        case FontColor.GreenLight:     // 浅绿;
            head = "[79ffdb]";
            break;

        case FontColor.White:          // 白色;
            head = "[fafdf4]";
            break;

        case FontColor.Yellow:         // 黄色;
            head = "[fed514]";
            break;

        case FontColor.Gray:           // 灰色;
            head = "[d3c0aa]";
            break;

        case FontColor.GreenMid:       // 中绿;
            head = "[81ffa5]";
            break;

        case FontColor.Blue:          // 蓝色;
            head = "[2a96c9]";
            break;

        case FontColor.Pink:           // 粉色;
            head = "[ff6bef]";
            break;

        case FontColor.Red:           // 红色;
            head = "[e92224]";
            break;

        case FontColor.Green:         // 绿色;
            head = "[3eff00]";
            break;
        }

        return(head + text + "[-]");
    }
Exemplo n.º 31
0
 private static void ProcessFontColor(FontColor fc, XmlWriter xmlw)
 {
     xmlw.WriteStartElement("FontColor");
     xmlw.WriteAttributeString("Color", fc.Color.ToStringSafe());
     xmlw.WriteAttributeString("Bold", fc.Font.Bold.ToStringSafe());
     xmlw.WriteAttributeString("Charset", fc.Font.Charset.ToStringSafe());
     xmlw.WriteAttributeString("Italic", fc.Font.Italic.ToStringSafe());
     xmlw.WriteAttributeString("Name", fc.Font.Name);
     xmlw.WriteAttributeString("Size", fc.Font.Size.ToStringSafe());
     xmlw.WriteAttributeString("Strikethrough", fc.Font.Strikethrough.ToStringSafe());
     xmlw.WriteAttributeString("Underline", fc.Font.Underline.ToStringSafe());
     xmlw.WriteAttributeString("Weight", fc.Font.Weight.ToStringSafe());
     xmlw.WriteAttributeString("ColorFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeColor].Text);
     xmlw.WriteAttributeString("NameFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeName].Text);
     xmlw.WriteAttributeString("SizeFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeSize].Text);
     xmlw.WriteAttributeString("StrikeoutFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeStrikeout].Text);
     xmlw.WriteAttributeString("StyleFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeStyle].Text);
     xmlw.WriteAttributeString("UnderlineFormula", fc.ConditionFormulas[CrFontColorConditionFormulaTypeEnum.crFontColorConditionFormulaTypeUnderline].Text);
     xmlw.WriteEndElement();
 }
Exemplo n.º 32
0
        public void LoadContent(ContentManager Content, FontColor color)
        {
            Text = "";

            string fontColor = "GameFont";

            if (color == FontColor.Yellow)
                fontColor += "Yellow";

            texture = Content.Load<Texture2D>("Data\\GFX\\" + fontColor);
            if (!FontManager.IsInitialized)
                FontManager.LoadContent();
        }
Exemplo n.º 33
0
 private void RedrawPixel( int col, int row, FontColor color, Graphics g )
 {
     g.FillRectangle( colors[color], new Rectangle( col * 15, row * 15, 15, 15 ) );
 }
Exemplo n.º 34
0
 private void CopyByteToPixels( byte b, FontColor[] destination, int index )
 {
     destination[index] = (FontColor)((b & 0xC0) >> 6);
     destination[index + 1] = (FontColor)((b & 0x30) >> 4);
     destination[index + 2] = (FontColor)((b & 0x0C) >> 2);
     destination[index + 3] = (FontColor)(b & 0x03);
 }
Exemplo n.º 35
0
 private byte CopyPixelsToByte( FontColor[] source, int index )
 {
     byte result = 0;
     result |= (byte)(((int)source[index]) << 6);
     result |= (byte)(((int)source[index+1]) << 4);
     result |= (byte)(((int)source[index+2]) << 2);
     result |= (byte)((int)source[index+3]);
     return result;
 }
Exemplo n.º 36
0
 /// <summary>
 /// 撰写一行屏幕信息
 /// </summary>
 /// <param name='lableName'>
 /// 信息名称
 /// </param>
 /// <param name='Info'>
 /// 信息内容
 /// </param>
 /// <param name='color'>
 /// 字体颜色
 /// </param>
 public void WriteLine(string lableName,string Info,FontColor color)
 {
     bool isNew = true;
     foreach(KeyValuePair<string,InfoLab> item in infoList)
     {
         if(item.Key == lableName)
         {
             isNew = false;
             item.Value.Text = Info;
             item.Value.UpdateTime = TotleTime;
             break;
         }
     }
     if(isNew)
     {
         infoList.Add(new KeyValuePair<string,InfoLab>(lableName,new InfoLab(GameUI.Instance,font,TotleTime,color)));
         infoList[infoList.Count - 1].Value.Text = Info;
         infoList[infoList.Count - 1].Value.UpdateTime = TotleTime;
     }
 }
Exemplo n.º 37
0
 public InfoLab(Scene scene,Font infoFont,float UpdateTime,FontColor color)
 {
     this.UpdateTime = UpdateTime;
     this.Font = infoFont;
     this.X = 5;
     switch(color)
     {
     case FontColor.Yellow:
         this.TextColor = new UIColor(1.0f,0.843f,0.0f,1.0f);
         break;
     case FontColor.Red:
         this.TextColor = new UIColor(1.0f,0f,0f,1.0f);
         break;
     case FontColor.Black:
         this.TextColor = new UIColor(0f,0f,0f,1.0f);
         break;
     case FontColor.Blue:
         this.TextColor = new UIColor(0.392f,0.584f,0.929f,1.0f);
         break;
     case FontColor.White:
         this.TextColor = new UIColor(1f,1f,1f,1.0f);
         break;
     case FontColor.Green:
         this.TextColor = new UIColor(0.196f,0.803f,0.196f,1.0f);
         break;
     case FontColor.Pink:
         this.TextColor = new UIColor(1.0f,0.682f,0.725f,1.0f);
         break;
     }
     scene.RootWidget.AddChildLast(this);
 }