Exemple #1
0
        void MainForm_Load(object sender, EventArgs e)
        {
            LoadItems();
            NpcWordList.Load();

            map = new OtMap(otItems);
            map.Descriptions.Add("Created with SharpMapTracker v" + Constants.MAP_TRACKER_VERSION);

            npcs = new Dictionary <string, NpcInfo>();

            miniMap.Map = map;

            mapShare = new MapShare();
            mapShare.Start();
        }
        public void AddStatement(string key, string value)
        {
            key   = key.ToLower().Trim().Replace("'", "\\'");
            value = value.Replace("'", "\\'");

            NpcWordList.AddWord(key);
            if (!statements.ContainsKey(key))
            {
                if (key.EndsWith("s"))
                {
                    var otherKey = key.Substring(0, key.Length - 1);
                    if (statements.ContainsKey(otherKey) && statements[otherKey] == value)
                    {
                        return;
                    }
                }
                else
                {
                    var otherKey = key + "s";
                    if (statements.ContainsKey(otherKey) && statements[otherKey] == value)
                    {
                        statements.Remove(otherKey);
                        statements[key] = value;
                        return;
                    }
                }

                statements[key] = value;

                var matches = Regex.Matches(value, @"{([\w'\s]+)}");

                foreach (Match match in matches)
                {
                    NpcWordList.AddWord(match.Groups[1].Value);
                }
            }
        }
Exemple #3
0
 void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Client = null;
     mapShare.Stop();
     NpcWordList.Save();
 }