Ejemplo n.º 1
0
        public bool LoadFromJson(JsonParser.ObjectValue jsonOb)
        {
            bool hasLoaded = false;

            try
            {
                HasDescriptionOverride = (JsonParser.BoolValue)jsonOb["hasName"];
                Description            = jsonOb["name"];

                string colorHex = "0x" + jsonOb["color"];
                Color  color    = Color.FromArgb(Convert.ToInt32(colorHex, 16));
                Pen = new Pen(color);

                Mode = (GameData.OverlaySettings.DisplayMode)((JsonParser.IntValue)jsonOb["mode"]).IntNumber;

                UseMatchType = (JsonParser.BoolValue)jsonOb["hasType"];
                MatchType    = UseMatchType ? (MemoryLayout.ActorType)((JsonParser.IntValue)jsonOb["matchType"]).IntNumber : 0;

                UseMatchNpcId = (JsonParser.BoolValue)jsonOb["hasNpcId"];
                MatchNpcId    = UseMatchNpcId ? (uint)((JsonParser.IntValue)jsonOb["matchNpcId"]).IntNumber : 0;

                hasLoaded = true;
            }
            catch (Exception ex)
            {
                Logger.WriteLine("Failed to load filter '" + jsonOb + "', exception:" + ex);
            }

            return(hasLoaded);
        }
Ejemplo n.º 2
0
 public ActorFilter()
 {
     HasDescriptionOverride = false;
     Pen  = Pens.Red;
     Mode = GameData.OverlaySettings.DisplayMode.WhenClose;
 }