internal void Add(TLVBase tlvModel, object item) { if (!List.Contains(item)) { if (item is FolderModel folder) { folder.Parent = this; } else if (item is AbilityModel _item) { _item.Parent = this; } List.Add(item); tlvModel.TLV.UpdateObjects(tlvModel.MasterList); } else { if (item is FolderModel folder) { Wc3Engine.DebugMsg("[LTVAbilityModel] error: Warning this object allready exist in folder: Folder: " + Name + " Object: " + folder.Name); } else if (item is AbilityModel _item) { Wc3Engine.DebugMsg("[LTVAbilityModel] error: Warning this object allready exist in folder: Folder: " + Name + " Object: " + _item.Name); } } }
internal FolderModel(TLVBase tlvModel, string folderPath) { if (folderPath.Contains(@"\")) { Name = folderPath.After(@"\"); } else { Name = folderPath; tlvModel.MasterList.Add(this); tlvModel.TLV.UpdateObjects(tlvModel.MasterList); } Path = folderPath; List = new List <object>(); tlvModel.FolderMasterList.Add(this); if (folderPath.Before(@"\" + Name) != "") { string parentFolder = folderPath.Before(@"\" + Name); if (!Exist(tlvModel, parentFolder)) { new FolderModel(tlvModel, parentFolder).Add(tlvModel, this); } else { Find(tlvModel, parentFolder).Add(tlvModel, this); } } }
internal AbilityModel(TLVBase tlvModel, string itemPath, Image image, int abilityId) { if (itemPath.Contains(@"\")) { Name = itemPath.After(@"\"); if (!FolderModel.Exist(tlvModel, itemPath.Replace(@"\" + Name, null))) { new FolderModel(tlvModel, itemPath.Replace(@"\" + Name, null)).Add(tlvModel, this); } else { FolderModel.Find(tlvModel, itemPath.Replace(@"\" + Name, null)).Add(tlvModel, this); } } else { Name = itemPath; tlvModel.MasterList.Add(this); tlvModel.TLV.UpdateObjects(tlvModel.MasterList); } Path = itemPath; tlvModel.AbilityMasterList.Add(this); Id = abilityId; Name = "(" + Id.ToObjectId() + ") " + Name; if (null != image && !tlvModel.TLV.SmallImageList.Images.ContainsKey(itemPath)) { ImageKey = itemPath; tlvModel.TLV.SmallImageList.Images.Add(ImageKey, image); } }
internal void ChangeIcon(TLVBase tlvModel, Image image) { if (null == image) { ImageKey = null; } else { tlvModel.TLV.SmallImageList.Images.RemoveByKey(ImageKey); tlvModel.TLV.SmallImageList.Images.Add(Path, image); } }
public Wc3Engine() { This = this; InitializeComponent(); PrintWc3Version(); CreateAssetsListView(); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); JassScript.Load(); //GUIModule.Init(); StandarAbilitiesTab = new TLVBase(LTVStadarAbilities, name_olvColumn2, false); CustomAbilitiesTab = new TLVBase(LTVCustomAbilities, name_olvColumn, true); Ability.TLVStandard = StandarAbilitiesTab; Ability.TLVCustom = CustomAbilitiesTab; DataVisualizer.mainPanel = GUIHelper_tableLayout; /*DataVisualizer visualizer = new DataVisualizer("Test 1", 3); * visualizer = new DataVisualizer("Test 2", 5); * visualizer = new DataVisualizer("Test 3", 10); * //visualizer.Visible = false;*/ List <string> test = new List <string> { "trigger edge", "wtf!", "test", }; string test2 = "trigger e2"; if (test.Exists(x => x.Contains(test2))) { DebugMsg("funciona!"); } mainTabControl.SelectedTab = mapInfoTab; abilities_tabControl.SelectedTab = custom_tabPage; if (Settings.LoadLastMap && Settings.LastMap != "") { Map.Read(Settings.LastMap); } else { Map.SetPreview(Properties.Resources.Minimap_Unknown); } }
public Wc3Engine() { This = this; InitializeComponent(); PrintWc3Version(); CreateAssetsListView(); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); JassScript.Load(); //GUIModule.Init(); StandarAbilitiesTab = new TLVBase(LTVStadarAbilities, name_olvColumn2, false); CustomAbilitiesTab = new TLVBase(LTVCustomAbilities, name_olvColumn, true); Ability.TLVStandard = StandarAbilitiesTab; Ability.TLVCustom = CustomAbilitiesTab; DataVisualizer.panel = GUIHelper_tableLayout; //GUIHelper_accordion.Add(missileBasics_panel, "Missile Handle", "", 1, true); DataVisualizer visualizer = new DataVisualizer("Test 1", 3); visualizer = new DataVisualizer("Test 2", 5); visualizer = new DataVisualizer("Test 3", 10); //visualizer.Visible = false; mainTabControl.SelectedTab = mapInfoTab; abilities_tabControl.SelectedTab = custom_tabPage; if (Settings.LoadLastMap && Settings.LastMap != "") { Map.Read(Settings.LastMap); } else { Map.SetPreview(Properties.Resources.Minimap_Unknown); } }
internal static void Add(TLVBase tlvModel, string path, object item) { Find(tlvModel, path).Add(tlvModel, item); }
internal static bool Exist(TLVBase tlvModel, string path) { return(tlvModel.FolderMasterList.Exists(x => x.Path == path)); }
internal static FolderModel Find(TLVBase tlvModel, string path) { return(tlvModel.FolderMasterList.Find(x => x.Path == path)); }
internal static void ChangeIcon(TLVBase tlvModel, string itemPath, Image image) { Find(tlvModel, itemPath).ChangeIcon(tlvModel, image); }
internal static bool Exist(TLVBase tlvModel, string itemPath) { return(tlvModel.AbilityMasterList.Exists(x => x.Path == itemPath)); }
internal static AbilityModel Find(TLVBase tlvModel, string path) { return(tlvModel.AbilityMasterList.Find(x => x.Path == path)); }