void OnAllLevelsLoad_Normal(Level sender, LevelLoadEventArgs args)
 {
     if (sender.ExtraData["MessageBlock"] == null || sender.ExtraData["MessageBlock"].GetType() != typeof(string))
     {
         store[sender.Name] = new List <string>();
     }
     else
     {
         string[]      split = ((string)sender.ExtraData["MessageBlock"]).Split(';');
         List <string> tmp   = new List <string>();
         for (int i = 0; i < split.Length; i++)
         {
             try {
                 Vector3S v = new Vector3S();
                 v.FromHexString(split[i]);
                 if (sender.ExtraData["MessageBlock" + v] != null)
                 {
                     tmp.Add(v);
                 }
             }
             catch { }
         }
         store[sender.Name] = tmp;
     }
 }
        void OnAllLevelsUnload_Normal(Level sender, LevelLoadEventArgs args)
        {
            List <string> tmp = store[sender.Name];

            if (tmp != null)
            {
                string join = "";
                for (int i = 0; i < tmp.Count; i++)
                {
                    if (sender.ExtraData["MessageBlock" + tmp[i]] != null && sender.ExtraData["MessageBlock" + tmp[i]].GetType() == typeof(string) && !String.IsNullOrWhiteSpace((string)sender.ExtraData["MessageBlock" + tmp[i]]))
                    {
                        join += tmp[i].ToHexString() + ";";
                    }
                }
                if (join.EndsWith(";"))
                {
                    sender.ExtraData["MessageBlock"] = join.Substring(0, join.Length - 1);
                }
                else if (!String.IsNullOrEmpty(join))
                {
                    sender.ExtraData["MessageBlock"] = join;
                }
                store[sender.Name] = null;
            }
        }
 void OnLevelLoad(Level l, LevelLoadEventArgs args)
 {
     //The level loaded does not have a texture file, create it. TODO: Test
     if (CFGDict.GetIfExist<Level, CFGSettings>(l) == null)
     {
         CFGSettings s = new CFGSettings(l);
         CFGDict.CreateIfNotExist<Level, CFGSettings>(l, s);
     }
 }
 void OnLevelLoad(Level l, LevelLoadEventArgs args)
 {
     //The level loaded does not have a texture file, create it. TODO: Test
     if (CFGDict.GetIfExist <Level, CFGSettings>(l) == null)
     {
         CFGSettings s = new CFGSettings(l);
         CFGDict.CreateIfNotExist <Level, CFGSettings>(l, s);
     }
 }
Exemplo n.º 5
0
 void OnAllLevelsLoad_Normal(Level sender, LevelLoadEventArgs args) {
     if (sender.ExtraData["MessageBlock"] == null || sender.ExtraData["MessageBlock"].GetType() != typeof(string)) {
         store[sender.Name] = new List<string>();
     }
     else {
         string[] split = ((string)sender.ExtraData["MessageBlock"]).Split(';');
         List<string> tmp = new List<string>();
         for (int i = 0; i < split.Length; i++) {
             try {
                 Vector3S v = new Vector3S();
                 v.FromHexString(split[i]);
                 if (sender.ExtraData["MessageBlock" + v] != null)
                     tmp.Add(v);
             }
             catch { }
         }
         store[sender.Name] = tmp;
     }
 }
Exemplo n.º 6
0
 void OnAllLevelsUnload_Normal(Level sender, LevelLoadEventArgs args) {
     List<string> tmp = store[sender.Name];
     if (tmp != null) {
         string join = "";
         for (int i = 0; i < tmp.Count; i++) {
             if (sender.ExtraData["MessageBlock" + tmp[i]] != null && sender.ExtraData["MessageBlock" + tmp[i]].GetType() == typeof(string) && !String.IsNullOrWhiteSpace((string)sender.ExtraData["MessageBlock" + tmp[i]]))
                 join += tmp[i].ToHexString() + ";";
         }
         if (join.EndsWith(";")) {
             sender.ExtraData["MessageBlock"] = join.Substring(0, join.Length - 1);
         }
         else if (!String.IsNullOrEmpty(join)) sender.ExtraData["MessageBlock"] = join;
         store[sender.Name] = null;
     }
 }