diff --git a/.gitignore b/.gitignore
index c0b2fb77..ef7d8e9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -179,3 +179,5 @@ FakesAssemblies/
#Ignore '.vs' directory
.vs/
+
+*.driveupload*
diff --git a/Documentation/Languages/enUS.xaml b/Documentation/Languages/enUS.xaml
index 25ba45d9..6af59e54 100644
--- a/Documentation/Languages/enUS.xaml
+++ b/Documentation/Languages/enUS.xaml
@@ -51,14 +51,18 @@
Cast Time:
Duration:
Range:
- Caster Aura State:
Spell Level:
Base Level:
Max Level:
Spell Visual 1:
Spell Visual 2:
Speed:
+
+ Caster Aura State:
Target Aura State:
+ Caster Aura State Not:
+ Target Aura State Not:
+
Recovery Time:
Category Recovery Time:
Spell Missile ID:
@@ -84,6 +88,15 @@
Prevention Type:
Spell Damage Type:
Requires Spell Focus:
+
+ Caster Aura Spell:
+ Target Aura Spell:
+ Caster Aura Spell Not:
+ Target Aura Spell Not:
+
+ Stance Bar Order:
+ Power Display Id:
+
Rune Cost:
Spell Description Variables:
Spell Priority:
@@ -161,11 +174,19 @@
Attributes Ex6:
Attributes Ex7:
Creature Type:
- Stances:
+
+ Required Stances:
+ Not Castable In Stances:
+
Current Icon:
+ Active Icon:
+
New Icon:
Filter icons:
- Confirm
+
+ Save Spell Icon
+ Save Active Icon
+
Controls icon width & height (pixels)
Import/Export
Drop Tables
@@ -175,10 +196,19 @@
Import
Export
Import and Export
- Log Book
+ Log Book
Config
Configuration Editor
Multilingual
+
+ Copy Effect
+ Paste Effect
+ Clear Effect
+ Reset Effect
+ Clone Effect 1
+ Clone Effect 2
+ Clone Effect 3
+
@@ -205,14 +235,16 @@
Are you sure you want to exit?
Make sure you have saved before doing this action or all progress will be lost!
ARE YOU SURE?
This will drop all SQL tables used by this program and create them again allowing you to start over.
This feature should only be used when you want to reset the tables and import new DBC files.
- Copy an existing record?
- Input the spell ID to copy from.
- ERROR: Input spell ID was not an integer.
- Input the new spell ID.
- ERROR: Input spell ID was not an integer.
+ Copy an existing record
+ Input the spell ID to copy from:
+ ERROR: The copied spell ID was not an integer or it doesn't exist.
+ Input the new spell ID:
+ ERROR: The new spell ID was not an integer.
ERROR: That spell ID is already taken.
- Creating a new spell from scratch is currently not implemented. Please copy an existing spell.
- "Created new record with ID {0} sucessfully.
+ Use first available ID
+ Input how many copies:
+ ERROR: The amount of copies was not an integer or it was an invalid amount.
+ Created {0} new record(s) starting at ID {1} sucessfully.
Input the spell ID to delete.
ERROR: Input spell ID was not an integer.
Deleted record successfully.
@@ -663,7 +695,7 @@
None |
Defense |
- Healthless 20 Percent |
+ Healthless 20% |
Berserking |
Frozen |
Judgement |
@@ -674,7 +706,7 @@
Warrior Victory Rush |
Unknown11 |
Faerie Fire |
- Healthless 35 Percent |
+ Healthless 35% |
Conflagrate |
Swiftmend |
Deadly Poison |
@@ -684,7 +716,7 @@
Unknown20 |
Unknown21 |
Unknown22 |
- Health Above 75 Percent
+ Health Above 75%
Non-Equip |
diff --git a/Documentation/Languages/frFR.xaml b/Documentation/Languages/frFR.xaml
index 503e5864..95b7301e 100644
--- a/Documentation/Languages/frFR.xaml
+++ b/Documentation/Languages/frFR.xaml
@@ -51,14 +51,18 @@
Temps d'incantation :
Durée :
Portée :
- Statut du lanceur :
Niveau du sort :
Niveau de base du sort :
Niveau Max :
Visuel 1 :
Visuel 2 :
Vélocité :
+
Statut de la cible :
+ Statut du lanceur :
+ Statut du lanceur non :
+ Statut de la cible non :
+
Temps de recharge :
Temps de recharge de la catégorie :
ID du Missile:
@@ -84,6 +88,15 @@
Type de prévention :
Type de dégâts :
Requiert le Focus :
+
+ Sort d’aura du lanceur :
+ Sort d’aura de la cible :
+ Sort d’aura du lanceur Exclure:
+ Sort d’aura de la cible Exclure:
+
+ Ordre de la barre de posture :
+ ID d’affichage de la ressource :
+
Coût runique:
Variables de la description :
Spell Priority:
@@ -161,11 +174,19 @@
Attributs Ex6 :
Attributs Ex7 :
Type de créature :
- Postures :
+
+ Postures requises :
+ Incantation impossible dans ces postures :
+
Icône actuelle :
+ Icône d’action:
+
Nouvelle icône :
Filtre d'icônes :
- Confirmer
+
+ Sauver icône sort
+ Sauver icône action
+
Contrôle la largeur & la hauteur de l'icône (en pixels)
Importer/Exporter
Table tronquée
@@ -177,6 +198,16 @@
Importer et exporter
Log Book
Multilingue
+
+ Copier l’effet
+ Coller l’effet
+ Effacer l’effet
+ Réinitialiser l’effet
+ Cloner l’effet 1
+ Cloner l’effet 2
+ Cloner l’effet 3
+
+
@@ -205,14 +236,17 @@
Êtes-vous sûr de vouloir quitter?
Assurez-vous d’avoir enregistré avant d’effectuer cette action, sinon tout votre progrès sera perdu !
ÊTES-VOUS SÛR ?
This will drop all SQL tables used by this program and create them again allowing you to start over.
This feature should only be used when you want to reset the tables and import new DBC files.
- Copier d'un sort existant ?
- Entrez l'identifiant du sort pour copier.
- ERREUR: L'identifiant du sort saisi n'était pas un entier.
- Entrez le nouvel identifiant du sort.
- ERREUR: L'identifiant du sort saisi n'était pas un entier.
- ERREUR: cet identifiant est déjà pris.
- La création d'un nouveau sort à partir de rien n'est actuellement pas implémentée. Veuillez copier un sort existant.
- Nouveau sort créé avec succès sous l’ID {0}.
+ Copier un enregistrement existant
+ Entrez l’ID du sort à copier :
+ ERREUR: L’ID du sort copié n’était pas un entier ou n’existe pas.
+ Entrez le nouvel ID du sort :
+ ERREUR: Le nouvel ID du sort n’était pas un entier.
+ ERREUR: Cet ID de sort est déjà utilisé.
+ Utiliser le premier ID disponible
+ Entrez le nombre de copies :
+ ERREUR: Le nombre de copies n’était pas un entier ou était invalide.
+ Création de {0} nouvel(s) enregistrement(s) à partir de l’ID {1} réussie.
+
Entrez l'identifiant du sort à supprimer.
ERREUR: L'identifiant du sort saisi n'était pas un entier.
Sort supprimé avec succès.
@@ -661,30 +695,30 @@
Nuage de gaz
- None |
- Defense |
- Healthless 20 Percent |
- Berserking |
- Frozen |
- Judgement |
- Unknown6 |
- Hunter Parry |
- Unknown8 |
- Unknown9 |
- Warrior Victory Rush |
- Unknown11 |
- Faerie Fire |
- Healthless 35 Percent |
- Conflagrate |
- Swiftmend |
- Deadly Poison |
- Enrage |
- Bleeding |
- Parry |
- Unknown20 |
- Unknown21 |
- Unknown22 |
- Health Above 75 Percent
+ Aucun |
+ Défense |
+ Vie inférieure à 20% |
+ Furie berserker |
+ Gelé |
+ Jugement |
+ Inconnu 6 |
+ Parade du chasseur |
+ Inconnu 8 |
+ Inconnu 9 |
+ Ruée victorieuse du guerrier |
+ Inconnu 11 |
+ Lucioles |
+ Vie inférieure à 35% |
+ Conflagration |
+ Rétablissement rapide |
+ Poison mortel |
+ Enrager |
+ Saignement |
+ Parade |
+ Inconnu 20 |
+ Inconnu 21 |
+ Inconnu 22 |
+ Vie supérieure à 75%
Non-équipé |
diff --git a/Documentation/Languages/zhCN.xaml b/Documentation/Languages/zhCN.xaml
index 5b442d06..1f20ba52 100644
--- a/Documentation/Languages/zhCN.xaml
+++ b/Documentation/Languages/zhCN.xaml
@@ -50,15 +50,19 @@
机制类型:
施法时间:
持续时间:
- 施法距离:
- 施法者光环状态:
+ 施法距离:
法术等级:
基础等级:
最大等级:
法术视觉效果A:
法术视觉效果B:
光效飞行速度(?):
+
+ 施法者光环状态:
目标光环状态:
+ 施法者光环状态(非):
+ 目标光环状态(非):
+
冷却时间:
类型冷却时间:
法术弹道ID(?):
@@ -84,6 +88,15 @@
沉默类型:
法术伤害类型:
施法需要对象(区域):
+
+ 施法者光环法术:
+ 目标光环法术:
+ 排除施法者光环法术:
+ 排除目标光环法术:
+
+ 姿态栏顺序:
+ 能量显示ID:
+
符文消耗:
法术变量详细描述:
Spell Priority:
@@ -161,11 +174,19 @@
属性 Ex6:
属性 Ex7:
生物类型:
- 姿态:
+
+ 需要的姿态:
+ 无法在这些姿态下施放:
+
当前图标:
+ 动作图标:
+
新图标:
过滤图标:
- 确认
+
+ 保存法术图标
+ 保存动作图标
+
控制图标的宽度和高度(像素)
导入/导出
清空表格
@@ -177,6 +198,16 @@
导入和导出
Log Book
多语言
+
+ 复制效果
+ 粘贴效果
+ 清除效果
+ 重置效果
+ 克隆效果 1
+ 克隆效果 2
+ 克隆效果 3
+
+
@@ -205,14 +236,17 @@
您确定要退出吗?
请确保在执行此操作之前已保存,否则将丢失所有进度!
您确定要清空表格吗?
This will drop all SQL tables used by this program and create them again allowing you to start over.
This feature should only be used when you want to reset the tables and import new DBC files.
- 复制现有记录?
- 输入要复制的法术ID。
- 错误:输入的法术ID不是整数。
- 输入新的法术ID。
- 错误:输入的法术ID不是整数。
- 错误:该法术ID已经存在。
- 从头开始创建一个新法术目前还没有实现。请复制现有的法术。
- "成功创建ID为{0}的新法术。
+ 复制现有记录
+ 请输入要复制的法术 ID:
+ 错误:被复制的法术 ID 不是整数或不存在。
+ 请输入新的法术 ID:
+ 错误:新的法术 ID 不是整数。
+ 错误:该法术 ID 已被占用。
+ 使用第一个可用的 ID
+ 请输入复制数量:
+ 错误:复制数量不是整数或数量无效。
+ 成功创建 {0} 条新记录,起始 ID 为 {1}。
+
输入要删除的法术ID。
错误:输入的法术ID不是整数。
成功删除法术。
@@ -661,30 +695,30 @@
Gas Cloud
- None |
- Defense |
- Healthless 20 Percent |
- Berserking |
- Frozen |
- Judgement |
- Unknown6 |
- Hunter Parry |
- Unknown8 |
- Unknown9 |
- Warrior Victory Rush |
- Unknown11 |
- Faerie Fire |
- Healthless 35 Percent |
- Conflagrate |
- Swiftmend |
- Deadly Poison |
- Enrage |
- Bleeding |
- Parry |
- Unknown20 |
- Unknown21 |
- Unknown22 |
- Health Above 75 Percent
+ 无 |
+ 防御 |
+ 生命值低于 20% |
+ 狂暴 |
+ 冻结 |
+ 审判 |
+ 未知 6 |
+ 猎人招架 |
+ 未知 8 |
+ 未知 9 |
+ 战士胜利冲击 |
+ 未知 11 |
+ 精灵之火 |
+ 生命值低于 35% |
+ 燃烧 |
+ 迅捷治愈 |
+ 致命毒药 |
+ 激怒 |
+ 流血 |
+ 招架 |
+ 未知 20 |
+ 未知 21 |
+ 未知 22 |
+ 生命值高于 75%
非装备 |
diff --git a/HeadlessExport/App.config b/HeadlessExport/App.config
index 5a1f3d40..3637be47 100644
--- a/HeadlessExport/App.config
+++ b/HeadlessExport/App.config
@@ -1,22 +1,22 @@
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
\ No newline at end of file
+
diff --git a/HeadlessExport/HeadlessExport.csproj b/HeadlessExport/HeadlessExport.csproj
index e4147401..6acac352 100644
--- a/HeadlessExport/HeadlessExport.csproj
+++ b/HeadlessExport/HeadlessExport.csproj
@@ -8,10 +8,11 @@
Exe
HeadlessExport
HeadlessExport
- v4.6.1
+ v4.8
512
true
true
+
AnyCPU
diff --git a/SpellGUIV2/App.config b/SpellGUIV2/App.config
index d603b66e..ce689db8 100644
--- a/SpellGUIV2/App.config
+++ b/SpellGUIV2/App.config
@@ -1,45 +1,45 @@
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
\ No newline at end of file
+
diff --git a/SpellGUIV2/ConfigWindow.xaml b/SpellGUIV2/ConfigWindow.xaml
index 0a38bbb3..20f8719e 100644
--- a/SpellGUIV2/ConfigWindow.xaml
+++ b/SpellGUIV2/ConfigWindow.xaml
@@ -5,6 +5,8 @@
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="{DynamicResource ConfigWindowTitle}"
WindowStartupLocation="CenterScreen"
+ Height="925"
+ Width="1825"
Icon="icon.ico"
Loaded="_Loaded"
BorderBrush="#1585B5"
diff --git a/SpellGUIV2/ConfigWindow.xaml.cs b/SpellGUIV2/ConfigWindow.xaml.cs
index 3922e389..38c0e751 100644
--- a/SpellGUIV2/ConfigWindow.xaml.cs
+++ b/SpellGUIV2/ConfigWindow.xaml.cs
@@ -1,4 +1,8 @@
-using System;
+using MahApps.Metro.Controls;
+using NLog;
+using SpellEditor.Sources.Config;
+using SpellEditor.Sources.VersionControl;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -8,11 +12,8 @@
using System.Windows.Forms;
using System.Windows.Media;
using System.Windows.Threading;
-using MahApps.Metro.Controls;
-using NLog;
-using SpellEditor.Sources.Config;
-using SpellEditor.Sources.VersionControl;
using static System.Environment;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
using Application = System.Windows.Application;
using Button = System.Windows.Controls.Button;
using Label = System.Windows.Controls.Label;
@@ -61,9 +62,12 @@ private void BuildConfigWindow()
ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
// Icon config row
ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ // Caching config row
+ ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
// MPQ name config row
ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
- // Bindings and directory settings, 2 rows
+ // Bindings and directory settings, 3 rows
+ ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
ConfigGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
// Database type specific grid
@@ -127,6 +131,8 @@ private void BuildConfigWindow()
currentRow = BuildIconConfig(ConfigGrid, currentRow);
+ currentRow = BuildCachingConfig(ConfigGrid, currentRow);
+
currentRow = BuildMpqConfig(ConfigGrid, currentRow);
currentRow = BuildBindingsAndDbcUI(ConfigGrid, currentRow);
@@ -344,6 +350,30 @@ private int BuildIconConfig(Grid grid, int currentRow)
return currentRow;
}
+ private int BuildCachingConfig(Grid grid, int currentRow)
+ {
+ var label = new Label { Content = "Cache spells:" };
+ label.Margin = new Thickness(10);
+
+ var checkbox = new System.Windows.Controls.CheckBox { };
+ checkbox.Margin = new Thickness(10);
+
+ checkbox.IsChecked = Config.CacheSpellBody;
+ checkbox.Checked += CacheSpellBody_Checked;
+ checkbox.Unchecked += CacheSpellBody_Checked;
+ checkbox.ToolTip = "When this is turned on, spells will be cached in memory making exporting take 1-3 seconds.";
+
+ Grid.SetRow(label, currentRow);
+ Grid.SetRow(checkbox, currentRow++);
+ Grid.SetColumn(label, 0);
+ Grid.SetColumn(checkbox, 1);
+
+ grid.Children.Add(label);
+ grid.Children.Add(checkbox);
+
+ return currentRow;
+ }
+
private int BuildMpqConfig(Grid grid, int currentRow)
{
var label = new Label
@@ -375,12 +405,19 @@ private void RenderIconsInView_Checked(object sender, RoutedEventArgs e)
Config.RenderImagesInView = (sender as System.Windows.Controls.CheckBox).IsChecked.Value;
}
+ private void CacheSpellBody_Checked(object sender, RoutedEventArgs e)
+ {
+ Config.CacheSpellBody = (sender as System.Windows.Controls.CheckBox).IsChecked.Value;
+ }
+
private int BuildBindingsAndDbcUI(Grid grid, int currentRow)
{
var bindingsLabel = new Label { Content = "Bindings Directory:" };
var dbcLabel = new Label { Content = "DBC Directory:" };
- var bindingsDirLabel = new Label { Content = Config.BindingsDirectory };
- var dbcDirLabel = new Label { Content = Config.DbcDirectory };
+ var exportLabel = new Label { Content = "Export Directory:" };
+ var bindingsDirLabel = new TextBox { Text = Config.BindingsDirectory };
+ var dbcDirLabel = new TextBox { Text = Config.DbcDirectory };
+ var exportDirLabel = new TextBox { Text = Config.ExportDirectory };
var changeBindingsButton = new ButtonWithLabelRef(bindingsDirLabel, ButtonWithLabelRef.DirButtonType.Bindings)
{
Content = "Change Directory",
@@ -391,18 +428,28 @@ private int BuildBindingsAndDbcUI(Grid grid, int currentRow)
Content = "Change Directory",
Foreground = Brushes.Black
};
+ var changeExportButton = new ButtonWithLabelRef(exportDirLabel, ButtonWithLabelRef.DirButtonType.Export)
+ {
+ Content = "Change Directory",
+ Foreground = Brushes.Black
+ };
bindingsLabel.Margin = new Thickness(10);
dbcLabel.Margin = new Thickness(10);
+ exportLabel.Margin = new Thickness(10);
bindingsDirLabel.Margin = new Thickness(10);
dbcDirLabel.Margin = new Thickness(10);
+ exportDirLabel.Margin = new Thickness(10);
changeBindingsButton.Margin = new Thickness(10);
changeDbcButton.Margin = new Thickness(10);
+ changeExportButton.Margin = new Thickness(10);
changeBindingsButton.MinWidth = 100;
changeDbcButton.MinWidth = 100;
+ changeExportButton.MinWidth = 100;
changeBindingsButton.Click += OpenDirButton_Click;
changeDbcButton.Click += OpenDirButton_Click;
+ changeExportButton.Click += OpenDirButton_Click;
Grid.SetRow(bindingsLabel, currentRow);
Grid.SetColumn(bindingsLabel, 0);
@@ -416,6 +463,12 @@ private int BuildBindingsAndDbcUI(Grid grid, int currentRow)
Grid.SetColumn(dbcDirLabel, 1);
Grid.SetRow(changeDbcButton, currentRow);
Grid.SetColumn(changeDbcButton, 2);
+ Grid.SetRow(exportLabel, ++currentRow);
+ Grid.SetColumn(exportLabel, 0);
+ Grid.SetRow(exportDirLabel, currentRow);
+ Grid.SetColumn(exportDirLabel, 1);
+ Grid.SetRow(changeExportButton, currentRow);
+ Grid.SetColumn(changeExportButton, 2);
grid.Children.Add(bindingsLabel);
grid.Children.Add(bindingsDirLabel);
@@ -423,6 +476,9 @@ private int BuildBindingsAndDbcUI(Grid grid, int currentRow)
grid.Children.Add(dbcLabel);
grid.Children.Add(dbcDirLabel);
grid.Children.Add(changeDbcButton);
+ grid.Children.Add(exportLabel);
+ grid.Children.Add(exportDirLabel);
+ grid.Children.Add(changeExportButton);
return currentRow;
}
@@ -444,14 +500,6 @@ private void OpenDirButton_Click(object sender, RoutedEventArgs e)
{
var path = dialog.SelectedPath;
button.UpdateLabelText(path);
- if (button.DbType == ButtonWithLabelRef.DirButtonType.Bindings)
- {
- Config.BindingsDirectory = path;
- }
- else if (button.DbType == ButtonWithLabelRef.DirButtonType.Dbc)
- {
- Config.DbcDirectory = path;
- }
}
}
}
@@ -488,26 +536,44 @@ public enum DatabaseIdentifier
private class ButtonWithLabelRef : Button
{
- private readonly Label _LabelReference;
+ private readonly TextBox _LabelReference;
public readonly DirButtonType DbType;
- public ButtonWithLabelRef(Label labelRef, DirButtonType type)
+ public ButtonWithLabelRef(TextBox labelRef, DirButtonType type)
{
_LabelReference = labelRef;
DbType = type;
+
+ _LabelReference.TextChanged += (s, e) =>
+ {
+ var path = labelRef.Text;
+ if (type == DirButtonType.Bindings)
+ {
+ Config.BindingsDirectory = path;
+ }
+ else if (type == DirButtonType.Dbc)
+ {
+ Config.DbcDirectory = path;
+ }
+ else if (type == DirButtonType.Export)
+ {
+ Config.ExportDirectory = path;
+ }
+ };
}
public void UpdateLabelText(string text)
{
- _LabelReference.Content = text;
+ _LabelReference.Text = text;
}
- public string GetLabelText() => _LabelReference.Content.ToString();
+ public string GetLabelText() => _LabelReference.Text.ToString();
public enum DirButtonType
{
Bindings,
- Dbc
+ Dbc,
+ Export
}
}
diff --git a/SpellGUIV2/CopySpellDialog.xaml b/SpellGUIV2/CopySpellDialog.xaml
new file mode 100644
index 00000000..9def3e60
--- /dev/null
+++ b/SpellGUIV2/CopySpellDialog.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SpellGUIV2/CopySpellDialog.xaml.cs b/SpellGUIV2/CopySpellDialog.xaml.cs
new file mode 100644
index 00000000..a9abba7d
--- /dev/null
+++ b/SpellGUIV2/CopySpellDialog.xaml.cs
@@ -0,0 +1,10 @@
+namespace SpellEditor
+{
+ partial class CopySpellDialog
+ {
+ public CopySpellDialog()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/SpellGUIV2/ImportExportWindow.xaml.cs b/SpellGUIV2/ImportExportWindow.xaml.cs
index 3097d52d..9faea40e 100644
--- a/SpellGUIV2/ImportExportWindow.xaml.cs
+++ b/SpellGUIV2/ImportExportWindow.xaml.cs
@@ -1,6 +1,14 @@
-using System;
+using MahApps.Metro.Controls;
+using NLog;
+using SpellEditor.Sources.Binding;
+using SpellEditor.Sources.Config;
+using SpellEditor.Sources.Database;
+using SpellEditor.Sources.DBC;
+using SpellEditor.Sources.Tools.MPQ;
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -12,16 +20,6 @@
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Threading;
-
-using MahApps.Metro.Controls;
-
-using NLog;
-
-using SpellEditor.Sources.Binding;
-using SpellEditor.Sources.Config;
-using SpellEditor.Sources.Database;
-using SpellEditor.Sources.DBC;
-using SpellEditor.Sources.Tools.MPQ;
using Binding = SpellEditor.Sources.Binding.Binding;
namespace SpellEditor
@@ -36,14 +34,21 @@ partial class ImportExportWindow
private Action _PopulateSelectSpell;
private Action> _ReloadData;
private readonly string _SpellBindingName = "Spell";
+ private MainWindow main;
- public ImportExportWindow(IDatabaseAdapter adapter, Action populateSelectSpell, Action> reloadData)
+ public ImportExportWindow(IDatabaseAdapter adapter, Action populateSelectSpell, Action> reloadData, MainWindow mainWindow)
{
_Adapter = adapter;
_TaskLookup = new ConcurrentDictionary();
_PopulateSelectSpell = populateSelectSpell;
_ReloadData = reloadData;
InitializeComponent();
+ main = mainWindow;
+ }
+
+ public ImportExportWindow(IDatabaseAdapter adapter)
+ {
+ _Adapter = adapter;
}
void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
@@ -244,6 +249,10 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
Task.Run(() =>
{
+ var watch = new Stopwatch();
+ var loadedDBC = new Stopwatch();
+ var importExport = new Stopwatch();
+ watch.Start();
var bag = new ConcurrentBag();
var adapters = new List();
var adapterIndex = 0;
@@ -255,9 +264,21 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
{
bindingList.Remove(_SpellBindingName);
// Load data
+
+ loadedDBC.Start();
var abstractDbc = GetDBC(_SpellBindingName, isImport);
+ loadedDBC.Stop();
// Perform operation using existing adapter
- StartImportExport(abstractDbc, _Adapter, _SpellBindingName, isImport, ref bag, ref barLookup, useType);
+
+ if (abstractDbc != null)
+ {
+ StartImportExport(abstractDbc, _Adapter, _SpellBindingName, isImport, ref bag, ref barLookup, useType);
+ }
+ else
+ {
+ Logger.Info($"ERROR: Failed to load {Config.DbcDirectory}\\{_SpellBindingName}.dbc");
+ ShowFlyoutMessage($"Failed to load {Config.DbcDirectory}\\{_SpellBindingName}.dbc");
+ }
}
// Spawn adapters
@@ -279,7 +300,13 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
}
// Perform operation
- StartImportExport(abstractDbc, adapter, bindingName, isImport, ref bag, ref barLookup, useType);
+ if (abstractDbc != null)
+ StartImportExport(abstractDbc, adapter, bindingName, isImport, ref bag, ref barLookup, useType);
+ else
+ {
+ Logger.Info($"ERROR: Failed to load {Config.DbcDirectory}\\{bindingName}.dbc");
+ ShowFlyoutMessage($"Failed to load {Config.DbcDirectory}\\{bindingName}.dbc");
+ }
}
catch (Exception exception)
{
@@ -289,6 +316,7 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
});
// Wait for all tasks to complete
+ importExport.Start();
List allTasks = bag.ToList();
Dispatcher.InvokeAsync(new Action(() => label.Content = $"Remaining: {allTasks.Count}"));
while (allTasks.Count > 0)
@@ -306,6 +334,7 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
}
Dispatcher.InvokeAsync(new Action(() => label.Content = $"Remaining: {allTasks.Count}"));
}
+ importExport.Stop();
}
finally
{
@@ -349,6 +378,13 @@ private void doImportExport(bool isImport, List bindingList, ImportExpor
Close();
}));
}
+
+ GC.Collect();
+
+ watch.Stop();
+ Logger.Info($"finished doImportExport in {watch.ElapsedMilliseconds}ms");
+ Logger.Info($"finished loading dbc {loadedDBC.ElapsedMilliseconds}ms");
+ Logger.Info($"finished tasks {importExport.ElapsedMilliseconds}ms");
});
}
@@ -361,7 +397,7 @@ private AbstractDBC GetDBC(string bindingName, bool isImport)
{
try
{
- abstractDbc = new GenericDbc($"{Config.DbcDirectory}\\{bindingName}.dbc");
+ abstractDbc = isImport ? new GenericDbc($"{Config.DbcDirectory}\\{bindingName}.dbc") : new GenericDbc();
}
catch (Exception exception)
{
@@ -379,7 +415,7 @@ private Task StartImportExport(AbstractDBC dbc, IDatabaseAdapter adapter, string
{
var task = isImport ?
dbc.ImportTo(adapter, SetProgress, "ID", bindingName, useType) :
- dbc.ExportTo(adapter, SetProgress, "ID", bindingName, useType);
+ dbc.ExportTo(adapter, SetProgress, "ID", bindingName, useType, useType == ImportExportType.DBC && bindingName == _SpellBindingName ? main.GetBodyData() : null);
_TaskLookup.TryAdd(task.Id, barLookup[bindingName]);
bag.Add(task);
diff --git a/SpellGUIV2/LogBookWindow.xaml.cs b/SpellGUIV2/LogBookWindow.xaml.cs
index 321999cc..b6ba0d54 100644
--- a/SpellGUIV2/LogBookWindow.xaml.cs
+++ b/SpellGUIV2/LogBookWindow.xaml.cs
@@ -80,6 +80,7 @@ private void LogBookWindow_IsVisibleChanged(object sender, DependencyPropertyCha
private void LogBookWindow_Closed(object sender, EventArgs e)
{
+ Visibility = Visibility.Hidden;
_main.LocationChanged -= MainWindowMoved;
}
diff --git a/SpellGUIV2/MainWindow.xaml b/SpellGUIV2/MainWindow.xaml
index 27a7d272..d624db0e 100644
--- a/SpellGUIV2/MainWindow.xaml
+++ b/SpellGUIV2/MainWindow.xaml
@@ -6,7 +6,7 @@
xmlns:c="clr-namespace:SpellEditor.Sources.Controls"
xmlns:c2="clr-namespace:SpellEditor.Sources.Controls.Common"
Title="{DynamicResource mainTitle}"
- Height="800"
+ Height="925"
Width="1300"
WindowStartupLocation="CenterScreen"
Icon="icon.ico"
@@ -95,11 +95,11 @@
-
+
-
+
@@ -329,7 +329,7 @@
-
+
@@ -348,6 +348,7 @@
+
@@ -370,8 +371,10 @@
-
-
+
+
+
+
@@ -384,8 +387,6 @@
-
-
@@ -436,12 +437,35 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -473,7 +497,7 @@
-
+
@@ -482,13 +506,13 @@
-
+
-
-
-
-
+
+
+
+
@@ -544,6 +568,13 @@
+
+
+
+
+
+
+
@@ -596,6 +627,13 @@
+
+
+
+
+
+
+
@@ -640,14 +678,21 @@
-
+
-
+
+
+
+
+
+
+
+
@@ -655,7 +700,7 @@
-
+
@@ -728,7 +773,7 @@
-
+
@@ -831,6 +876,7 @@
+
@@ -840,6 +886,10 @@
+
+
+
+
@@ -853,24 +903,27 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SpellGUIV2/MainWindow.xaml.cs b/SpellGUIV2/MainWindow.xaml.cs
index 67070f25..65601b77 100644
--- a/SpellGUIV2/MainWindow.xaml.cs
+++ b/SpellGUIV2/MainWindow.xaml.cs
@@ -1,25 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Data.SQLite;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Threading;
-using System.Xml.Linq;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using MySql.Data.MySqlClient;
+using MySqlX.XDevAPI.Relational;
using NLog;
using NLog.Config;
using NLog.Layouts;
@@ -38,6 +20,32 @@
using SpellEditor.Sources.Tools.SpellFamilyClassMaskStoreParser;
using SpellEditor.Sources.Tools.VisualTools;
using SpellEditor.Sources.VersionControl;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
+using System.Data.SQLite;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.ServiceModel.Channels;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using System.Xml.Linq;
+using static SpellEditor.Sources.DBC.AbstractDBC;
namespace SpellEditor
{
@@ -54,6 +62,7 @@ partial class MainWindow
private readonly List attributes6 = new List();
private readonly List attributes7 = new List();
private readonly List stancesBoxes = new List();
+ private readonly List stancesNotBoxes = new List();
private readonly List targetCreatureTypeBoxes = new List();
private readonly List targetBoxes = new List();
private readonly List procBoxes = new List();
@@ -69,14 +78,31 @@ partial class MainWindow
private IDatabaseAdapter adapter;
public uint selectedID;
+ public uint selectedIconID;
public uint newIconID = 1;
private bool updating;
+ private bool saving;
private readonly SpellStringParser SpellStringParser = new SpellStringParser();
+ public DBCBodyToSerialize spellBody = new DBCBodyToSerialize();
+ public DataRow selectedDataRow;
+ private PartialLoad loadStage = PartialLoad.Null;
+ private Dictionary copiedEffect;
private readonly List spellDescGenFields = new List();
private readonly List spellTooltipGenFields = new List();
public SpellFamilyClassMaskParser spellFamilyClassMaskParser;
private VisualController _currentVisualController;
+
+ enum PartialLoad
+ {
+ Null = 0,
+ MainPage = 1 << 0,
+ BasePage = 1 << 1,
+ EffectsPage = 1 << 2,
+ ItemsPage = 1 << 3,
+ FlagsPage = 1 << 4,
+ }
+
#endregion
public IDatabaseAdapter GetDBAdapter()
@@ -282,17 +308,31 @@ private void RefreshAllUIElements()
StancesGrid.Children.Clear();
stancesBoxes.Clear();
+ StancesNotGrid.Children.Clear();
+ stancesNotBoxes.Clear();
string[] stances_strings = SafeTryFindResource("stances_strings").Split('|');
foreach (string stance in stances_strings)
{
ThreadSafeCheckBox box = new ThreadSafeCheckBox
{
- Content = stance, ToolTip = stance, Margin = new Thickness(0, 5, 0, 0)
+ Content = stance,
+ ToolTip = stance,
+ Margin = new Thickness(0, 5, 0, 0)
+ };
+
+ ThreadSafeCheckBox box2 = new ThreadSafeCheckBox
+ {
+ Content = stance,
+ ToolTip = stance,
+ Margin = new Thickness(0, 5, 0, 0)
};
StancesGrid.Children.Add(box);
stancesBoxes.Add(box);
+
+ StancesNotGrid.Children.Add(box2);
+ stancesNotBoxes.Add(box2);
}
TargetCreatureType.Children.Clear();
@@ -311,12 +351,17 @@ private void RefreshAllUIElements()
}
CasterAuraState.Items.Clear();
- string[] caster_aura_state_strings = SafeTryFindResource("aura_state_strings").Split('|');
- foreach (string casterAuraState in caster_aura_state_strings) { CasterAuraState.Items.Add(casterAuraState); }
-
TargetAuraState.Items.Clear();
- string[] target_aura_state_strings = SafeTryFindResource("aura_state_strings").Split('|');
- foreach (string targetAuraState in target_aura_state_strings) { TargetAuraState.Items.Add(targetAuraState); }
+ CasterAuraStateNot.Items.Clear();
+ TargetAuraStateNot.Items.Clear();
+ string[] aura_state_strings = SafeTryFindResource("aura_state_strings").Split('|');
+ foreach (string casterAuraState in aura_state_strings)
+ {
+ CasterAuraState.Items.Add(casterAuraState);
+ TargetAuraState.Items.Add(casterAuraState);
+ CasterAuraStateNot.Items.Add(casterAuraState);
+ TargetAuraStateNot.Items.Add(casterAuraState);
+ }
EquippedItemInventoryTypeGrid.Children.Clear();
equippedItemInventoryTypeMaskBoxes.Clear();
@@ -385,15 +430,16 @@ private void RefreshAllUIElements()
ProcEditorGrid.Children.Clear();
procBoxes.Clear();
string[] proc_strings = SafeTryFindResource("proc_strings").Split('|');
+ int idx = -1;
foreach (string procString in proc_strings)
{
+ uint mask = (uint)Math.Pow(2, idx++);
+
ThreadSafeCheckBox box = new ThreadSafeCheckBox
{
- Content = procString, Margin = new Thickness(0, 5, 0, 0)
+ Content = mask.ToString() + " -" + (mask == 0 ? " " : "") + procString, Margin = new Thickness(0, 5, 0, 0)
};
-
-
ProcEditorGrid.Children.Add(box);
procBoxes.Add(box);
}
@@ -589,26 +635,26 @@ private void _Loaded(object sender, RoutedEventArgs e)
{
uint mask = (uint)Math.Pow(2, i);
- SpellMask11.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask12.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask13.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask21.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask22.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask23.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask31.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask32.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
- SpellMask33.Items.Add(new ThreadSafeCheckBox { Content = "0x" + mask.ToString("x8") });
+ SpellMask11.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask12.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask13.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask21.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask22.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask23.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask31.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask32.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
+ SpellMask33.Items.Add(new ThreadSafeCheckBox { Content = mask.ToString() });
}
- foreach (ThreadSafeCheckBox cb in SpellMask11.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask12.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask13.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask21.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask22.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask23.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask31.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask32.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
- foreach (ThreadSafeCheckBox cb in SpellMask33.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; }
+ foreach (ThreadSafeCheckBox cb in SpellMask11.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask11); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask12.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask12); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask13.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask13); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask21.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask21); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask22.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask22); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask23.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask23); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask31.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask31); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask32.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask32); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
+ foreach (ThreadSafeCheckBox cb in SpellMask33.Items) { cb.Checked += HandspellFamilyClassMask_Checked; cb.Unchecked += HandspellFamilyClassMask_Checked; ToolTipService.SetInitialShowDelay(cb, 0); ToolTipService.SetBetweenShowDelay(cb, 0); ToolTipService.SetPlacementTarget(cb, SpellMask33); ToolTipService.SetPlacement(cb, PlacementMode.Right); ToolTipService.SetHorizontalOffset(cb, 15); }
LoadAllData();
@@ -654,7 +700,7 @@ private void ImportExportSpellDbcButton(object sender, RoutedEventArgs e)
_ImportExportWindow.Show();
return;
}
- var window = new ImportExportWindow(adapter, PopulateSelectSpell, LoadAllRequiredDbcs);
+ var window = new ImportExportWindow(adapter, PopulateSelectSpell, LoadAllRequiredDbcs, this);
window.Show();
window.Height += 40;
window.Width /= 2;
@@ -684,9 +730,13 @@ private void UpdateLogBookEntry(StackPanel panel)
{
Visibility = Visibility.Hidden
};
- _LogBookWindow.Show();
- _LogBookWindow.UpdateLayout();
+ //_LogBookWindow.Show();
+ //_LogBookWindow.UpdateLayout();
}
+
+ // fuck that shit kek
+ if (_LogBookWindow.Visibility == Visibility.Hidden)
+ return;
_LogBookWindow.RecordLogEntry(panel as SpellSelectionEntry);
}
@@ -858,9 +908,9 @@ await Task.Run(() =>
try
{
// Initialise select spell list
- SelectSpell.SetAdapter(GetDBAdapter())
+ /*SelectSpell.SetAdapter(GetDBAdapter())
.SetLanguage(GetLanguage())
- .Initialise();
+ .Initialise();*/
// Populate UI based on DBC data
Category.ItemsSource = ConvertBoxListToLabels(((SpellCategory)
@@ -879,9 +929,13 @@ await Task.Run(() =>
DBCManager.GetInstance().FindDbcForBinding("SpellRange")).GetAllBoxes());
var radiusLabels = ConvertBoxListToLabels(((SpellRadius)
DBCManager.GetInstance().FindDbcForBinding("SpellRadius")).GetAllBoxes());
+ var radiusLabels2 = ConvertBoxListToLabels(((SpellRadius)
+ DBCManager.GetInstance().FindDbcForBinding("SpellRadius")).GetAllBoxes());
+ var radiusLabels3 = ConvertBoxListToLabels(((SpellRadius)
+ DBCManager.GetInstance().FindDbcForBinding("SpellRadius")).GetAllBoxes());
RadiusIndex1.ItemsSource = radiusLabels;
- RadiusIndex2.ItemsSource = radiusLabels;
- RadiusIndex3.ItemsSource = radiusLabels;
+ RadiusIndex2.ItemsSource = radiusLabels2;
+ RadiusIndex3.ItemsSource = radiusLabels3;
EquippedItemClass.ItemsSource = ConvertBoxListToLabels(((ItemClass)
DBCManager.GetInstance().FindDbcForBinding("ItemClass")).GetAllBoxes());
var isTbcOrGreater = WoWVersionManager.IsTbcOrGreaterSelected;
@@ -890,8 +944,10 @@ await Task.Run(() =>
{
var totemLabels = ConvertBoxListToLabels(((TotemCategory)
DBCManager.GetInstance().FindDbcForBinding("TotemCategory")).GetAllBoxes());
+ var totemLabels2 = ConvertBoxListToLabels(((TotemCategory)
+ DBCManager.GetInstance().FindDbcForBinding("TotemCategory")).GetAllBoxes());
TotemCategory1.ItemsSource = totemLabels;
- TotemCategory2.ItemsSource = totemLabels;
+ TotemCategory2.ItemsSource = totemLabels2;
}
if (isWotlkOrGreater)
{
@@ -914,8 +970,6 @@ await Task.Run(() =>
VisualSettingsGrid.ContextMenu = new ListContextMenu((item, args) => PasteVisualKitAction(), true);
VisualEffectsListGrid.ContextMenu = new ListContextMenu((item, args) => PasteVisualEffectAction(), true);
InitialiseSpellVisualEffectList();
-
- prepareIconEditor();
}
catch (Exception e)
{
@@ -931,7 +985,9 @@ await this.ShowMessageAsync(SafeTryFindResource("ERROR"),
await createTask;
}*/
await controller.CloseAsync();
- PopulateSelectSpell();
+
+ if (adapter.Query("SELECT `ID` FROM `spell` LIMIT 1").Rows.Count > 0)
+ PopulateSelectSpell();
}
private void FocusLanguage()
@@ -1158,6 +1214,83 @@ private async void _KeyDown(object sender, KeyEventArgs e)
#endregion
#region ButtonClicks (and load spell god-function)
+
+ public async Task<(bool success, uint oldId, List newIds)> ShowCopySpellDialog()
+ {
+ var dialog = new CustomDialog();
+ var view = new CopySpellDialog();
+
+ view.AmountInput.Text = "1";
+
+ if (selectedID > 0)
+ view.OldIdInput.Text = selectedID.ToString();
+
+ dialog.Content = view;
+
+ await this.ShowMetroDialogAsync(dialog);
+
+ var source = new TaskCompletionSource<(bool, uint, List)>();
+
+ view.OkButton.Click += async (s, e) =>
+ {
+ if (!uint.TryParse(view.OldIdInput.Text, out uint oldId) || !SelectSpell.HasSpell(oldId))
+ {
+ HandleErrorMessage(SafeTryFindResource("CopySpellRecord3"));
+ return;
+ }
+
+ if (!uint.TryParse(view.AmountInput.Text, out uint amount) || amount == 0)
+ {
+ HandleErrorMessage(SafeTryFindResource("CopySpellRecord9"));
+ return;
+ }
+
+ bool useFirstAvailable = view.FirstBox.IsChecked == true;
+
+ uint startId = oldId;
+
+ if (!string.IsNullOrWhiteSpace(view.NewIdInput.Text))
+ {
+ if (!uint.TryParse(view.NewIdInput.Text, out startId))
+ {
+ HandleErrorMessage(SafeTryFindResource("CopySpellRecord5"));
+ return;
+ }
+ }
+ else if (!useFirstAvailable)
+ {
+ HandleErrorMessage(SafeTryFindResource("CopySpellRecord5"));
+ return;
+ }
+
+
+ List newIds = useFirstAvailable ? SelectSpell.GetFirstAvailableSpells(startId, amount) : new List();
+
+ if (!useFirstAvailable)
+ {
+ if (uint.Parse(adapter.Query($"SELECT COUNT(*) FROM `spell` WHERE `ID` BETWEEN {startId} AND {startId + amount - 1}").Rows[0][0].ToString()) > 0)
+ {
+ HandleErrorMessage(SafeTryFindResource("CopySpellRecord6"));
+ return;
+ }
+
+ for (uint i = 0; i < amount; ++i)
+ newIds.Add(startId + i);
+ }
+
+ await this.HideMetroDialogAsync(dialog);
+ source.SetResult((true, oldId, newIds));
+ };
+
+ view.CancelButton.Click += async (s, e) =>
+ {
+ await this.HideMetroDialogAsync(dialog);
+ source.SetResult((false, 0, new List()));
+ };
+
+ return await source.Task;
+ }
+
private async void Button_Click(object sender, RoutedEventArgs e)
{
if (adapter == null)
@@ -1189,59 +1322,18 @@ private async void Button_Click(object sender, RoutedEventArgs e)
if (sender == InsertANewRecord)
{
- MetroDialogSettings settings = new MetroDialogSettings
- {
- AffirmativeButtonText = SafeTryFindResource("Yes"),
- NegativeButtonText = SafeTryFindResource("No")
- };
-
-
- MessageDialogStyle style = MessageDialogStyle.AffirmativeAndNegative;
- MessageDialogResult copySpell = await this.ShowMessageAsync(SafeTryFindResource("SpellEditor"), SafeTryFindResource("CopySpellRecord1"), style, settings);
-
- uint oldIDIndex = uint.MaxValue;
+ var result = await ShowCopySpellDialog();
+ if (!result.success) return;
- if (copySpell == MessageDialogResult.Affirmative)
- {
- string inputCopySpell = await this.ShowInputAsync(SafeTryFindResource("SpellEditor"), SafeTryFindResource("CopySpellRecord2"));
- if (inputCopySpell == null) { return; }
-
- if (!uint.TryParse(inputCopySpell, out var oldID))
- {
- HandleErrorMessage(SafeTryFindResource("CopySpellRecord3"));
- return;
- }
- oldIDIndex = oldID;
- }
-
- string inputNewRecord = await this.ShowInputAsync(SafeTryFindResource("SpellEditor"), SafeTryFindResource("CopySpellRecord4"));
- if (inputNewRecord == null) { return; }
-
- if (!uint.TryParse(inputNewRecord, out var newID))
- {
- HandleErrorMessage(SafeTryFindResource("CopySpellRecord5"));
- return;
- }
-
- if (uint.Parse(adapter.Query($"SELECT COUNT(*) FROM `spell` WHERE `ID` = '{newID}'").Rows[0][0].ToString()) > 0)
- {
- HandleErrorMessage(SafeTryFindResource("CopySpellRecord6"));
- return;
- }
+ var oldID = result.oldId;
+ var newIDs = result.newIds;
+ var count = newIDs.Count;
- if (oldIDIndex != uint.MaxValue)
- {
- // Copy old spell to new spell
- SelectSpell.AddNewSpell(oldIDIndex, newID);
- }
- else
- {
- // Create new spell
- HandleErrorMessage(SafeTryFindResource("CopySpellRecord7"));
- return;
- }
+ // Copy old spell to new spell
+ for (int i = 0; i < count; ++i)
+ SelectSpell.AddNewSpell(oldID, newIDs[i], i == (count-1));
- ShowFlyoutMessage(string.Format(SafeTryFindResource("CopySpellRecord8"), inputNewRecord));
+ ShowFlyoutMessage(string.Format(SafeTryFindResource("CopySpellRecord10"), count, newIDs[0]));
return;
}
@@ -1258,7 +1350,7 @@ private async void Button_Click(object sender, RoutedEventArgs e)
}
SelectSpell.DeleteSpell(spellID);
-
+
selectedID = 0;
ShowFlyoutMessage(SafeTryFindResource("DeleteSpellRecord3"));
@@ -1267,16 +1359,44 @@ private async void Button_Click(object sender, RoutedEventArgs e)
if (sender == SaveSpellChanges)
{
+ if (saving)
+ return;
+
string query = $"SELECT * FROM `spell` WHERE `ID` = '{selectedID}' LIMIT 1";
var q = adapter.Query(query);
if (q.Rows.Count == 0)
return;
+
var row = q.Rows[0];
+ LoadWholeUI(); // make sure the whole ui is loaded
+
var isWotlkOrGreater = WoWVersionManager.IsWotlkOrGreaterSelected;
var isTbcOrGreater = WoWVersionManager.IsTbcOrGreaterSelected;
row.BeginEdit();
try
{
+ uint oldFamilyName = (uint)row["SpellFamilyName"];
+ var oldMasks = new List
+ {
+ uint.Parse(row["EffectSpellClassMaskA1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskA2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskA3"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB3"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC3"].ToString())
+ };
+ uint[] OldSpellFamilyFlag;
+ if (isWotlkOrGreater)
+ {
+ OldSpellFamilyFlag = new uint[] { uint.Parse(row["SpellFamilyFlags"].ToString()), uint.Parse(row["SpellFamilyFlags1"].ToString()), uint.Parse(row["SpellFamilyFlags2"].ToString()) };
+ }
+ else
+ {
+ OldSpellFamilyFlag = new uint[] { uint.Parse(row["SpellFamilyFlags"].ToString()), uint.Parse(row["SpellFamilyFlags1"].ToString()) };
+ }
uint maskk = 0;
uint flagg = 1;
@@ -1379,6 +1499,25 @@ private async void Button_Click(object sender, RoutedEventArgs e)
row["Stances"] = mask;
}
+
+ if (stancesNotBoxes[0].IsChecked.Value)
+ {
+ row["StancesNot"] = 0;
+ }
+ else
+ {
+ uint mask = 0;
+ uint flag = 1;
+
+ for (int f = 1; f < stancesNotBoxes.Count; ++f)
+ {
+ if (stancesNotBoxes[f].IsChecked.Value) { mask += flag; }
+
+ flag += flag;
+ }
+
+ row["StancesNot"] = mask;
+ }
}
if (isWotlkOrGreater)
@@ -1436,9 +1575,12 @@ private async void Button_Click(object sender, RoutedEventArgs e)
if (isTbcOrGreater)
{
row["FacingCasterFlags"] = FacingFrontFlag.IsChecked.Value ? (uint)0x1 : (uint)0x0;
+
row["CasterAuraState"] = CasterAuraState.SelectedIndex;
+ row["TargetAuraState"] = TargetAuraState.SelectedIndex;
+ row["CasterAuraStateNot"] = CasterAuraStateNot.SelectedIndex;
+ row["TargetAuraStateNot"] = TargetAuraStateNot.SelectedIndex;
}
- row["TargetAuraState"] = TargetAuraState.SelectedIndex;
row["RecoveryTime"] = uint.Parse(RecoveryTime.Text);
row["CategoryRecoveryTime"] = uint.Parse(CategoryRecoveryTime.Text);
@@ -1530,7 +1672,7 @@ private async void Button_Click(object sender, RoutedEventArgs e)
row["ManaCostPerLevel"] = uint.Parse(ManaCostPerLevel.Text);
row["ManaPerSecond"] = uint.Parse(ManaCostPerSecond.Text);
row["ManaPerSecondPerLevel"] = uint.Parse(PerSecondPerLevel.Text);
- row["SpellPriority"] = int.Parse(SpellPriority.Text);
+ row["SpellPriority"] = !SpellPriority.IsEnabled ? 0 : int.Parse(SpellPriority.Text);
row["Speed"] = float.Parse(Speed.Text);
row["StackAmount"] = uint.Parse(Stacks.Text);
row["Totem1"] = uint.Parse(Totem1.Text);
@@ -1749,12 +1891,23 @@ private async void Button_Click(object sender, RoutedEventArgs e)
row["SpellToolTipFlags" + suffix] = (uint)(TextFlags.NOT_EMPTY);
row["SpellDescriptionFlags" + suffix] = (uint)(TextFlags.NOT_EMPTY);
+ row["CasterAuraSpell"] = uint.Parse(CasterAuraSpell.Text);
+ row["TargetAuraSpell"] = uint.Parse(TargetAuraSpell.Text);
+ row["ExcludeCasterAuraSpell"] = uint.Parse(ExcludeCasterAuraSpell.Text);
+ row["ExcludeTargetAuraSpell"] = uint.Parse(ExcludeTargetAuraSpell.Text);
+
+ row["StanceBarOrder"] = uint.Parse(StanceBarOrder.Text);
+ row["PowerDisplayId"] = uint.Parse(PowerDisplayId.Text);
+
row.EndEdit();
adapter.CommitChanges(query, q.GetChanges());
ShowFlyoutMessage($"Saved spell {selectedID}.");
SelectSpell.UpdateSpell(row);
+
+ LoadBodyData();
+ SaveSpellMasks(oldFamilyName, oldMasks, OldSpellFamilyFlag);
}
catch (Exception ex)
{
@@ -1764,36 +1917,124 @@ private async void Button_Click(object sender, RoutedEventArgs e)
return;
}
- if (sender == SaveIcon)
+ if (selectedID == 0)
+ return;
+
+ if (sender == SaveSpellIcon || sender == ResetSpellIconID)
+ {
+ var newIcon = sender == ResetSpellIconID ? 1 : newIconID;
+
+ adapter.Execute($"UPDATE `{"spell"}` SET `SpellIconID` = '{newIcon}' WHERE `ID` = '{selectedID}'");
+ RefreshCurrentIcon(newIcon);
+ prepareIconEditor();
+ LoadBodyData();
+ return;
+ }
+
+ if (sender == SaveActiveIcon || sender == ResetActiveIconID)
{
- MetroDialogSettings settings = new MetroDialogSettings
- {
- AffirmativeButtonText = SafeTryFindResource("Yes"),
- NegativeButtonText = SafeTryFindResource("No")
- };
+ var newIcon = sender == ResetActiveIconID ? 0 : newIconID;
+ adapter.Execute($"UPDATE `{"spell"}` SET `ActiveIconID` = '{newIcon}' WHERE `ID` = '{selectedID}'");
- MessageDialogStyle style = MessageDialogStyle.AffirmativeAndNegative;
- MessageDialogResult spellOrActive = await this.ShowMessageAsync(SafeTryFindResource("SpellEditor"), SafeTryFindResource("SaveIcon"), style, settings);
-
- string column = null;
- if (spellOrActive == MessageDialogResult.Affirmative)
- column = "SpellIconID";
- else if (spellOrActive == MessageDialogResult.Negative)
- column = "ActiveIconID";
- adapter.Execute($"UPDATE `{"spell"}` SET `{column}` = '{newIconID}' WHERE `ID` = '{selectedID}'");
+ selectedDataRow["ActiveIconID"] = newIcon;
+ prepareIconEditor();
+ LoadBodyData();
return;
}
+ }
+
+ private void SaveSpellMasks(uint oldFamilyName, List oldMasks, uint[] OldSpellFamilyFlag)
+ {
+ uint familyName = uint.Parse(SpellFamilyName.Text);
+ bool same = familyName == oldFamilyName;
+
+ var masks = new List
+ {
+ uint.Parse(SpellMask11.Text),
+ uint.Parse(SpellMask21.Text),
+ uint.Parse(SpellMask31.Text),
+ uint.Parse(SpellMask12.Text),
+ uint.Parse(SpellMask22.Text),
+ uint.Parse(SpellMask32.Text),
+ uint.Parse(SpellMask13.Text),
+ uint.Parse(SpellMask23.Text),
+ uint.Parse(SpellMask33.Text)
+ };
+
+ uint[] SpellFamilyFlag;
+ if (WoWVersionManager.IsWotlkOrGreaterSelected)
+ {
+ SpellFamilyFlag = new uint[] { uint.Parse(SpellFamilyFlags.Text), uint.Parse(SpellFamilyFlags1.Text), uint.Parse(SpellFamilyFlags2.Text) };
+ }
+ else
+ {
+ SpellFamilyFlag = new uint[] { uint.Parse(SpellFamilyFlags.Text), uint.Parse(SpellFamilyFlags1.Text) };
+ }
+
+ if (!same || !SpellFamilyFlag.SequenceEqual(OldSpellFamilyFlag))
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => spellFamilyClassMaskParser.UpdateSpellList(selectedID, oldFamilyName, OldSpellFamilyFlag, familyName, SpellFamilyFlag)));
+
+ if (!same || !masks.SequenceEqual(oldMasks))
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => spellFamilyClassMaskParser.UpdateSpellFamilyClassMask(this, familyName, WoWVersionManager.IsWotlkOrGreaterSelected, GetDBAdapter(), masks)));
+
+ //Logger.Info($"SaveSpellMasks {same}");
+ }
- if (sender == ResetSpellIconID)
+ private void NothingHere(double progress, int taskIdOverride = 0) { }
+
+ public DBCBodyToSerialize GetBodyData()
+ {
+ if (spellBody.Records != null && !Config.CacheSpellBody)
{
- adapter.Execute($"UPDATE `{"spell"}` SET `{"SpellIconID"}` = '{1}' WHERE `ID` = '{selectedID}'");
+ spellBody.Records = null;
+ GC.Collect();
+ }
+
+ return !saving && Config.CacheSpellBody ? spellBody : null;
+ }
+ public void LoadBodyData(int type = 0, uint spellId = 0)
+ {
+ if (!Config.CacheSpellBody || saving)
return;
+
+ if (type == 1)
+ spellBody.Records = null;
+
+ var dbc = new GenericDbc();
+
+ if (spellBody.Records == null)
+ {
+ saving = true;
+ Task.Run(() =>
+ {
+ var watch = new Stopwatch();
+ watch.Start();
+
+ spellBody.Records = dbc.LoadRecords(adapter, "Spell", " ORDER BY `ID`", NothingHere);
+
+ spellBody.BuildSpellToIndex();
+
+ watch.Stop();
+ Logger.Info($"Loaded spellbody records in {watch.ElapsedMilliseconds}ms");
+
+ GC.Collect();
+
+ saving = false;
+ });
}
- if (sender == ResetActiveIconID)
+ else if (type == 0 && selectedID > 0)
{
- adapter.Execute($"UPDATE `{"spell"}` SET `{"ActiveIconID"}` = '{0}' WHERE `ID` = '{selectedID}'");
+ spellBody.Records[spellBody.GetIndexFromSpell(selectedID)] = dbc.LoadRecords(adapter, "Spell", $" WHERE `ID` = {selectedID} LIMIT 1", NothingHere, true)[0];
}
+ else if (type == 2 && spellId > 0)
+ {
+ spellBody.RemoveSpell(spellId);
+ }
+ else if (type == 3 && spellId > 0)
+ {
+ spellBody.AddSpell(spellId, dbc.LoadRecords(adapter, "Spell", $" WHERE `ID` = {spellId} LIMIT 1", NothingHere, true)[0]);
+ }
}
#endregion
@@ -1821,8 +2062,8 @@ public static T DeepCopy(T obj)
private void prepareIconEditor()
{
var loadIcons = (SpellIconDBC)DBCManager.GetInstance().FindDbcForBinding("SpellIcon");
- loadIcons.LoadImages(64);
loadIcons.updateIconSize(64, new Thickness(16, 0, 0, 0));
+ loadIcons.LoadImages(64);
}
#endregion
@@ -1835,38 +2076,24 @@ private void PopulateSelectSpell()
{
SelectSpell.SetAdapter(GetDBAdapter())
.SetLanguage(GetLanguage())
- .Initialise();
+ .Initialise(this);
}
+
if (!SelectSpell.HasAdapter())
{
SelectSpell.SetAdapter(GetDBAdapter());
}
+
SelectSpell.PopulateSelectSpell();
FocusLanguage();
+
+ prepareIconEditor();
+
+ LoadBodyData(1);
}
#endregion
#region NewIconClick & UpdateMainWindow
- private async void NewIconClick(object sender, RoutedEventArgs e)
- {
- if (adapter == null) { return; }
-
- MetroDialogSettings settings = new MetroDialogSettings
- {
- AffirmativeButtonText = SafeTryFindResource("SpellIconID"),
- NegativeButtonText = SafeTryFindResource("ActiveIconID")
- };
-
- const MessageDialogStyle style = MessageDialogStyle.AffirmativeAndNegative;
- MessageDialogResult spellOrActive = await this.ShowMessageAsync(SafeTryFindResource("SpellEditor"), SafeTryFindResource("String4"), style, settings);
-
- string column = null;
- if (spellOrActive == MessageDialogResult.Affirmative)
- column = "SpellIconID";
- else if (spellOrActive == MessageDialogResult.Negative)
- column = "ActiveIconID";
- adapter.Execute($"UPDATE `{"spell"}` SET `{column}` = '{newIconID}' WHERE `ID` = '{selectedID}'");
- }
private async void UpdateMainWindow()
{
@@ -1995,631 +2222,716 @@ private void loadSpell(UpdateTextFunc updateProgress)
_currentVisualController = null;
adapter.Updating = true;
updateProgress("Querying MySQL data...");
- var data = adapter.Query($"SELECT * FROM `spell` WHERE `ID` = '{selectedID}'");
+
+ var data = adapter.Query($"SELECT * FROM `spell` WHERE `ID` = '{selectedID}' LIMIT 1");
var rowResult = data.Rows;
if (rowResult == null || rowResult.Count != 1)
throw new Exception("An error occurred trying to select spell ID: " + selectedID);
- var row = rowResult[0];
- var numColumns = (int)WoWVersionManager.GetInstance().SelectedVersion().NumLocales;
- var isWotlkOrGreater = WoWVersionManager.IsWotlkOrGreaterSelected;
- var isTbcOrGreater = WoWVersionManager.IsTbcOrGreaterSelected;
- try
- {
- updateProgress("Updating text control's...");
- int i;
- var maxColumns = numColumns > spellDescGenFields.Count ? spellDescGenFields.Count : numColumns;
- for (i = 0; i < maxColumns; ++i)
- {
- spellDescGenFields[i].ThreadSafeText = SpellStringParser.ParseString(row["SpellDescription" + i].ToString(), row, this);
- spellTooltipGenFields[i].ThreadSafeText = SpellStringParser.ParseString(row["SpellTooltip" + i].ToString(), row, this);
- }
- for (i = 0; i < maxColumns; ++i)
- {
- stringObjectMap.TryGetValue(i, out var box);
- box.ThreadSafeText = row[$"SpellName{i}"];
- }
- for (i = 0; i < maxColumns; ++i)
- {
- stringObjectMap.TryGetValue(i + 9, out var box);
- box.ThreadSafeText = row[$"SpellRank{i}"];
- }
- for (i = 0; i < maxColumns; ++i)
- {
- stringObjectMap.TryGetValue(i + 18, out var box);
- box.ThreadSafeText = row[$"SpellTooltip{i}"];
- }
- for (i = 0; i < maxColumns; ++i)
- {
- stringObjectMap.TryGetValue(i + 27, out var box);
- box.ThreadSafeText = row[$"SpellDescription{i}"];
- }
+ selectedDataRow = data.Rows[0];
- updateProgress("Updating category & dispel & mechanic...");
- var loadCategories = (SpellCategory)DBCManager.GetInstance().FindDbcForBinding("SpellCategory");
- Category.ThreadSafeIndex = loadCategories.UpdateCategorySelection(uint.Parse(
- adapter.Query($"SELECT `Category` FROM `{"spell"}` WHERE `ID` = '{selectedID}'").Rows[0][0].ToString()));
+ loadStage = PartialLoad.Null;
- var loadDispels = (SpellDispelType)DBCManager.GetInstance().FindDbcForBinding("SpellDispelType");
- DispelType.ThreadSafeIndex = loadDispels.UpdateDispelSelection(uint.Parse(
- adapter.Query($"SELECT `Dispel` FROM `{"spell"}` WHERE `ID` = '{selectedID}'").Rows[0][0].ToString()));
+ LoadPartialUI(PartialLoad.MainPage);
- var loadMechanics = (SpellMechanic)DBCManager.GetInstance().FindDbcForBinding("SpellMechanic");
- MechanicType.SelectedIndex = loadMechanics.UpdateMechanicSelection(uint.Parse(
- adapter.Query($"SELECT `Mechanic` FROM `{"spell"}` WHERE `ID` = '{selectedID}'").Rows[0][0].ToString()));
+ adapter.Updating = false;
+ }
+ public void LoadSpellFamilyFlags()
+ {
+ if ((loadStage & (PartialLoad.BasePage | PartialLoad.EffectsPage)) != 0)
+ {
+ return;
+ }
- updateProgress("Updating attributes...");
- uint mask = uint.Parse(row["Attributes"].ToString());
- uint flagg = 1;
+ var isWotlkOrGreater = WoWVersionManager.IsWotlkOrGreaterSelected;
+ var row = selectedDataRow;
- foreach (ThreadSafeCheckBox attribute0 in attributes0)
- {
- attribute0.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ if (!isWotlkOrGreater)
+ {
+ uint familyName = uint.Parse(row["SpellFamilyName"].ToString());
+ SpellFamilyName.ThreadSafeText = familyName.ToString();
+ SpellFamilyFlags.ThreadSafeText = row["SpellFamilyFlags1"].ToString();
+ SpellFamilyFlags1.ThreadSafeText = row["SpellFamilyFlags2"].ToString();
+ }
+ else
+ {
+ uint familyName = uint.Parse(row["SpellFamilyName"].ToString());
+ SpellFamilyName.ThreadSafeText = familyName.ToString();
+ SpellFamilyFlags.ThreadSafeText = row["SpellFamilyFlags"].ToString();
+ SpellFamilyFlags1.ThreadSafeText = row["SpellFamilyFlags1"].ToString();
+ SpellFamilyFlags2.ThreadSafeText = row["SpellFamilyFlags2"].ToString();
+ }
+ SpellFamilyFlags2.IsEnabled = isWotlkOrGreater;
+ }
+ private void LoadWholeUI()
+ {
+ foreach (PartialLoad page in Enum.GetValues(typeof(PartialLoad)))
+ {
+ if (page == PartialLoad.Null)
+ continue;
- mask = uint.Parse(row["AttributesEx"].ToString());
- flagg = 1;
+ LoadPartialUI(page);
+ }
+ }
- foreach (ThreadSafeCheckBox attribute1 in attributes1)
- {
- attribute1.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ private void LoadPartialUI(PartialLoad page)
+ {
+ if (((loadStage & page) != 0) || selectedID == 0)
+ {
+ return;
+ }
- mask = uint.Parse(row["AttributesEx2"].ToString());
- flagg = 1;
+ updating = true;
- foreach (ThreadSafeCheckBox attribute2 in attributes2)
+ var numColumns = (int)WoWVersionManager.GetInstance().SelectedVersion().NumLocales;
+ var isWotlkOrGreater = WoWVersionManager.IsWotlkOrGreaterSelected;
+ var isTbcOrGreater = WoWVersionManager.IsTbcOrGreaterSelected;
+ var row = selectedDataRow;
+ uint mask = 0;
+
+ try
+ {
+ switch (page)
{
- attribute2.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ case PartialLoad.MainPage:
+ {
+ int i;
+ var maxColumns = numColumns > spellDescGenFields.Count ? spellDescGenFields.Count : numColumns;
+ for (i = 0; i < maxColumns; ++i)
+ {
+ spellDescGenFields[i].ThreadSafeText = SpellStringParser.ParseString(row["SpellDescription" + i].ToString(), row, this);
+ spellTooltipGenFields[i].ThreadSafeText = SpellStringParser.ParseString(row["SpellTooltip" + i].ToString(), row, this);
+ }
+ for (i = 0; i < maxColumns; ++i)
+ {
+ stringObjectMap.TryGetValue(i, out var box);
+ box.ThreadSafeText = row[$"SpellName{i}"];
+ }
+ for (i = 0; i < maxColumns; ++i)
+ {
+ stringObjectMap.TryGetValue(i + 9, out var box);
+ box.ThreadSafeText = row[$"SpellRank{i}"];
+ }
- mask = uint.Parse(row["AttributesEx3"].ToString());
- flagg = 1;
+ for (i = 0; i < maxColumns; ++i)
+ {
+ stringObjectMap.TryGetValue(i + 18, out var box);
+ box.ThreadSafeText = row[$"SpellTooltip{i}"];
+ }
- foreach (ThreadSafeCheckBox attribute3 in attributes3)
- {
- attribute3.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ for (i = 0; i < maxColumns; ++i)
+ {
+ stringObjectMap.TryGetValue(i + 27, out var box);
+ box.ThreadSafeText = row[$"SpellDescription{i}"];
+ }
+ }
+ break;
- mask = uint.Parse(row["AttributesEx4"].ToString());
- flagg = 1;
+ case PartialLoad.BasePage:
+ {
+ var loadCategories = (SpellCategory)DBCManager.GetInstance().FindDbcForBinding("SpellCategory");
+ Category.ThreadSafeIndex = loadCategories.UpdateCategorySelection(uint.Parse(row["Category"].ToString()));
- foreach (ThreadSafeCheckBox attribute4 in attributes4)
- {
- attribute4.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ var loadDispels = (SpellDispelType)DBCManager.GetInstance().FindDbcForBinding("SpellDispelType");
+ DispelType.ThreadSafeIndex = loadDispels.UpdateDispelSelection(uint.Parse(row["Dispel"].ToString()));
- if (isTbcOrGreater)
- {
- mask = uint.Parse(row["AttributesEx5"].ToString());
- flagg = 1;
+ var loadMechanics = (SpellMechanic)DBCManager.GetInstance().FindDbcForBinding("SpellMechanic");
+ MechanicType.SelectedIndex = loadMechanics.UpdateMechanicSelection(uint.Parse(row["Mechanic"].ToString()));
- foreach (ThreadSafeCheckBox attribute5 in attributes5)
- {
- attribute5.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ var loadCastTimes = (SpellCastTimes)DBCManager.GetInstance().FindDbcForBinding("SpellCastTimes");
+ CastTime.ThreadSafeIndex = loadCastTimes.UpdateCastTimeSelection(uint.Parse(row["CastingTimeIndex"].ToString()));
- mask = uint.Parse(row["AttributesEx6"].ToString());
- flagg = 1;
+ var loadDurations = (SpellDuration)DBCManager.GetInstance().FindDbcForBinding("SpellDuration");
+ Duration.ThreadSafeIndex = loadDurations.UpdateDurationIndexes(uint.Parse(row["DurationIndex"].ToString()));
- foreach (ThreadSafeCheckBox attribute6 in attributes6)
- {
- attribute6.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
+ var loadRanges = (SpellRange)DBCManager.GetInstance().FindDbcForBinding("SpellRange");
+ Range.ThreadSafeIndex = loadRanges.UpdateSpellRangeSelection(uint.Parse(row["RangeIndex"].ToString()));
- updateProgress("Updating stances...");
- mask = uint.Parse(row["Stances"].ToString());
- if (mask == 0)
- {
- stancesBoxes[0].ThreadSafeChecked = true;
- for (int f = 1; f < stancesBoxes.Count; ++f) { stancesBoxes[f].ThreadSafeChecked = false; }
- }
- else
- {
- stancesBoxes[0].ThreadSafeChecked = false;
- uint flag = 1;
- for (int f = 1; f < stancesBoxes.Count; ++f)
+ CasterAuraState.ThreadSafeIndex = uint.Parse(row["CasterAuraState"].ToString());
+ TargetAuraState.ThreadSafeIndex = uint.Parse(row["TargetAuraState"].ToString());
+ CasterAuraStateNot.ThreadSafeIndex = uint.Parse(row["CasterAuraStateNot"].ToString());
+ TargetAuraStateNot.ThreadSafeIndex = uint.Parse(row["TargetAuraStateNot"].ToString());
+
+ MaximumLevel.ThreadSafeText = uint.Parse(row["MaximumLevel"].ToString());
+ BaseLevel.ThreadSafeText = uint.Parse(row["BaseLevel"].ToString());
+ SpellLevel.ThreadSafeText = uint.Parse(row["SpellLevel"].ToString());
+
+ RecoveryTime.ThreadSafeText = uint.Parse(row["RecoveryTime"].ToString());
+ CategoryRecoveryTime.ThreadSafeText = uint.Parse(row["CategoryRecoveryTime"].ToString());
+
+ StartRecoveryTime.ThreadSafeText = row["StartRecoveryTime"].ToString();
+ MaxTargetsLevel.ThreadSafeText = row["MaximumTargetLevel"].ToString();
+ MaxTargets.ThreadSafeText = row["MaximumAffectedTargets"].ToString();
+
+ if (isWotlkOrGreater)
+ {
+ var loadRuneCosts = (SpellRuneCost)DBCManager.GetInstance().FindDbcForBinding("SpellRuneCost");
+ RuneCost.ThreadSafeIndex = loadRuneCosts.UpdateSpellRuneCostSelection(uint.Parse(row["RuneCostID"].ToString()));
+ }
+ RuneCost.IsEnabled = isWotlkOrGreater;
+
+ if (row.Table.Columns.Contains("SpellPriority"))
+ {
+ SpellPriority.ThreadSafeText = int.Parse(row["SpellPriority"].ToString());
+ SpellPriority.IsEnabled = true;
+ }
+ else
+ {
+ SpellPriority.IsEnabled = false;
+ }
+
+ SpellVisual1.ThreadSafeText = row["SpellVisual1"].ToString();
+ SpellVisual2.ThreadSafeText = row["SpellVisual2"].ToString();
+ Speed.ThreadSafeText = row["Speed"].ToString();
+
+ if (isWotlkOrGreater)
+ {
+ SpellMissileID.ThreadSafeText = row["SpellMissileID"].ToString();
+
+ var loadDifficulties = (SpellDifficulty)DBCManager.GetInstance().FindDbcForBinding("SpellDifficulty");
+ var loadDescriptionVariables = (SpellDescriptionVariables)DBCManager.GetInstance().FindDbcForBinding("SpellDescriptionVariables");
+ SpellDescriptionVariables.ThreadSafeIndex = loadDescriptionVariables.UpdateSpellDescriptionVariablesSelection(
+ uint.Parse(row["SpellDescriptionVariableID"].ToString()));
+
+ Difficulty.ThreadSafeIndex = loadDifficulties.UpdateDifficultySelection(uint.Parse(row["SpellDifficultyID"].ToString()));
+ }
+ SpellMissileID.IsEnabled = isWotlkOrGreater;
+ SpellDescriptionVariables.IsEnabled = isWotlkOrGreater;
+
+ Stacks.ThreadSafeText = row["StackAmount"].ToString();
+
+ Difficulty.IsEnabled = isWotlkOrGreater;
+
+ uint powerType = uint.Parse(row["PowerType"].ToString());
+ // Manually handle 'Health' power type
+ if (powerType == (uint.MaxValue - 1))
+ powerType = 13;
+ PowerType.ThreadSafeIndex = powerType;
+ PowerCost.ThreadSafeText = uint.Parse(row["ManaCost"].ToString());
+ ManaCostPerLevel.ThreadSafeText = uint.Parse(row["ManaCostPerLevel"].ToString());
+ ManaCostPerSecond.ThreadSafeText = uint.Parse(row["ManaPerSecond"].ToString());
+ PerSecondPerLevel.ThreadSafeText = uint.Parse(row["ManaPerSecondPerLevel"].ToString());
+
+ if (isTbcOrGreater)
+ {
+ var loadTotemCategories = (TotemCategory)DBCManager.GetInstance().FindDbcForBinding("TotemCategory");
+ TotemCategory1.ThreadSafeIndex = loadTotemCategories.UpdateTotemCategoriesSelection(uint.Parse(row["TotemCategory1"].ToString()));
+ TotemCategory2.ThreadSafeIndex = loadTotemCategories.UpdateTotemCategoriesSelection(uint.Parse(row["TotemCategory2"].ToString()));
+ }
+ TotemCategory1.IsEnabled = isTbcOrGreater;
+ TotemCategory2.IsEnabled = isTbcOrGreater;
+
+ if (isWotlkOrGreater)
+ {
+ var loadAreaGroups = (AreaGroup)DBCManager.GetInstance().FindDbcForBinding("AreaGroup");
+ AreaGroup.ThreadSafeIndex = loadAreaGroups.UpdateAreaGroupSelection(uint.Parse(row["AreaGroupID"].ToString()));
+ }
+ AreaGroup.IsEnabled = isWotlkOrGreater;
+
+ ManaCostPercent.ThreadSafeText = row["ManaCostPercentage"].ToString();
+ StartRecoveryCategory.ThreadSafeText = row["StartRecoveryCategory"].ToString();
+
+ LoadSpellFamilyFlags();
+
+ SpellDamageType.ThreadSafeIndex = int.Parse(row["DamageClass"].ToString());
+ PreventionType.ThreadSafeIndex = int.Parse(row["PreventionType"].ToString());
+
+ var loadFocusObjects = (SpellFocusObject)DBCManager.GetInstance().FindDbcForBinding("SpellFocusObject");
+ RequiresSpellFocus.ThreadSafeIndex = loadFocusObjects.UpdateSpellFocusObjectSelection(uint.Parse(row["RequiresSpellFocus"].ToString()));
+
+ mask = uint.Parse(row["SchoolMask"].ToString());
+ if (isTbcOrGreater)
+ {
+ S1.ThreadSafeChecked = ((mask & 0x01) != 0);
+ S2.ThreadSafeChecked = ((mask & 0x02) != 0);
+ S3.ThreadSafeChecked = ((mask & 0x04) != 0);
+ S4.ThreadSafeChecked = ((mask & 0x08) != 0);
+ S5.ThreadSafeChecked = ((mask & 0x10) != 0);
+ S6.ThreadSafeChecked = ((mask & 0x20) != 0);
+ S7.ThreadSafeChecked = ((mask & 0x40) != 0);
+ }
+ else
+ {
+ S1.ThreadSafeChecked = mask == 1;
+ S2.ThreadSafeChecked = mask == 2;
+ S3.ThreadSafeChecked = mask == 3;
+ S4.ThreadSafeChecked = mask == 4;
+ S5.ThreadSafeChecked = mask == 5;
+ S6.ThreadSafeChecked = mask == 6;
+ S7.ThreadSafeChecked = mask == 7;
+ }
+
+ if (isTbcOrGreater)
+ {
+ mask = uint.Parse(row["FacingCasterFlags"].ToString());
+ FacingFrontFlag.ThreadSafeChecked = ((mask & 0x1) != 0);
+ }
+ FacingFrontFlag.IsEnabled = isTbcOrGreater;
+
+ CasterAuraSpell.ThreadSafeText = row["CasterAuraSpell"].ToString();
+ TargetAuraSpell.ThreadSafeText = row["TargetAuraSpell"].ToString();
+ ExcludeCasterAuraSpell.ThreadSafeText = row["ExcludeCasterAuraSpell"].ToString();
+ ExcludeTargetAuraSpell.ThreadSafeText = row["ExcludeTargetAuraSpell"].ToString();
+
+ StanceBarOrder.ThreadSafeText = row["StanceBarOrder"].ToString();
+ PowerDisplayId.ThreadSafeText = row["PowerDisplayId"].ToString();
+ }
+ break;
+
+ case PartialLoad.EffectsPage:
{
- stancesBoxes[f].ThreadSafeChecked = ((mask & flag) != 0);
- flag += flag;
+ LoadSpellFamilyFlags();
+ uint familyName = uint.Parse(SpellFamilyName.Text);
+ if (!isWotlkOrGreater)
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
+ spellFamilyClassMaskParser?.UpdateSpellFamilyClassMask(this, familyName, isWotlkOrGreater, adapter, null)));
+ }
+ else
+ {
+ SpellMask11.ThreadSafeText = row["EffectSpellClassMaskA1"].ToString();
+ SpellMask21.ThreadSafeText = row["EffectSpellClassMaskA2"].ToString();
+ SpellMask31.ThreadSafeText = row["EffectSpellClassMaskA3"].ToString();
+ SpellMask12.ThreadSafeText = row["EffectSpellClassMaskB1"].ToString();
+ SpellMask22.ThreadSafeText = row["EffectSpellClassMaskB2"].ToString();
+ SpellMask32.ThreadSafeText = row["EffectSpellClassMaskB3"].ToString();
+ SpellMask13.ThreadSafeText = row["EffectSpellClassMaskC1"].ToString();
+ SpellMask23.ThreadSafeText = row["EffectSpellClassMaskC2"].ToString();
+ SpellMask33.ThreadSafeText = row["EffectSpellClassMaskC3"].ToString();
+
+ var masks = new List
+ {
+ uint.Parse(row["EffectSpellClassMaskA1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskA2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskA3"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskB3"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC1"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC2"].ToString()),
+ uint.Parse(row["EffectSpellClassMaskC3"].ToString())
+ };
+
+ UpdateSpellMaskCheckBox(masks[0], SpellMask11);
+ UpdateSpellMaskCheckBox(masks[1], SpellMask21);
+ UpdateSpellMaskCheckBox(masks[2], SpellMask31);
+ UpdateSpellMaskCheckBox(masks[3], SpellMask12);
+ UpdateSpellMaskCheckBox(masks[4], SpellMask22);
+ UpdateSpellMaskCheckBox(masks[5], SpellMask32);
+ UpdateSpellMaskCheckBox(masks[6], SpellMask13);
+ UpdateSpellMaskCheckBox(masks[7], SpellMask23);
+ UpdateSpellMaskCheckBox(masks[8], SpellMask33);
+
+ Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
+ spellFamilyClassMaskParser.UpdateSpellFamilyClassMask(this, familyName, isWotlkOrGreater, GetDBAdapter(), masks)));
+
+ ToggleAllSpellMaskCheckBoxes(isWotlkOrGreater);
+ }
+
+ mask = uint.Parse(row["Targets"].ToString());
+ if (mask == 0)
+ {
+ targetBoxes[0].ThreadSafeChecked = true;
+ for (int f = 1; f < targetBoxes.Count; ++f) { targetBoxes[f].ThreadSafeChecked = false; }
+ }
+ else
+ {
+ targetBoxes[0].ThreadSafeChecked = false;
+ uint flag = 1;
+ for (int f = 1; f < targetBoxes.Count; ++f)
+ {
+ targetBoxes[f].ThreadSafeChecked = ((mask & flag) != 0);
+ flag += flag;
+ }
+ }
+
+ mask = uint.Parse(row["ProcFlags"].ToString());
+ if (mask == 0)
+ {
+ procBoxes[0].ThreadSafeChecked = true;
+ for (int f = 1; f < procBoxes.Count; ++f) { procBoxes[f].ThreadSafeChecked = false; }
+ }
+ else
+ {
+ procBoxes[0].ThreadSafeChecked = false;
+ uint flag = 1;
+ for (int f = 1; f < procBoxes.Count; ++f)
+ {
+ procBoxes[f].ThreadSafeChecked = ((mask & flag) != 0);
+ flag += flag;
+ }
+ }
+
+ ProcChance.ThreadSafeText = uint.Parse(row["ProcChance"].ToString());
+ ProcCharges.ThreadSafeText = uint.Parse(row["ProcCharges"].ToString());
+
+ SpellEffect1.SetTextFromIndex(uint.Parse(row["Effect1"].ToString()));
+ SpellEffect2.SetTextFromIndex(uint.Parse(row["Effect2"].ToString()));
+ SpellEffect3.SetTextFromIndex(uint.Parse(row["Effect3"].ToString()));
+ DieSides1.ThreadSafeText = row["EffectDieSides1"].ToString();
+ DieSides2.ThreadSafeText = row["EffectDieSides2"].ToString();
+ DieSides3.ThreadSafeText = row["EffectDieSides3"].ToString();
+ BasePointsPerLevel1.ThreadSafeText = row["EffectRealPointsPerLevel1"].ToString();
+ BasePointsPerLevel2.ThreadSafeText = row["EffectRealPointsPerLevel2"].ToString();
+ BasePointsPerLevel3.ThreadSafeText = row["EffectRealPointsPerLevel3"].ToString();
+ BasePoints1.ThreadSafeText = row["EffectBasePoints1"].ToString();
+ BasePoints2.ThreadSafeText = row["EffectBasePoints2"].ToString();
+ BasePoints3.ThreadSafeText = row["EffectBasePoints3"].ToString();
+ Mechanic1.ThreadSafeIndex = int.Parse(row["EffectMechanic1"].ToString());
+ Mechanic2.ThreadSafeIndex = int.Parse(row["EffectMechanic2"].ToString());
+ Mechanic3.ThreadSafeIndex = int.Parse(row["EffectMechanic3"].ToString());
+ TargetA1.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetA1"].ToString());
+ TargetA2.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetA2"].ToString());
+ TargetA3.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetA3"].ToString());
+ TargetB1.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetB1"].ToString());
+ TargetB2.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetB2"].ToString());
+ TargetB3.ThreadSafeIndex = uint.Parse(row["EffectImplicitTargetB3"].ToString());
+
+ var loadRadiuses = (SpellRadius)DBCManager.GetInstance().FindDbcForBinding("SpellRadius");
+ RadiusIndex1.ThreadSafeIndex = loadRadiuses.UpdateRadiusIndexes(uint.Parse(row["EffectRadiusIndex1"].ToString()));
+ RadiusIndex2.ThreadSafeIndex = loadRadiuses.UpdateRadiusIndexes(uint.Parse(row["EffectRadiusIndex2"].ToString()));
+ RadiusIndex3.ThreadSafeIndex = loadRadiuses.UpdateRadiusIndexes(uint.Parse(row["EffectRadiusIndex3"].ToString()));
+
+ ApplyAuraName1.SetTextFromIndex(uint.Parse(row["EffectApplyAuraName1"].ToString()));
+ ApplyAuraName2.SetTextFromIndex(uint.Parse(row["EffectApplyAuraName2"].ToString()));
+ ApplyAuraName3.SetTextFromIndex(uint.Parse(row["EffectApplyAuraName3"].ToString()));
+ Amplitude1.ThreadSafeText = row["EffectAmplitude1"].ToString();
+ Amplitude2.ThreadSafeText = row["EffectAmplitude2"].ToString();
+ Amplitude3.ThreadSafeText = row["EffectAmplitude3"].ToString();
+ MultipleValue1.ThreadSafeText = row["EffectMultipleValue1"].ToString();
+ MultipleValue2.ThreadSafeText = row["EffectMultipleValue2"].ToString();
+ MultipleValue3.ThreadSafeText = row["EffectMultipleValue3"].ToString();
+ ChainTarget1.ThreadSafeText = row["EffectChainTarget1"].ToString();
+ ChainTarget2.ThreadSafeText = row["EffectChainTarget2"].ToString();
+ ChainTarget3.ThreadSafeText = row["EffectChainTarget3"].ToString();
+ ItemType1.ThreadSafeText = row["EffectItemType1"].ToString();
+ ItemType2.ThreadSafeText = row["EffectItemType2"].ToString();
+ ItemType3.ThreadSafeText = row["EffectItemType3"].ToString();
+ MiscValueA1.ThreadSafeText = row["EffectMiscValue1"].ToString();
+ MiscValueA2.ThreadSafeText = row["EffectMiscValue2"].ToString();
+ MiscValueA3.ThreadSafeText = row["EffectMiscValue3"].ToString();
+ if (isTbcOrGreater)
+ {
+ MiscValueB1.ThreadSafeText = row["EffectMiscValueB1"].ToString();
+ MiscValueB2.ThreadSafeText = row["EffectMiscValueB2"].ToString();
+ MiscValueB3.ThreadSafeText = row["EffectMiscValueB3"].ToString();
+ }
+ MiscValueB1.IsEnabled = isTbcOrGreater;
+ MiscValueB2.IsEnabled = isTbcOrGreater;
+ MiscValueB3.IsEnabled = isTbcOrGreater;
+ TriggerSpell1.ThreadSafeText = row["EffectTriggerSpell1"].ToString();
+ TriggerSpell2.ThreadSafeText = row["EffectTriggerSpell2"].ToString();
+ TriggerSpell3.ThreadSafeText = row["EffectTriggerSpell3"].ToString();
+ PointsPerComboPoint1.ThreadSafeText = row["EffectPointsPerComboPoint1"].ToString();
+ PointsPerComboPoint2.ThreadSafeText = row["EffectPointsPerComboPoint2"].ToString();
+ PointsPerComboPoint3.ThreadSafeText = row["EffectPointsPerComboPoint3"].ToString();
+
+ EffectDamageMultiplier1.ThreadSafeText = row["EffectDamageMultiplier1"].ToString();
+ EffectDamageMultiplier2.ThreadSafeText = row["EffectDamageMultiplier2"].ToString();
+ EffectDamageMultiplier3.ThreadSafeText = row["EffectDamageMultiplier3"].ToString();
+
+ if (isWotlkOrGreater)
+ {
+ EffectBonusMultiplier1.ThreadSafeText = row["EffectBonusMultiplier1"].ToString();
+ EffectBonusMultiplier2.ThreadSafeText = row["EffectBonusMultiplier2"].ToString();
+ EffectBonusMultiplier3.ThreadSafeText = row["EffectBonusMultiplier3"].ToString();
+ }
+ EffectBonusMultiplier1.IsEnabled = isWotlkOrGreater;
+ EffectBonusMultiplier2.IsEnabled = isWotlkOrGreater;
+ EffectBonusMultiplier3.IsEnabled = isWotlkOrGreater;
+
+ FilterClassMaskSpells1.IsEnabled = isWotlkOrGreater;
+ FilterClassMaskSpells2.IsEnabled = isWotlkOrGreater;
+ FilterClassMaskSpells3.IsEnabled = isWotlkOrGreater;
+
}
- }
- }
- if (isWotlkOrGreater)
- {
- mask = uint.Parse(row["AttributesEx7"].ToString());
- flagg = 1;
+ break;
- foreach (ThreadSafeCheckBox attribute7 in attributes7)
- {
- attribute7.ThreadSafeChecked = ((mask & flagg) != 0);
- flagg += flagg;
- }
- }
- attributes5.ForEach(box => box.IsEnabled = isTbcOrGreater);
- attributes6.ForEach(box => box.IsEnabled = isTbcOrGreater);
- attributes7.ForEach(box => box.IsEnabled = isWotlkOrGreater);
- stancesBoxes.ForEach(box => box.IsEnabled = isTbcOrGreater);
-
- updateProgress("Updating targets...");
- mask = uint.Parse(row["Targets"].ToString());
- if (mask == 0)
- {
- targetBoxes[0].ThreadSafeChecked = true;
- for (int f = 1; f < targetBoxes.Count; ++f) { targetBoxes[f].ThreadSafeChecked = false; }
- }
- else
- {
- targetBoxes[0].ThreadSafeChecked = false;
- uint flag = 1;
- for (int f = 1; f < targetBoxes.Count; ++f)
- {
- targetBoxes[f].ThreadSafeChecked = ((mask & flag) != 0);
- flag += flag;
- }
- }
+ case PartialLoad.ItemsPage:
+ {
+ Totem1.ThreadSafeText = row["Totem1"].ToString();
+ Totem2.ThreadSafeText = row["Totem2"].ToString();
+ Reagent1.ThreadSafeText = row["Reagent1"].ToString();
+ Reagent2.ThreadSafeText = row["Reagent2"].ToString();
+ Reagent3.ThreadSafeText = row["Reagent3"].ToString();
+ Reagent4.ThreadSafeText = row["Reagent4"].ToString();
+ Reagent5.ThreadSafeText = row["Reagent5"].ToString();
+ Reagent6.ThreadSafeText = row["Reagent6"].ToString();
+ Reagent7.ThreadSafeText = row["Reagent7"].ToString();
+ Reagent8.ThreadSafeText = row["Reagent8"].ToString();
+ ReagentCount1.ThreadSafeText = row["ReagentCount1"].ToString();
+ ReagentCount2.ThreadSafeText = row["ReagentCount2"].ToString();
+ ReagentCount3.ThreadSafeText = row["ReagentCount3"].ToString();
+ ReagentCount4.ThreadSafeText = row["ReagentCount4"].ToString();
+ ReagentCount5.ThreadSafeText = row["ReagentCount5"].ToString();
+ ReagentCount6.ThreadSafeText = row["ReagentCount6"].ToString();
+ ReagentCount7.ThreadSafeText = row["ReagentCount7"].ToString();
+ ReagentCount8.ThreadSafeText = row["ReagentCount8"].ToString();
+
+ int ID = int.Parse(row["EquippedItemClass"].ToString());
+ if (ID == -1)
+ {
+ EquippedItemClass.ThreadSafeIndex = 0;
+ //foreach (ThreadSafeCheckBox box in main.equippedItemInventoryTypeMaskBoxes)
+ // box.threadSafeChecked = false;
+ Dispatcher.Invoke(DispatcherPriority.Send, TimeSpan.Zero, new Func