diff --git a/HaRepacker/Converter/BooleanToVisibilityConverter.cs b/HaRepacker/Converter/BooleanToVisibilityConverter.cs
new file mode 100644
index 00000000..37434229
--- /dev/null
+++ b/HaRepacker/Converter/BooleanToVisibilityConverter.cs
@@ -0,0 +1,34 @@
+using HaRepacker.GUI.Controls;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows;
+
+namespace HaRepacker.Converter {
+
+ ///
+ /// Boolean to System.Windows.Visiblity converter.
+ /// If true, return Visiblity.Collapsed
+ /// otherelse return Visibility.Visible
+ ///
+ public class BooleanToVisibilityConverter : IValueConverter {
+
+ public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
+ bool res = (bool)value;
+
+ if (res)
+ return Visibility.Collapsed;
+
+ return Visibility.Visible;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
+ Visibility visibility = (Visibility)value;
+
+ return visibility == Visibility.Collapsed ? true: false;
+ }
+ }
+}
diff --git a/HaRepacker/GUI/OptionsForm.Designer.cs b/HaRepacker/GUI/OptionsForm.Designer.cs
index 8ac69513..499a004f 100644
--- a/HaRepacker/GUI/OptionsForm.Designer.cs
+++ b/HaRepacker/GUI/OptionsForm.Designer.cs
@@ -46,14 +46,8 @@ private void InitializeComponent()
this.themeColor__comboBox = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
- this.openAI_apiKey_textBox = new System.Windows.Forms.TextBox();
- this.label6 = new System.Windows.Forms.Label();
- this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.panel1.SuspendLayout();
- this.panel2.SuspendLayout();
this.SuspendLayout();
//
// sortBox
@@ -166,47 +160,15 @@ private void InitializeComponent()
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
- // panel2
- //
- this.panel2.Controls.Add(this.linkLabel1);
- this.panel2.Controls.Add(this.label6);
- this.panel2.Controls.Add(this.openAI_apiKey_textBox);
- this.panel2.Controls.Add(this.label4);
- resources.ApplyResources(this.panel2, "panel2");
- this.panel2.Name = "panel2";
- //
- // label4
- //
- resources.ApplyResources(this.label4, "label4");
- this.label4.Name = "label4";
- //
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
- // openAI_apiKey_textBox
- //
- resources.ApplyResources(this.openAI_apiKey_textBox, "openAI_apiKey_textBox");
- this.openAI_apiKey_textBox.Name = "openAI_apiKey_textBox";
- //
- // label6
- //
- resources.ApplyResources(this.label6, "label6");
- this.label6.Name = "label6";
- //
- // linkLabel1
- //
- resources.ApplyResources(this.linkLabel1, "linkLabel1");
- this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.TabStop = true;
- this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
- //
// OptionsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
@@ -214,8 +176,6 @@ private void InitializeComponent()
this.Name = "OptionsForm";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
this.ResumeLayout(false);
}
@@ -239,10 +199,5 @@ private void InitializeComponent()
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.LinkLabel linkLabel1;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.TextBox openAI_apiKey_textBox;
- private System.Windows.Forms.Label label4;
}
}
\ No newline at end of file
diff --git a/HaRepacker/GUI/OptionsForm.cs b/HaRepacker/GUI/OptionsForm.cs
index 9269b90b..5cdfe207 100644
--- a/HaRepacker/GUI/OptionsForm.cs
+++ b/HaRepacker/GUI/OptionsForm.cs
@@ -32,9 +32,6 @@ public OptionsForm()
// Theme color
themeColor__comboBox.SelectedIndex = Program.ConfigurationManager.UserSettings.ThemeColor;
-
- // API Key
- openAI_apiKey_textBox.Text = Program.ConfigurationManager.ApplicationSettings.OpenAI_ApiKey;
}
@@ -80,9 +77,6 @@ private void okButton_Click(object sender, EventArgs e)
Program.ConfigurationManager.UserSettings.LineBreakType = (LineBreak)lineBreakBox.SelectedIndex;
Program.ConfigurationManager.UserSettings.ThemeColor = themeColor__comboBox.SelectedIndex;
- // APi key
- Program.ConfigurationManager.ApplicationSettings.OpenAI_ApiKey = openAI_apiKey_textBox.Text;
-
Program.ConfigurationManager.Save();
Close();
}
diff --git a/HaRepacker/GUI/OptionsForm.resx b/HaRepacker/GUI/OptionsForm.resx
index cd446233..92d827cb 100644
--- a/HaRepacker/GUI/OptionsForm.resx
+++ b/HaRepacker/GUI/OptionsForm.resx
@@ -160,7 +160,7 @@
19
- Autoload related Wz (Map.wz, Map001.wz, Map002.wz)
+ Auto-load related Wz (Map.wz, Map001.wz, Map002.wz)
loadRelated
@@ -175,7 +175,7 @@
6
- 4, 399
+ 2, 289
157, 33
@@ -196,10 +196,10 @@
$this
- 3
+ 2
- 163, 399
+ 161, 289
157, 33
@@ -220,7 +220,7 @@
$this
- 2
+ 1
True
@@ -550,135 +550,6 @@
$this
- 1
-
-
- NoControl
-
-
- 42, 48
-
-
- 243, 18
-
-
- 0
-
-
- https://platform.openai.com/account/api-keys
-
-
- linkLabel1
-
-
- System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- panel2
-
-
- 0
-
-
- True
-
-
- NoControl
-
-
- 6, 26
-
-
- 85, 13
-
-
- 21
-
-
- OpenAI API key
-
-
- label6
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- panel2
-
-
- 1
-
-
- 97, 23
-
-
- 214, 22
-
-
- 1
-
-
- openAI_apiKey_textBox
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- panel2
-
-
- 2
-
-
- Segoe UI, 9.75pt, style=Bold
-
-
- NoControl
-
-
- 3, 3
-
-
- 38, 13
-
-
- 0
-
-
- AI
-
-
- label4
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- panel2
-
-
- 3
-
-
- 0, 292
-
-
- 323, 75
-
-
- 21
-
-
- panel2
-
-
- System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
0
@@ -688,14 +559,11 @@
6, 13
- 323, 435
+ 323, 327
Segoe UI, 8pt
-
- NoControl
-
CenterParent
diff --git a/HaRepacker/GUI/Panels/MainPanel.xaml b/HaRepacker/GUI/Panels/MainPanel.xaml
index ac2c012a..43a69d82 100644
--- a/HaRepacker/GUI/Panels/MainPanel.xaml
+++ b/HaRepacker/GUI/Panels/MainPanel.xaml
@@ -3,15 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+
+ xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
+
xmlns:local="clr-namespace:HaRepacker"
-
+ xmlns:converter="clr-namespace:HaRepacker.Converter"
xmlns:sharedLib="clr-namespace:HaSharedLibrary.GUI;assembly=HaSharedLibrary"
+ xmlns:guiControls="clr-namespace:HaRepacker.GUI.Controls"
xmlns:localgui ="clr-namespace:HaRepacker.GUI"
xmlns:localSubPanels ="clr-namespace:HaRepacker.GUI.Panels.SubPanels"
- xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
+
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
-
d:DesignHeight="661" d:DesignWidth="1599">
@@ -61,6 +66,8 @@
+
+
+
+
+
+
@@ -141,6 +176,7 @@
+
@@ -226,13 +262,12 @@
-
-
+
@@ -241,30 +276,26 @@
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -281,6 +312,7 @@
+
@@ -292,8 +324,32 @@
DoubleClick="DataTree_DoubleClick"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -338,7 +394,6 @@
-
@@ -346,15 +401,7 @@
-
-
-
-
-
-
+
@@ -363,8 +410,6 @@
-
-
@@ -431,7 +476,4 @@
-
-
-
diff --git a/HaRepacker/GUI/Panels/MainPanel.xaml.cs b/HaRepacker/GUI/Panels/MainPanel.xaml.cs
index 3f4a5044..27efbd6a 100644
--- a/HaRepacker/GUI/Panels/MainPanel.xaml.cs
+++ b/HaRepacker/GUI/Panels/MainPanel.xaml.cs
@@ -35,6 +35,10 @@
using System.Net;
using HaRepacker.GUI.Panels.SubPanels;
using HaRepacker.GUI.Controls;
+using Newtonsoft.Json.Linq;
+using Xceed.Wpf.Toolkit.Core;
+using System.Diagnostics;
+using Microsoft.Xna.Framework.Graphics;
namespace HaRepacker.GUI.Panels
{
@@ -54,6 +58,12 @@ public MainForm MainForm
get { return _mainForm; }
private set { }
}
+
+ // Data binding
+ private MainPanelPropertyItems _bindingPropertyItem = new MainPanelPropertyItems();
+ //private MainPanelPropertyItemInterface _bindingPropertyItemReadOnly = new MainPanelPropertyItems_ReadOnly();
+
+
// Etc
private readonly static List clipboard = new List();
private readonly UndoRedoManager undoRedoMan;
@@ -90,14 +100,9 @@ public MainPanel(MainForm mainForm)
DataTree.ForeColor = System.Drawing.Color.White;
}
- nameBox.Header = "Name";
- textPropBox.Header = "Value";
- textPropBox.ButtonClicked += applyChangesButton_Click;
-
- vectorPanel.ButtonClicked += VectorPanel_ButtonClicked;
-
- textPropBox.Visibility = Visibility.Collapsed;
- //nameBox.Visibility = Visibility.Collapsed;
+ // data binding stuff
+ propertyGrid.DataContext = _bindingPropertyItem;
+ _bindingPropertyItem.PropertyChanged += propertyGrid_PropertyChanged_1;
// Storyboard
System.Windows.Media.Animation.Storyboard sbb = (System.Windows.Media.Animation.Storyboard)(this.FindResource("Storyboard_Find_FadeIn"));
@@ -120,8 +125,8 @@ public MainPanel(MainForm mainForm)
private void MainPanelXAML_Loaded(object sender, RoutedEventArgs e)
{
- this.fieldLimitPanel1.SetTextboxOnFieldLimitChange(textPropBox);
- this.fieldTypePanel.SetTextboxOnFieldTypeChange(textPropBox);
+ this.fieldLimitPanel1.FieldLimitChanged += FieldLimitPanel1_FieldLimitChanged;
+ //this.fieldTypePanel.SetTextboxOnFieldTypeChange(textPropBox);
}
#region Exported Fields
@@ -144,9 +149,10 @@ private void DataTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEv
{
return;
}
-
ShowObjectValue((WzObject)DataTree.SelectedNode.Tag);
- selectionLabel.Text = string.Format(Properties.Resources.SelectionType, ((WzNode)DataTree.SelectedNode).GetTypeName());
+
+ _bindingPropertyItem.WzFileType = ((WzNode)DataTree.SelectedNode).GetTypeName();
+ //selectionLabel.Text = string.Format(Properties.Resources.SelectionType, ((WzNode)DataTree.SelectedNode).GetTypeName());
}
///
@@ -702,124 +708,6 @@ private void nextLoopTime_comboBox_SelectedIndexChanged(object sender, EventArgs
#endregion
#region Buttons
- private void nameBox_ButtonClicked(object sender, EventArgs e)
- {
- if (DataTree.SelectedNode == null) return;
- if (DataTree.SelectedNode.Tag is WzFile)
- {
- ((WzFile)DataTree.SelectedNode.Tag).Header.Copyright = nameBox.Text;
- ((WzFile)DataTree.SelectedNode.Tag).Header.RecalculateFileStart();
- }
- else if (WzNode.CanNodeBeInserted((WzNode)DataTree.SelectedNode.Parent, nameBox.Text))
- {
- string text = nameBox.Text;
- ((WzNode)DataTree.SelectedNode).ChangeName(text);
- nameBox.Text = text;
- nameBox.ApplyButtonEnabled = false;
- }
- else
- Warning.Error(Properties.Resources.MainNodeExists);
-
- }
-
- ///
- /// On vector panel 'apply' button clicked
- ///
- ///
- ///
- private void VectorPanel_ButtonClicked(object sender, EventArgs e)
- {
- applyChangesButton_Click(null, null);
- }
-
- private void applyChangesButton_Click(object sender, EventArgs e)
- {
- if (DataTree.SelectedNode == null)
- return;
-
- string setText = textPropBox.Text;
-
- WzObject obj = (WzObject)DataTree.SelectedNode.Tag;
- if (obj is WzImageProperty imageProperty)
- {
- imageProperty.ParentImage.Changed = true;
- }
-
- if (obj is WzVectorProperty vectorProperty)
- {
- vectorProperty.X.Value = vectorPanel.X;
- vectorProperty.Y.Value = vectorPanel.Y;
- }
- else if (obj is WzStringProperty stringProperty)
- {
- if (!stringProperty.IsSpineAtlasResources)
- {
- stringProperty.Value = setText;
- } else
- {
- throw new NotSupportedException("Usage of textBoxProp for spine WzStringProperty.");
- }
- }
- else if (obj is WzFloatProperty floatProperty)
- {
- float val;
- if (!float.TryParse(setText, out val))
- {
- Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
- return;
- }
- floatProperty.Value = val;
- }
- else if (obj is WzIntProperty intProperty)
- {
- int val;
- if (!int.TryParse(setText, out val))
- {
- Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
- return;
- }
- intProperty.Value = val;
- }
- else if (obj is WzLongProperty longProperty)
- {
- long val;
- if (!long.TryParse(setText, out val))
- {
- Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
- return;
- }
- longProperty.Value = val;
- }
- else if (obj is WzDoubleProperty doubleProperty)
- {
- double val;
- if (!double.TryParse(setText, out val))
- {
- Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
- return;
- }
- doubleProperty.Value = val;
- }
- else if (obj is WzShortProperty shortProperty)
- {
- short val;
- if (!short.TryParse(setText, out val))
- {
- Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
- return;
- }
- shortProperty.Value = val;
- }
- else if (obj is WzUOLProperty UOLProperty)
- {
- UOLProperty.Value = setText;
- }
- else if (obj is WzLuaProperty)
- {
- throw new NotSupportedException("Moved to TextEditor_SaveButtonClicked()");
- }
- }
-
///
/// On texteditor save button clicked
///
@@ -830,12 +718,16 @@ private void TextEditor_SaveButtonClicked(object sender, EventArgs e)
if (DataTree.SelectedNode == null)
return;
+ WzNode node = (WzNode)DataTree.SelectedNode;
WzObject obj = (WzObject)DataTree.SelectedNode.Tag;
if (obj is WzLuaProperty luaProp)
{
string setText = textEditor.textEditor.Text;
byte[] encBytes = luaProp.EncodeDecode(Encoding.ASCII.GetBytes(setText));
luaProp.Value = encBytes;
+
+ // highlight node to the user
+ node.ChangedNodeProperty();
}
else if (obj is WzStringProperty stringProp)
{
@@ -844,167 +736,17 @@ private void TextEditor_SaveButtonClicked(object sender, EventArgs e)
string setText = textEditor.textEditor.Text;
stringProp.Value = setText;
- /* }
- else
- {
- throw new NotSupportedException("Usage of TextEditor for non-spine WzStringProperty.");
- }*/
- }
- }
-
- ///
- /// More option -- Shows ContextMenuStrip
- ///
- ///
- ///
- private void button_MoreOption_Click(object sender, RoutedEventArgs e)
- {
- Button clickSrc = (Button)sender;
-
- clickSrc.ContextMenu.IsOpen = true;
- // System.Windows.Forms.ContextMenuStrip contextMenu = new System.Windows.Forms.ContextMenuStrip();
- // contextMenu.Show(clickSrc, 0, 0);
- }
-
- ///
- /// Menu item for animation. Appears when clicking on the "..." button
- ///
- ///
- ///
- private void MenuItem_Animate_Click(object sender, RoutedEventArgs e)
- {
- StartAnimateSelectedCanvas();
- }
-
- ///
- /// Save the image animation into a JPG file
- ///
- ///
- ///
- private void MenuItem_saveImageAnimation_Click(object sender, RoutedEventArgs e)
- {
- WzObject seletedWzObject = (WzObject)DataTree.SelectedNode.Tag;
-
- if (!AnimationBuilder.IsValidAnimationWzObject(seletedWzObject))
- return;
-
- // Check executing process architecture
- /*AssemblyName executingAssemblyName = Assembly.GetExecutingAssembly().GetName();
- var assemblyArchitecture = executingAssemblyName.ProcessorArchitecture;
- if (assemblyArchitecture == ProcessorArchitecture.None)
- {
- System.Windows.Forms.MessageBox.Show(HaRepacker.Properties.Resources.ExecutingAssemblyError, HaRepacker.Properties.Resources.Warning, System.Windows.Forms.MessageBoxButtons.OK);
- return;
- }*/
-
- System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog()
- {
- Title = HaRepacker.Properties.Resources.SelectOutApng,
- Filter = string.Format("{0}|*.png", HaRepacker.Properties.Resources.ApngFilter)
- };
- if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
- return;
-
- AnimationBuilder.ExtractAnimation((WzSubProperty)seletedWzObject, dialog.FileName, Program.ConfigurationManager.UserSettings.UseApngIncompatibilityFrame);
- }
- ///
- ///
- ///
- ///
- ///
- private void MenuItem_changeImage_Click(object sender, RoutedEventArgs e)
- {
- if (DataTree.SelectedNode.Tag is WzCanvasProperty) // only allow button click if its an image property
- {
- System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog()
- {
- Title = "Select an image",
- Filter = "Supported Image Formats (*.png;*.bmp;*.jpg;*.gif;*.jpeg;*.tif;*.tiff)|*.png;*.bmp;*.jpg;*.gif;*.jpeg;*.tif;*.tiff"
- };
- if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
- return;
-
- byte[] bitmapBytes = null;
- try {
- using (System.Drawing.Bitmap originalBitmap = new System.Drawing.Bitmap(dialog.FileName)) {
- using (MemoryStream ms = new MemoryStream()) {
- originalBitmap.Save(ms, originalBitmap.RawFormat);
- bitmapBytes = ms.ToArray();
- }
- }
- }
- catch {
- Warning.Error(Properties.Resources.MainImageLoadError);
- return;
- }
- //List actions = new List(); // Undo action
-
- if (bitmapBytes != null) {
- MemoryStream ms = new MemoryStream(bitmapBytes); // dont close this
- System.Drawing.Bitmap newBitmap = new System.Drawing.Bitmap(ms);
-
- ChangeCanvasPropBoxImage(newBitmap);
- }
- }
- }
-
- ///
- /// Changes the displayed image in 'canvasPropBox' with a user defined input.
- ///
- ///
- ///
- public void ChangeCanvasPropBoxImage(Bitmap bmp)
- {
- if (DataTree.SelectedNode.Tag is WzCanvasProperty property)
- {
- WzNode parentCanvasNode = (WzNode)DataTree.SelectedNode;
-
- WzCanvasProperty selectedWzCanvas = property;
-
- if (selectedWzCanvas.ContainsInlinkProperty()) // if its an inlink property, remove that before updating base image.
- {
- selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.InlinkPropertyName]);
-
- WzNode childInlinkNode = WzNode.GetChildNode(parentCanvasNode, WzCanvasProperty.InlinkPropertyName);
-
- // Add undo actions
- //actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
- childInlinkNode.DeleteWzNode(); // Delete '_inlink' node
-
- // TODO: changing _Inlink image crashes
- // Mob2.wz/9400121/hit/0
- }
- else if (selectedWzCanvas.ContainsOutlinkProperty()) // if its an inlink property, remove that before updating base image.
- {
- selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.OutlinkPropertyName]);
-
- WzNode childInlinkNode = WzNode.GetChildNode(parentCanvasNode, WzCanvasProperty.OutlinkPropertyName);
-
- // Add undo actions
- //actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
- childInlinkNode.DeleteWzNode(); // Delete '_inlink' node
- }
-
- selectedWzCanvas.PngProperty.SetImage(bmp);
-
- canvasPropBox.SetIsLoading(true);
- try {
- canvasPropBox.BindingPropertyItem.Bitmap = bmp;
- canvasPropBox.BindingPropertyItem.BitmapBackup = bmp;
- }
- finally {
- canvasPropBox.SetIsLoading(false);
- }
-
- // flag changed for saving updates
- // and also node foreground color
- parentCanvasNode.ChangedNodeProperty();
-
- // Add undo actions
- //UndoRedoMan.AddUndoBatch(actions);
+ // highlight node to the user
+ node.ChangedNodeProperty();
+ /* }
+ else
+ {
+ throw new NotSupportedException("Usage of TextEditor for non-spine WzStringProperty.");
+ }*/
}
}
+ #endregion
#region Batch Edit
///
@@ -1325,6 +1067,20 @@ private void UpscaleImageNodesRecursively(WzNode node, Dictionary
+ /// More option -- Shows ContextMenuStrip
+ ///
+ ///
+ ///
+ private void button_MoreOption_Click(object sender, RoutedEventArgs e) {
+ Button clickSrc = (Button)sender;
+
+ clickSrc.ContextMenu.IsOpen = true;
+ // System.Windows.Forms.ContextMenuStrip contextMenu = new System.Windows.Forms.ContextMenuStrip();
+ // contextMenu.Show(clickSrc, 0, 0);
+ }
+
///
///
///
@@ -1484,38 +1240,171 @@ private void menuItem_ExportFile_Click(object sender, RoutedEventArgs e)
}
}
}
- #endregion
- #region Drag and Drop Image
- private bool bDragEnterActive = false;
///
- /// Scroll viewer drag enter
+ /// Menu item for animation. Appears when clicking on the "..." button
///
///
///
- private void canvasPropBox_DragEnter(object sender, DragEventArgs e)
- {
- System.Diagnostics.Debug.WriteLine("Drag Enter");
- if (!bDragEnterActive)
- {
- bDragEnterActive = true;
- }
+ private void MenuItem_Animate_Click(object sender, RoutedEventArgs e) {
+ StartAnimateSelectedCanvas();
}
///
- /// Scroll viewer drag leave
+ /// Save the image animation into a JPG file
///
///
///
- private void canvasPropBox_DragLeave(object sender, DragEventArgs e)
- {
- System.Diagnostics.Debug.WriteLine("Drag Leave");
+ private void MenuItem_saveImageAnimation_Click(object sender, RoutedEventArgs e) {
+ WzObject seletedWzObject = (WzObject)DataTree.SelectedNode.Tag;
- bDragEnterActive = false;
- }
- ///
- /// Scroll viewer drag drop
- ///
+ if (!AnimationBuilder.IsValidAnimationWzObject(seletedWzObject))
+ return;
+
+ // Check executing process architecture
+ /*AssemblyName executingAssemblyName = Assembly.GetExecutingAssembly().GetName();
+ var assemblyArchitecture = executingAssemblyName.ProcessorArchitecture;
+ if (assemblyArchitecture == ProcessorArchitecture.None)
+ {
+ System.Windows.Forms.MessageBox.Show(HaRepacker.Properties.Resources.ExecutingAssemblyError, HaRepacker.Properties.Resources.Warning, System.Windows.Forms.MessageBoxButtons.OK);
+ return;
+ }*/
+
+ System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog() {
+ Title = HaRepacker.Properties.Resources.SelectOutApng,
+ Filter = string.Format("{0}|*.png", HaRepacker.Properties.Resources.ApngFilter)
+ };
+ if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
+ return;
+
+ AnimationBuilder.ExtractAnimation((WzSubProperty)seletedWzObject, dialog.FileName, Program.ConfigurationManager.UserSettings.UseApngIncompatibilityFrame);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void MenuItem_changeImage_Click(object sender, RoutedEventArgs e) {
+ if (DataTree.SelectedNode.Tag is WzCanvasProperty) // only allow button click if its an image property
+ {
+ System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog() {
+ Title = "Select an image",
+ Filter = "Supported Image Formats (*.png;*.bmp;*.jpg;*.gif;*.jpeg;*.tif;*.tiff)|*.png;*.bmp;*.jpg;*.gif;*.jpeg;*.tif;*.tiff"
+ };
+ if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
+ return;
+
+ byte[] bitmapBytes = null;
+ try {
+ using (System.Drawing.Bitmap originalBitmap = new System.Drawing.Bitmap(dialog.FileName)) {
+ using (MemoryStream ms = new MemoryStream()) {
+ originalBitmap.Save(ms, originalBitmap.RawFormat);
+ bitmapBytes = ms.ToArray();
+ }
+ }
+ }
+ catch {
+ Warning.Error(Properties.Resources.MainImageLoadError);
+ return;
+ }
+ //List actions = new List(); // Undo action
+
+ if (bitmapBytes != null) {
+ MemoryStream ms = new MemoryStream(bitmapBytes); // dont close this
+ System.Drawing.Bitmap newBitmap = new System.Drawing.Bitmap(ms);
+
+ ChangeCanvasPropBoxImage(newBitmap);
+ }
+ }
+ }
+
+ ///
+ /// Changes the displayed image in 'canvasPropBox' with a user defined input.
+ ///
+ ///
+ ///
+ public void ChangeCanvasPropBoxImage(Bitmap bmp) {
+ if (DataTree.SelectedNode.Tag is WzCanvasProperty property) {
+ WzNode parentCanvasNode = (WzNode)DataTree.SelectedNode;
+
+ WzCanvasProperty selectedWzCanvas = property;
+
+ if (selectedWzCanvas.ContainsInlinkProperty()) // if its an inlink property, remove that before updating base image.
+ {
+ selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.InlinkPropertyName]);
+
+ WzNode childInlinkNode = WzNode.GetChildNode(parentCanvasNode, WzCanvasProperty.InlinkPropertyName);
+
+ // Add undo actions
+ //actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
+ childInlinkNode.DeleteWzNode(); // Delete '_inlink' node
+
+ // TODO: changing _Inlink image crashes
+ // Mob2.wz/9400121/hit/0
+ }
+ else if (selectedWzCanvas.ContainsOutlinkProperty()) // if its an inlink property, remove that before updating base image.
+ {
+ selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.OutlinkPropertyName]);
+
+ WzNode childInlinkNode = WzNode.GetChildNode(parentCanvasNode, WzCanvasProperty.OutlinkPropertyName);
+
+ // Add undo actions
+ //actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
+ childInlinkNode.DeleteWzNode(); // Delete '_inlink' node
+ }
+
+ selectedWzCanvas.PngProperty.SetImage(bmp);
+
+ canvasPropBox.SetIsLoading(true);
+ try {
+ canvasPropBox.BindingPropertyItem.Bitmap = bmp;
+ canvasPropBox.BindingPropertyItem.BitmapBackup = bmp;
+ }
+ finally {
+ canvasPropBox.SetIsLoading(false);
+ }
+
+ // flag changed for saving updates
+ // and also node foreground color
+ parentCanvasNode.ChangedNodeProperty();
+
+ // Add undo actions
+ //UndoRedoMan.AddUndoBatch(actions);
+ }
+ }
+ #endregion
+
+ #region Drag and Drop Image
+ private bool bDragEnterActive = false;
+ ///
+ /// Scroll viewer drag enter
+ ///
+ ///
+ ///
+ private void canvasPropBox_DragEnter(object sender, DragEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Drag Enter");
+ if (!bDragEnterActive)
+ {
+ bDragEnterActive = true;
+ }
+ }
+
+ ///
+ /// Scroll viewer drag leave
+ ///
+ ///
+ ///
+ private void canvasPropBox_DragLeave(object sender, DragEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Drag Leave");
+
+ bDragEnterActive = false;
+ }
+ ///
+ /// Scroll viewer drag drop
+ ///
///
///
private void canvasPropBox_Drop(object sender, DragEventArgs e)
@@ -1700,327 +1589,312 @@ private void ShowObjectValue(WzObject obj)
if (obj.WzFileParent != null && obj.WzFileParent.IsUnloaded) // this WZ is already unloaded from memory, dont attempt to display it (when the user clicks "reload" button while selection is on that)
return;
- mp3Player.SoundProperty = null;
- nameBox.Text = obj is WzFile file ? file.Header.Copyright : obj.Name;
- nameBox.ApplyButtonEnabled = false;
+ isLoading = true;
- toolStripStatusLabel_additionalInfo.Text = "-"; // Reset additional info to default
- if (isSelectingWzMapFieldLimit) // previously already selected. update again
- {
- isSelectingWzMapFieldLimit = false;
- }
+ try {
+ mp3Player.SoundProperty = null;
- // Canvas animation
- if (DataTree.SelectedNodes.Count <= 1)
- menuItem_Animate.Visibility = Visibility.Collapsed; // set invisible regardless if none of the nodes are selected.
- else
- {
- bool bIsAllCanvas = true;
- // check if everything selected is WzUOLProperty and WzCanvasProperty
- foreach (WzNode tree in DataTree.SelectedNodes)
+ // Set file name binding
+ _bindingPropertyItem.WzFileName = obj.Name;
+
+ toolStripStatusLabel_additionalInfo.Text = "-"; // Reset additional info to default
+ if (isSelectingWzMapFieldLimit) // previously already selected. update again
{
- WzObject wzobj = (WzObject)tree.Tag;
- if (!(wzobj is WzUOLProperty) && !(wzobj is WzCanvasProperty))
- {
- bIsAllCanvas = false;
- break;
- }
+ isSelectingWzMapFieldLimit = false;
}
- menuItem_Animate.Visibility = bIsAllCanvas ? Visibility.Visible : Visibility.Collapsed;
- }
-
- // Set default layout collapsed state
- mp3Player.Visibility = Visibility.Collapsed;
- // Button collapsed state
- menuItem_changeImage.Visibility = Visibility.Collapsed;
- menuItem_saveImage.Visibility = Visibility.Collapsed;
- menuItem_changeSound.Visibility = Visibility.Collapsed;
- menuItem_saveSound.Visibility = Visibility.Collapsed;
- menuItem_exportFile.Visibility = Visibility.Collapsed;
-
- // Canvas collapsed state
- canvasPropBox.Visibility = Visibility.Collapsed;
-
- // Value
- textPropBox.Visibility = Visibility.Collapsed;
-
- // Field limit panel Map.wz/../fieldLimit
- fieldLimitPanelHost.Visibility = Visibility.Collapsed;
- // fieldType panel Map.wz/../fieldType
- fieldTypePanel.Visibility = Visibility.Collapsed;
-
- // Vector panel
- vectorPanel.Visibility = Visibility.Collapsed;
-
- // Avalon Text editor
- textEditor.Visibility = Visibility.Collapsed;
-
- // vars
- bool bIsWzLuaProperty = obj is WzLuaProperty;
- bool bIsWzSoundProperty = obj is WzBinaryProperty;
- bool bIsWzStringProperty = obj is WzStringProperty;
- bool bIsWzIntProperty = obj is WzIntProperty;
- bool bIsWzLongProperty = obj is WzLongProperty;
- bool bIsWzDoubleProperty = obj is WzDoubleProperty;
- bool bIsWzFloatProperty = obj is WzFloatProperty;
- bool bIsWzShortProperty = obj is WzShortProperty;
-
- bool bAnimateMoreButton = false; // The button to animate when there is more option under button_MoreOption
-
- // Set layout visibility
- if (obj is WzFile || obj is WzDirectory || obj is WzImage || obj is WzNullProperty || obj is WzSubProperty || obj is WzConvexProperty)
- {
- /*if (obj is WzSubProperty) { // detect String.wz/Npc.img/ directory for AI related tools
- if (obj.Parent.Name == "Npc.img")
- {
- WzObject wzObj = obj.GetTopMostWzDirectory();
- if (wzObj.Name == "String.wz" || (wzObj.Name.StartsWith("String") && wzObj.Name.EndsWith(".wz")))
- {
+ // Canvas animation
+ if (DataTree.SelectedNodes.Count <= 1)
+ menuItem_Animate.Visibility = Visibility.Collapsed; // set invisible regardless if none of the nodes are selected.
+ else {
+ bool bIsAllCanvas = true;
+ // check if everything selected is WzUOLProperty and WzCanvasProperty
+ foreach (WzNode tree in DataTree.SelectedNodes) {
+ WzObject wzobj = (WzObject)tree.Tag;
+ if (!(wzobj is WzUOLProperty) && !(wzobj is WzCanvasProperty)) {
+ bIsAllCanvas = false;
+ break;
}
}
- }*/
- }
- else if (obj is WzCanvasProperty canvasProp)
- {
- bAnimateMoreButton = true; // flag
-
- menuItem_changeImage.Visibility = Visibility.Visible;
- menuItem_saveImage.Visibility = Visibility.Visible;
+ menuItem_Animate.Visibility = bIsAllCanvas ? Visibility.Visible : Visibility.Collapsed;
+ }
- // Image
- if (canvasProp.ContainsInlinkProperty() || canvasProp.ContainsOutlinkProperty()) {
- System.Drawing.Image img = canvasProp.GetLinkedWzCanvasBitmap();
- if (img != null) {
- canvasPropBox.BindingPropertyItem.Bitmap = (System.Drawing.Bitmap)img;
- canvasPropBox.BindingPropertyItem.BitmapBackup = (System.Drawing.Bitmap)img;
+ // Set default layout collapsed state
+ mp3Player.Visibility = Visibility.Collapsed;
+
+ // Button collapsed state
+ menuItem_changeImage.Visibility = Visibility.Collapsed;
+ menuItem_saveImage.Visibility = Visibility.Collapsed;
+ menuItem_changeSound.Visibility = Visibility.Collapsed;
+ menuItem_saveSound.Visibility = Visibility.Collapsed;
+ menuItem_exportFile.Visibility = Visibility.Collapsed;
+
+ // Canvas collapsed state
+ canvasPropBox.Visibility = Visibility.Collapsed;
+
+ // Value`
+ _bindingPropertyItem.WzFileValue = string.Empty;
+ _bindingPropertyItem.ChangeReadOnlyAttribute(true, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue);
+
+ // Field limit panel Map.wz/../fieldLimit
+ fieldLimitPanelHost.Visibility = Visibility.Collapsed;
+ // fieldType panel Map.wz/../fieldType
+ fieldTypePanel.Visibility = Visibility.Collapsed;
+
+ // Vector panel
+ //_bindingPropertyItem.XYVector = new NotifyPointF(0, 0);
+ _bindingPropertyItem.ChangeReadOnlyAttribute(true, _bindingPropertyItem, o => o.IsXYPanelReadOnly, o => o.XYVector);
+
+ // Avalon Text editor
+ textEditor.Visibility = Visibility.Collapsed;
+
+ // vars
+ bool bIsWzFile = obj is WzFile file;
+ bool bIsWzDirectory = obj is WzDirectory;
+ bool bIsWzImage = obj is WzImage;
+ bool bIsWzLuaProperty = obj is WzLuaProperty;
+ bool bIsWzSoundProperty = obj is WzBinaryProperty;
+ bool bIsWzStringProperty = obj is WzStringProperty;
+ bool bIsWzIntProperty = obj is WzIntProperty;
+ bool bIsWzLongProperty = obj is WzLongProperty;
+ bool bIsWzDoubleProperty = obj is WzDoubleProperty;
+ bool bIsWzFloatProperty = obj is WzFloatProperty;
+ bool bIsWzShortProperty = obj is WzShortProperty;
+ bool bIsWzNullProperty = obj is WzNullProperty;
+ bool bIsWzSubProperty = obj is WzSubProperty;
+ bool bIsWzConvexProperty = obj is WzConvexProperty;
+
+ bool bAnimateMoreButton = false; // The button to animate when there is more option under button_MoreOption
+
+ // Set layout visibility
+ if (bIsWzFile || bIsWzDirectory || bIsWzImage || bIsWzNullProperty || bIsWzSubProperty || bIsWzConvexProperty) {
+ /*if (obj is WzSubProperty) { // detect String.wz/Npc.img/ directory for AI related tools
+ if (obj.Parent.Name == "Npc.img")
+ {
+ WzObject wzObj = obj.GetTopMostWzDirectory();
+ if (wzObj.Name == "String.wz" || (wzObj.Name.StartsWith("String") && wzObj.Name.EndsWith(".wz")))
+ {
+ }
+ }
+ }*/
+
+ if (bIsWzFile) {
+ _bindingPropertyItem.WzFileValue = (obj as WzFile).Header.Copyright;
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // dont allow user to change fieldLimit manually
}
}
- else {
- Bitmap bmp = canvasProp.GetLinkedWzCanvasBitmap();
- canvasPropBox.BindingPropertyItem.Bitmap = bmp;
- canvasPropBox.BindingPropertyItem.BitmapBackup = bmp;
+ else if (obj is WzCanvasProperty canvasProp) {
+ bAnimateMoreButton = true; // flag
+
+ menuItem_changeImage.Visibility = Visibility.Visible;
+ menuItem_saveImage.Visibility = Visibility.Visible;
+
+ // Image
+ if (canvasProp.ContainsInlinkProperty() || canvasProp.ContainsOutlinkProperty()) {
+ System.Drawing.Image img = canvasProp.GetLinkedWzCanvasBitmap();
+ if (img != null) {
+ canvasPropBox.BindingPropertyItem.Bitmap = (System.Drawing.Bitmap)img;
+ canvasPropBox.BindingPropertyItem.BitmapBackup = (System.Drawing.Bitmap)img;
+ }
+ }
+ else {
+ Bitmap bmp = canvasProp.GetLinkedWzCanvasBitmap();
+ canvasPropBox.BindingPropertyItem.Bitmap = bmp;
+ canvasPropBox.BindingPropertyItem.BitmapBackup = bmp;
+ }
+ SetImageRenderView(canvasProp);
}
- SetImageRenderView(canvasProp);
- }
- else if (obj is WzUOLProperty uolProperty)
- {
- bAnimateMoreButton = true; // flag
+ else if (obj is WzUOLProperty uolProperty) {
+ bAnimateMoreButton = true; // flag
- // Image
- WzObject linkValue = uolProperty.LinkValue;
- if (linkValue is WzCanvasProperty canvasUOL)
- {
- canvasPropBox.Visibility = Visibility.Visible;
+ // Image
+ WzObject linkValue = uolProperty.LinkValue;
+ if (linkValue is WzCanvasProperty canvasUOL) {
+ canvasPropBox.Visibility = Visibility.Visible;
+
+ Bitmap bmp = canvasUOL.GetLinkedWzCanvasBitmap();
+ canvasPropBox.BindingPropertyItem.Bitmap = bmp; // in any event that the WzCanvasProperty is an '_inlink' or '_outlink'
+ canvasPropBox.BindingPropertyItem.BitmapBackup = bmp; // in any event that the WzCanvasProperty is an '_inlink' or '_outlink'
+
+ menuItem_saveImage.Visibility = Visibility.Visible; // dont show change image, as its a UOL
- Bitmap bmp = canvasUOL.GetLinkedWzCanvasBitmap();
- canvasPropBox.BindingPropertyItem.Bitmap = bmp; // in any event that the WzCanvasProperty is an '_inlink' or '_outlink'
- canvasPropBox.BindingPropertyItem.BitmapBackup = bmp; // in any event that the WzCanvasProperty is an '_inlink' or '_outlink'
+ SetImageRenderView(canvasUOL);
+ }
+ else if (linkValue is WzBinaryProperty binProperty) // Sound, used rarely in wz. i.e Sound.wz/Rune/1/Destroy
+ {
+ mp3Player.Visibility = Visibility.Visible;
+ mp3Player.SoundProperty = binProperty;
- menuItem_saveImage.Visibility = Visibility.Visible; // dont show change image, as its a UOL
+ menuItem_changeSound.Visibility = Visibility.Visible;
+ menuItem_saveSound.Visibility = Visibility.Visible;
+ }
- SetImageRenderView(canvasUOL);
+ // Value
+ // set wz file value binding
+ _bindingPropertyItem.WzFileValue = obj.ToString();
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // can be changed
}
- else if (linkValue is WzBinaryProperty binProperty) // Sound, used rarely in wz. i.e Sound.wz/Rune/1/Destroy
- {
+ else if (bIsWzSoundProperty) {
+ bAnimateMoreButton = true; // flag
+
mp3Player.Visibility = Visibility.Visible;
- mp3Player.SoundProperty = binProperty;
+ mp3Player.SoundProperty = (WzBinaryProperty)obj;
menuItem_changeSound.Visibility = Visibility.Visible;
menuItem_saveSound.Visibility = Visibility.Visible;
}
+ else if (bIsWzLuaProperty) {
+ textEditor.Visibility = Visibility.Visible;
+ textEditor.SetHighlightingDefinitionIndex(2); // javascript
- // Value
- textPropBox.Visibility = Visibility.Visible;
- textPropBox.ApplyButtonEnabled = false; // reset to disabled mode when changed
- textPropBox.Text = obj.ToString();
- }
- else if (bIsWzSoundProperty)
- {
- bAnimateMoreButton = true; // flag
+ textEditor.textEditor.Text = obj.ToString();
+ }
+ else if (bIsWzStringProperty || bIsWzIntProperty || bIsWzLongProperty || bIsWzDoubleProperty || bIsWzFloatProperty || bIsWzShortProperty) {
+ // If text is a string property, expand the textbox
+ if (bIsWzStringProperty) {
+ WzStringProperty stringObj = (WzStringProperty)obj;
- mp3Player.Visibility = Visibility.Visible;
- mp3Player.SoundProperty = (WzBinaryProperty)obj;
+ if (stringObj.IsSpineAtlasResources) // spine related resource
+ {
+ bAnimateMoreButton = true;
+ menuItem_exportFile.Visibility = Visibility.Visible;
- menuItem_changeSound.Visibility = Visibility.Visible;
- menuItem_saveSound.Visibility = Visibility.Visible;
- }
- else if (bIsWzLuaProperty)
- {
- textEditor.Visibility = Visibility.Visible;
- textEditor.SetHighlightingDefinitionIndex(2); // javascript
+ textEditor.Visibility = Visibility.Visible;
+ textEditor.SetHighlightingDefinitionIndex(20); // json
+ textEditor.textEditor.Text = obj.ToString();
- textEditor.textEditor.Text = obj.ToString();
- }
- else if (bIsWzStringProperty || bIsWzIntProperty || bIsWzLongProperty || bIsWzDoubleProperty || bIsWzFloatProperty || bIsWzShortProperty)
- {
- // If text is a string property, expand the textbox
- if (bIsWzStringProperty)
- {
- WzStringProperty stringObj = (WzStringProperty)obj;
- if (stringObj.IsSpineAtlasResources) // spine related resource
- {
- bAnimateMoreButton = true;
- menuItem_exportFile.Visibility = Visibility.Visible;
+ string path_title = stringObj.Parent?.FullPath ?? "Animate";
- textEditor.Visibility = Visibility.Visible;
- textEditor.SetHighlightingDefinitionIndex(20); // json
- textEditor.textEditor.Text = obj.ToString();
+ Thread thread = new Thread(() => {
+ try {
+ WzSpineAnimationItem item = new WzSpineAnimationItem(stringObj);
+ // Create xna window
+ SpineAnimationWindow Window = new SpineAnimationWindow(item, path_title);
+ Window.Run();
+ }
+ catch (Exception e) {
+ Warning.Error("Error initialising/ rendering spine object. " + e.ToString());
+ }
+ });
+ thread.Start();
+ thread.Join();
+ }
+ else if (stringObj.Name.EndsWith(".json")) // Map001.wz/Back/BM3_3.img/spine/skeleton.json
+ {
+ bAnimateMoreButton = true;
+ menuItem_exportFile.Visibility = Visibility.Visible;
- string path_title = stringObj.Parent?.FullPath ?? "Animate";
+ textEditor.Visibility = Visibility.Visible;
+ textEditor.SetHighlightingDefinitionIndex(20); // json
+ textEditor.textEditor.Text = obj.ToString();
+ }
+ else {
+ // Value
+ _bindingPropertyItem.WzFileValue = obj.ToString();
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // can be changed
- Thread thread = new Thread(() =>
- {
- try
+ if (stringObj.Name == PORTAL_NAME_OBJ_NAME) // Portal type name display - "pn" = portal name
{
- WzSpineAnimationItem item = new WzSpineAnimationItem(stringObj);
-
- // Create xna window
- SpineAnimationWindow Window = new SpineAnimationWindow(item, path_title);
- Window.Run();
+ if (MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames.ContainsKey(obj.GetString())) {
+ toolStripStatusLabel_additionalInfo.Text =
+ string.Format(Properties.Resources.MainAdditionalInfo_PortalType, MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames[obj.GetString()]);
+ }
+ else {
+ toolStripStatusLabel_additionalInfo.Text = string.Format(Properties.Resources.MainAdditionalInfo_PortalType, obj.GetString());
+ }
}
- catch (Exception e)
- {
- Warning.Error("Error initialising/ rendering spine object. " + e.ToString());
+ else {
+ //textPropBox.AcceptsReturn = true;
+ // TODO
}
- });
- thread.Start();
- thread.Join();
- }
- else if (stringObj.Name.EndsWith(".json")) // Map001.wz/Back/BM3_3.img/spine/skeleton.json
- {
- bAnimateMoreButton = true;
- menuItem_exportFile.Visibility = Visibility.Visible;
-
- textEditor.Visibility = Visibility.Visible;
- textEditor.SetHighlightingDefinitionIndex(20); // json
- textEditor.textEditor.Text = obj.ToString();
+ }
}
- else
- {
- // Value
- textPropBox.Visibility = Visibility.Visible;
- textPropBox.Text = obj.ToString();
- textPropBox.ApplyButtonEnabled = false; // reset to disabled mode when changed
-
- if (stringObj.Name == PORTAL_NAME_OBJ_NAME) // Portal type name display - "pn" = portal name
+ else if (bIsWzLongProperty || bIsWzIntProperty || bIsWzShortProperty) {
+ // field limit UI
+ if (obj.Name == FIELD_LIMIT_OBJ_NAME) // fieldLimit
{
- if (MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames.ContainsKey(obj.GetString()))
+ isSelectingWzMapFieldLimit = true;
+
+ ulong value_ = 0;
+ if (bIsWzLongProperty) // use uLong for field limit
{
- toolStripStatusLabel_additionalInfo.Text =
- string.Format(Properties.Resources.MainAdditionalInfo_PortalType, MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames[obj.GetString()]);
+ value_ = (ulong)((WzLongProperty)obj).GetLong();
}
- else
- {
- toolStripStatusLabel_additionalInfo.Text = string.Format(Properties.Resources.MainAdditionalInfo_PortalType, obj.GetString());
+ else if (bIsWzIntProperty) {
+ value_ = (ulong)((WzIntProperty)obj).GetLong();
+ }
+ else if (bIsWzShortProperty) {
+ value_ = (ulong)((WzShortProperty)obj).GetLong();
}
- }
- else
- {
- textPropBox.AcceptsReturn = true;
- }
- }
- }
- else if (bIsWzLongProperty || bIsWzIntProperty || bIsWzShortProperty)
- {
- textPropBox.Visibility = Visibility.Visible;
- textPropBox.AcceptsReturn = false;
- textPropBox.ApplyButtonEnabled = false; // reset to disabled mode when changed
- // field limit UI
- if (obj.Name == FIELD_LIMIT_OBJ_NAME) // fieldLimit
- {
- isSelectingWzMapFieldLimit = true;
+ fieldLimitPanel1.UpdateFieldLimitCheckboxes(value_);
- ulong value_ = 0;
- if (bIsWzLongProperty) // use uLong for field limit
- {
- value_ = (ulong)((WzLongProperty)obj).GetLong();
- }
- else if (bIsWzIntProperty)
- {
- value_ = (ulong)((WzIntProperty)obj).GetLong();
+ _bindingPropertyItem.WzFileValue = value_.ToString();
+ _bindingPropertyItem.ChangeReadOnlyAttribute(true, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // dont allow user to change fieldLimit manually
+
+ // Set visibility
+ fieldLimitPanelHost.Visibility = Visibility.Visible;
}
- else if (bIsWzShortProperty)
- {
- value_ = (ulong)((WzShortProperty)obj).GetLong();
+ else {
+ long value_ = 0; // long for others, in the case of negative value
+ if (bIsWzLongProperty) {
+ value_ = ((WzLongProperty)obj).GetLong();
+ }
+ else if (bIsWzIntProperty) {
+ value_ = ((WzIntProperty)obj).GetLong();
+ }
+ else if (bIsWzShortProperty) {
+ value_ = ((WzShortProperty)obj).GetLong();
+ }
+ _bindingPropertyItem.WzFileValue = value_.ToString();
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // can be changed
}
+ }
+ else if (bIsWzDoubleProperty || bIsWzFloatProperty) {
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsWzValueReadOnly, o => o.WzFileValue); // can be changed
- fieldLimitPanel1.UpdateFieldLimitCheckboxes(value_);
-
- // Set visibility
- fieldLimitPanelHost.Visibility = Visibility.Visible;
- }
- else
- {
- long value_ = 0; // long for others, in the case of negative value
- if (bIsWzLongProperty)
- {
- value_ = ((WzLongProperty)obj).GetLong();
+ if (bIsWzFloatProperty) {
+ _bindingPropertyItem.WzFileValue = ((WzFloatProperty)obj).GetFloat().ToString();
}
- else if (bIsWzIntProperty)
- {
- value_ = ((WzIntProperty)obj).GetLong();
+ else if (bIsWzDoubleProperty) {
+ _bindingPropertyItem.WzFileValue = ((WzDoubleProperty)obj).GetDouble().ToString();
}
- else if (bIsWzShortProperty)
- {
- value_ = ((WzShortProperty)obj).GetLong();
- }
- textPropBox.Text = value_.ToString();
}
- }
- else if (bIsWzDoubleProperty || bIsWzFloatProperty)
- {
- textPropBox.Visibility = Visibility.Visible;
- textPropBox.AcceptsReturn = false;
- textPropBox.ApplyButtonEnabled = false; // reset to disabled mode when changed
-
- if (bIsWzFloatProperty)
- {
- textPropBox.Text = ((WzFloatProperty)obj).GetFloat().ToString();
- }
- else if (bIsWzDoubleProperty)
- {
- textPropBox.Text = ((WzDoubleProperty)obj).GetDouble().ToString();
+ else {
+ //textPropBox.AcceptsReturn = false;
+ // TODO
}
}
- else
- {
- textPropBox.AcceptsReturn = false;
- }
- }
- else if (obj is WzVectorProperty property)
- {
- vectorPanel.Visibility = Visibility.Visible;
+ else if (obj is WzVectorProperty property) {
+ _bindingPropertyItem.XYVector.X = property.X.Value;
+ _bindingPropertyItem.XYVector.Y = property.Y.Value;
- vectorPanel.X = property.X.Value;
- vectorPanel.Y = property.Y.Value;
- }
- else
- {
- }
+ _bindingPropertyItem.ChangeReadOnlyAttribute(false, _bindingPropertyItem, o => o.IsXYPanelReadOnly, o => o.XYVector);
+ }
+ else {
+ }
- // Animation button
- if (AnimationBuilder.IsValidAnimationWzObject(obj))
- {
- bAnimateMoreButton = true; // flag
+ // Animation button
+ if (AnimationBuilder.IsValidAnimationWzObject(obj)) {
+ bAnimateMoreButton = true; // flag
- menuItem_saveImageAnimation.Visibility = Visibility.Visible;
- }
- else
- {
- menuItem_saveImageAnimation.Visibility = Visibility.Collapsed;
- }
+ menuItem_saveImageAnimation.Visibility = Visibility.Visible;
+ }
+ else {
+ menuItem_saveImageAnimation.Visibility = Visibility.Collapsed;
+ }
- // Storyboard hint
- button_MoreOption.Visibility = bAnimateMoreButton ? Visibility.Visible : Visibility.Collapsed;
- if (bAnimateMoreButton)
- {
- System.Windows.Media.Animation.Storyboard storyboard_moreAnimation = (System.Windows.Media.Animation.Storyboard)(this.FindResource("Storyboard_TreeviewItemSelectedAnimation"));
- storyboard_moreAnimation.Begin();
+ // Storyboard hint
+ button_MoreOption.Visibility = bAnimateMoreButton ? Visibility.Visible : Visibility.Collapsed;
+ if (bAnimateMoreButton) {
+ System.Windows.Media.Animation.Storyboard storyboard_moreAnimation = (System.Windows.Media.Animation.Storyboard)(this.FindResource("Storyboard_TreeviewItemSelectedAnimation"));
+ storyboard_moreAnimation.Begin();
+ }
+ } finally {
+ isLoading = false;
}
}
@@ -2057,6 +1931,168 @@ private void SetImageRenderView(WzCanvasProperty canvas)
}
#endregion
+ #region Property Item
+ ///
+ /// On property item selection changed
+ ///
+ ///
+ ///
+ private void propertyGrid_PropertyChanged_1(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
+ if (isLoading) {
+ return;
+ }
+ switch (e.PropertyName) {
+ case "WzFileType": { // does nothing
+ break;
+ }
+ case "WzFileName": {
+ if (DataTree.SelectedNode == null)
+ return;
+
+ string setText = _bindingPropertyItem.WzFileName;
+
+ WzNode node = (WzNode)DataTree.SelectedNode;
+
+ if (node.Tag is WzFile) {
+
+ }
+ else if (WzNode.CanNodeBeInserted((WzNode)node.Parent, setText)) {
+ node.ChangeName(setText);
+ }
+ else
+ Warning.Error(Properties.Resources.MainNodeExists);
+ break;
+ }
+ case "XYVector":
+ case "WzFileValue": {
+ if (DataTree.SelectedNode == null)
+ return;
+
+ string setText = _bindingPropertyItem.WzFileValue;
+
+ bool bChangedNode = false;
+
+ WzNode node = (WzNode) DataTree.SelectedNode;
+ WzObject obj = (WzObject)DataTree.SelectedNode.Tag;
+
+ bool bIsWzFile = obj is WzFile file;
+ bool bIsWzDirectory = obj is WzDirectory;
+ bool bIsWzImage = obj is WzImage;
+ bool bIsWzLuaProperty = obj is WzLuaProperty;
+ bool bIsWzSoundProperty = obj is WzBinaryProperty;
+ bool bIsWzStringProperty = obj is WzStringProperty;
+ bool bIsWzIntProperty = obj is WzIntProperty;
+ bool bIsWzLongProperty = obj is WzLongProperty;
+ bool bIsWzDoubleProperty = obj is WzDoubleProperty;
+ bool bIsWzFloatProperty = obj is WzFloatProperty;
+ bool bIsWzShortProperty = obj is WzShortProperty;
+ bool bIsWzNullProperty = obj is WzNullProperty;
+ bool bIsWzSubProperty = obj is WzSubProperty;
+ bool bIsWzConvexProperty = obj is WzConvexProperty;
+
+
+ if (bIsWzFile) {
+ ((WzFile)node.Tag).Header.Copyright = setText;
+ ((WzFile)node.Tag).Header.RecalculateFileStart();
+
+ bChangedNode = true;
+ }
+ else if (obj is WzVectorProperty vectorProperty) {
+ vectorProperty.X.Value = (int) _bindingPropertyItem.XYVector.X;
+ vectorProperty.Y.Value = (int) _bindingPropertyItem.XYVector.Y;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzStringProperty stringProperty) {
+ if (!stringProperty.IsSpineAtlasResources) {
+ stringProperty.Value = setText;
+
+ bChangedNode = true;
+ }
+ else {
+ throw new NotSupportedException("Usage of textBoxProp for spine WzStringProperty.");
+ }
+ }
+ else if (obj is WzFloatProperty floatProperty) {
+ float val;
+ if (!float.TryParse(setText, out val)) {
+ Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
+ return;
+ }
+ floatProperty.Value = val;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzIntProperty intProperty) {
+ int val;
+ if (!int.TryParse(setText, out val)) {
+ Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
+ return;
+ }
+ intProperty.Value = val;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzLongProperty longProperty) {
+ long val;
+ if (!long.TryParse(setText, out val)) {
+ Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
+ return;
+ }
+ longProperty.Value = val;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzDoubleProperty doubleProperty) {
+ double val;
+ if (!double.TryParse(setText, out val)) {
+ Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
+ return;
+ }
+ doubleProperty.Value = val;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzShortProperty shortProperty) {
+ short val;
+ if (!short.TryParse(setText, out val)) {
+ Warning.Error(string.Format(Properties.Resources.MainConversionError, setText));
+ return;
+ }
+ shortProperty.Value = val;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzUOLProperty UOLProperty) {
+ UOLProperty.Value = setText;
+
+ bChangedNode = true;
+ }
+ else if (obj is WzLuaProperty) {
+ throw new NotSupportedException("Moved to TextEditor_SaveButtonClicked()");
+ }
+
+ if (bChangedNode) {
+ node.ChangedNodeProperty();
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ ///
+ /// On field limit checkboxes changes, update the PropertyItem values accordingly
+ ///
+ ///
+ ///
+ private void FieldLimitPanel1_FieldLimitChanged(object sender, FieldLimitChangedEventArgs e) {
+ _bindingPropertyItem.WzFileValue = e.FieldLimit.ToString();
+ }
+ #endregion
+
#region Search
///
@@ -2288,6 +2324,5 @@ private void findBox_TextChanged(object sender, TextChangedEventArgs e)
searchidx = 0;
}
#endregion
-
}
-}
+}
\ No newline at end of file
diff --git a/HaRepacker/GUI/Panels/MainPanelPropertyItems.cs b/HaRepacker/GUI/Panels/MainPanelPropertyItems.cs
new file mode 100644
index 00000000..11b54089
--- /dev/null
+++ b/HaRepacker/GUI/Panels/MainPanelPropertyItems.cs
@@ -0,0 +1,175 @@
+using HaRepacker.Converter;
+using HaRepacker.GUI.Controls;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HaRepacker.GUI.Panels {
+
+ ///
+ /// For property items with WZ value that can be edited.
+ ///
+ public class MainPanelPropertyItems : INotifyPropertyChanged {
+
+ private const string CATEGORY_DISPLAY = "Property";
+
+ public MainPanelPropertyItems() {
+ _XYVector.PropertyChanged += (sender, args) => OnPropertyChanged(nameof(XYVector));
+ }
+
+ private string _wzFileType = "";
+ [ReadOnly(true)] // This makes the Name property read-only
+ [Category(CATEGORY_DISPLAY)]
+ [Description("The file type currently being selected")]
+ [DisplayName("WZ file type")]
+ public string WzFileType {
+ get => _wzFileType;
+ set {
+ if (_wzFileType != value) {
+ _wzFileType = value;
+ OnPropertyChanged(nameof(WzFileType));
+ }
+ }
+ }
+
+ private string _wzFileName = "";
+ [ReadOnly(false)] // This makes the Name property read-only
+ [Category(CATEGORY_DISPLAY)]
+ [Description("The name of the file currently being selected")]
+ [DisplayName("WZ file name")]
+ public string WzFileName {
+ get => _wzFileName;
+ set {
+ if (_wzFileName != value) {
+ _wzFileName = value;
+ OnPropertyChanged(nameof(WzFileName));
+ }
+ }
+ }
+
+ private string _wzFileValue = "";
+ [ReadOnly(false)]// This makes the Name property read-only
+ [Category(CATEGORY_DISPLAY)]
+ [Description("The value of the file currently being selected")]
+ [DisplayName("WZ value")]
+ public string WzFileValue {
+ get => _wzFileValue;
+ set {
+ if (_wzFileValue != value) {
+ _wzFileValue = value;
+ OnPropertyChanged(nameof(WzFileValue));
+ }
+ }
+ }
+ private bool _bIsWzValueReadOnly = true;
+ [ReadOnly(true)]// This makes the Name property read-only
+ [Browsable(false)]
+ public bool IsWzValueReadOnly {
+ get => _bIsWzValueReadOnly;
+ set {
+ if (_bIsWzValueReadOnly != value) {
+ _bIsWzValueReadOnly = value;
+ OnPropertyChanged(nameof(IsWzValueReadOnly));
+ }
+ }
+ }
+
+ private NotifyPointF _XYVector = new NotifyPointF(0,0);
+ [Category(CATEGORY_DISPLAY)]
+ [Description("The X,Y values.")]
+ [DisplayName("X Y")]
+ [TypeConverter(typeof(PointFConverter))]
+ [Editor(typeof(PointFEditor), typeof(PointFEditor))]
+ [ReadOnly(true)]// This makes the Name property read-only
+ public NotifyPointF XYVector {
+ get => _XYVector;
+ set {
+ if (_XYVector != value) {
+ if (_XYVector != null) {
+ _XYVector.PropertyChanged -= (sender, args) => OnPropertyChanged(nameof(XYVector));
+ }
+ _XYVector = value;
+ if (_XYVector != null) {
+ _XYVector.PropertyChanged += (sender, args) => OnPropertyChanged(nameof(XYVector));
+ }
+ OnPropertyChanged(nameof(XYVector));
+ }
+ }
+ }
+ private bool _bIsXYPanelReadOnly = true;
+ [ReadOnly(true)]// This makes the Name property read-only
+ [Browsable(false)]
+ public bool IsXYPanelReadOnly {
+ get => _bIsXYPanelReadOnly;
+ set {
+ if (_bIsXYPanelReadOnly != value) {
+ _bIsXYPanelReadOnly = value;
+ OnPropertyChanged(nameof(IsXYPanelReadOnly));
+ }
+ }
+ }
+
+
+ ///
+ /// Updates the read-only attribute of a parameter and sets a boolean property
+ ///
+ /// True to set as read-only, false otherwise
+ /// Name of the parameter to update
+ /// The type containing the property
+ /// The object containing the property
+ /// A lambda expression to select the property
+ public void ChangeReadOnlyAttribute(bool bSet, T obj, Expression> boolPropertyReadOnlySelector, Expression> setPropertySelector) {
+ // changing attribute does not update the UI state
+ string setPropertyName = GetPropertyName(setPropertySelector);
+ PropertyDescriptor descriptor = TypeDescriptor.GetProperties(typeof(T))[setPropertyName];
+ ReadOnlyAttribute attribute = (ReadOnlyAttribute)descriptor.Attributes[typeof(ReadOnlyAttribute)];
+
+ FieldInfo isReadOnlyField = typeof(ReadOnlyAttribute).GetField("isReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
+ //System.Diagnostics.Debug.WriteLine("From: " +attribute.IsReadOnly);
+ isReadOnlyField.SetValue(attribute, bSet);
+ //System.Diagnostics.Debug.WriteLine("To: " + attribute.IsReadOnly);
+
+ BrowsableAttribute browsableAttribute = (BrowsableAttribute)descriptor.Attributes[typeof(BrowsableAttribute)];
+ FieldInfo isBrowsableField = typeof(BrowsableAttribute).GetField("browsable", BindingFlags.NonPublic | BindingFlags.Instance);
+ isBrowsableField.SetValue(browsableAttribute, !bSet);
+
+ // Get the property
+ PropertyInfo propInfo = ((MemberExpression)boolPropertyReadOnlySelector.Body).Member as PropertyInfo;
+
+ // Update the boolean property
+ propInfo.SetValue(obj, bSet);
+
+ // Note: OnPropertyChanged is called within the property setter, so we don't need to call it here
+ }
+
+ private string GetPropertyName(Expression> propertySelector) {
+ if (propertySelector.Body is MemberExpression memberExpression) {
+ return memberExpression.Member.Name;
+ }
+ else if (propertySelector.Body is UnaryExpression unaryExpression) {
+ return ((MemberExpression)unaryExpression.Operand).Member.Name;
+ }
+
+ throw new ArgumentException("Invalid property selector", nameof(propertySelector));
+ }
+
+ #region Events
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ ///
+ /// On property changed
+ ///
+ ///
+ protected virtual void OnPropertyChanged(string propertyName) {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ #endregion
+ }
+}
diff --git a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml
index 284c1fe6..4960779d 100644
--- a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml
+++ b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml
@@ -316,7 +316,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -497,23 +552,29 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
@@ -532,7 +593,7 @@
-
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml.cs b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml.cs
index fee184be..0616e4f2 100644
--- a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml.cs
+++ b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewer.xaml.cs
@@ -51,8 +51,7 @@ public ImageRenderViewer()
}
this.DataContext = _bindingPropertyItem; // set data binding
- _bindingPropertyItem.PropertyChanged += ImgPropertyItem_PropertyChanged; // on propertygrid property changed
-
+ _bindingPropertyItem.PropertyChanged += ImgPropertyItem_PropertyChanged;
Loaded += ImageRenderViewer_Loaded;
}
diff --git a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewerItem.cs b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewerItem.cs
index 9d748d2c..ba2a2af8 100644
--- a/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewerItem.cs
+++ b/HaRepacker/GUI/Panels/SubPanels/ImageRenderViewerItem.cs
@@ -1,5 +1,6 @@
using HaRepacker.Converter;
using HaRepacker.GUI.Controls;
+using HaSharedLibrary.Util;
using MapleLib.Converters;
using MapleLib.WzLib.WzProperties;
using System;
@@ -90,6 +91,7 @@ public ImageSource Image {
// Update image width and height too.
ImageWidth = (int) _Image.Width;
ImageHeight = (int)_Image.Height;
+ ImageSizeKiloByte = BitmapHelper.GetImageSizeInKB(_Image);
}
}
@@ -150,6 +152,21 @@ public int ImageHeight {
OnPropertyChanged(nameof(ImageHeight));
}
}
+
+ private double _ImageSizeKiloByte = 0;
+ ///
+ /// The Size of the image currently displayed on the canvas
+ ///
+ [ReadOnly(true)] // This makes the Name property read-only
+ [DisplayName("Size (Kb)")]
+ [Category(CATEGORY_IMAGEINFO)]
+ public double ImageSizeKiloByte {
+ get { return _ImageSizeKiloByte; }
+ set {
+ this._ImageSizeKiloByte = value;
+ OnPropertyChanged(nameof(ImageSizeKiloByte));
+ }
+ }
#endregion
#region Animation
diff --git a/HaRepacker/Harepacker-resurrected.csproj b/HaRepacker/Harepacker-resurrected.csproj
index af3a1c48..02eb4c28 100644
--- a/HaRepacker/Harepacker-resurrected.csproj
+++ b/HaRepacker/Harepacker-resurrected.csproj
@@ -228,6 +228,7 @@
+
@@ -401,6 +402,7 @@
MainPanel.xaml
+
AvalonTextEditor.xaml
diff --git a/HaRepacker/Properties/Resources.Designer.cs b/HaRepacker/Properties/Resources.Designer.cs
index f7c6d244..f71bcb0d 100644
--- a/HaRepacker/Properties/Resources.Designer.cs
+++ b/HaRepacker/Properties/Resources.Designer.cs
@@ -1178,15 +1178,6 @@ public static string SelectImage {
}
}
- ///
- /// Looks up a localized string similar to Selection Type: {0}.
- ///
- public static string SelectionType {
- get {
- return ResourceManager.GetString("SelectionType", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Select MP3 File.
///
diff --git a/HaRepacker/Properties/Resources.ja.resx b/HaRepacker/Properties/Resources.ja.resx
index 32738693..2237c94d 100644
--- a/HaRepacker/Properties/Resources.ja.resx
+++ b/HaRepacker/Properties/Resources.ja.resx
@@ -117,301 +117,298 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- お使いのブラウザまたは画像ビューアがこの画像を表示するには古すぎます。Firefox のような新しいブラウザをダウンロードしてください。
-
-
- アニメーションビルダーでエラーが発生しました、フレーム {0}
-
-
- アニメーション付きポータブルネットワークグラフィックス (*.png)
-
-
- 足場
-
-
- ポータル
-
-
- モンスター出現ポイント
-
-
- グローバルメイプルストーリー (旧)
-
-
- MSEA/ EMS/ 台湾 (旧)
-
-
- BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
-
-
- 有効な入力を入力してください
-
-
- エラー
-
-
- 入力が無効でした。
-
-
- 力の値
-
-
- {0}が無効でした。
-
-
- 次の値
-
-
- ポータルタイプの値
-
-
- 前の値
-
-
- X値
-
-
- Y値
-
-
- 画像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
-
-
- 使用するWZ暗号化を選択してください:
-
-
- WZ暗号化
-
-
- キャンバスを追加
-
-
- 凸形を追加
-
-
- ディレクトリを追加
-
-
- doubleを追加
-
-
- floatを追加
-
-
- 画像を追加
-
-
- intを追加
-
-
- ポータルタイプ:{0}
-
-
- リンクを追加
-
-
- nullを追加
-
-
- shortを追加
-
-
- 音声を追加
-
-
- 文字列を追加
-
-
- サブを追加
-
-
- タブを追加
-
-
- ベクトルを追加
-
-
- 選択されたオブジェクトをこのタイプのWZノードに挿入できません。
-
-
- 現在の操作を中止してもよろしいですか?
-
-
- WZノードをクリップボードにコピーしますか?(警告 - 多くのノードが選択されている場合、時間がかかる可能性があります)
-
-
- 終了してもよろしいですか?
-
-
- クリップボードからWZノードを貼り付けますか?(警告 - 多くのノードが貼り付けられる場合、時間がかかる可能性があります)
-
-
- これを削除してもよろしいですか?
-
-
- このノードを削除してもよろしいですか?
-
-
- 名前を変更する
-
-
- 「{0}」を必要なタイプに変換できませんでした
-
-
- ディレクトリは多くのメモリを必要とするためコピーできません
-
-
- WZファイル「{0}」を開くことができませんでした
-
-
- {0}.imgファイルのインポート中にエラーが発生しました。正しいWZ暗号化を選択していますか?
-
-
- 指定されたファイルパスを開く/保存できません。代わりに管理者として実行してください。
-
-
- ヘルプファイル({0})が見つからなかったため、ヘルプを表示できませんでした
-
-
- 画像を読み込めませんでした
-
-
- ファイル「{0}」は無効であるためスキップされます。エラー:{1}
-
-
- {0}にあるファイルはList.wzファイルであるため、スキップされます。
-
-
- その名前のノードはすでに存在します。別の名前を選んでください
-
-
- すべてのファイルを再読み込みしてもよろしいですか?
-
-
- 保存するWZファイルを選択してください
-
-
- このWzDirectoryPropertyを追加する親WzFileが見つかりませんでした。
-
-
- ツリーの終端に達しました
-
-
- すべてのファイルをアンロードしてもよろしいですか?
-
-
- {0}
-
-
- 新しいバージョン
-
-
- エクスポートディレクトリが見つかりません。ツール -> オプションで指定してください
-
-
- MPEG-1 Audio Layer 3 (*.mp3)
-
-
- インデントは0より大きくなければなりません
-
-
- ノード「{0}」はすでに存在します。置き換えますか?
-
-
- バージョンは0より大きくなければなりません
-
-
- デフォルトのXMLフォルダを選択
-
-
- 画像を選択
-
-
- 選択タイプ:{0}
-
-
- MP3ファイルを選択
-
-
- アニメーションの保存先を選択
-
-
- 出力ディレクトリを選択
-
-
- ファイルの保存先を選択
-
-
- XMLの保存先を選択
-
-
- WZファイルを選択
-
-
- IMGファイルを選択
-
-
- XMLファイルを選択
-
-
- 警告
-
-
- WZファイル (*.wz)
-
-
- WZ画像ファイル (*.img)
-
-
- 拡張マークアップ言語 (*.xml)
-
-
- 読み込み中
-
-
- これはHaRepackerのx86バージョンでのみ利用可能です。別のバージョンを入手してください。
-
-
- カスタム暗号化を使用する
-
-
- Bruteforce AESキー(生成)
-
-
- {0} 日前
-
-
- {0} 時間前
-
-
- {0} 分前
-
-
- {0} ヶ月前
-
-
- {0} 秒前
-
-
- {0} 年前
-
-
- 画像、MP3、その他のバイナリデータのbase64データをJSONに含めますか?
-
-
- データ
-
-
- バッチ処理
-
-
- 画像をアップスケール
-
-
- 古いメイプルストーリー用に'_inlink'、'_outlink'ノードを修正
-
-
- 品質のみ
-
+
+ お使いのブラウザまたは画像ビューアがこの画像を表示するには古すぎます。Firefox のような新しいブラウザをダウンロードしてください。
+
+
+ アニメーションビルダーでエラーが発生しました、フレーム {0}
+
+
+ アニメーション付きポータブルネットワークグラフィックス (*.png)
+
+
+ 足場
+
+
+ ポータル
+
+
+ モンスター出現ポイント
+
+
+ グローバルメイプルストーリー (旧)
+
+
+ MSEA/ EMS/ 台湾 (旧)
+
+
+ BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
+
+
+ 有効な入力を入力してください
+
+
+ エラー
+
+
+ 入力が無効でした。
+
+
+ 力の値
+
+
+ {0}が無効でした。
+
+
+ 次の値
+
+
+ ポータルタイプの値
+
+
+ 前の値
+
+
+ X値
+
+
+ Y値
+
+
+ 画像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
+
+
+ 使用するWZ暗号化を選択してください:
+
+
+ WZ暗号化
+
+
+ キャンバスを追加
+
+
+ 凸形を追加
+
+
+ ディレクトリを追加
+
+
+ doubleを追加
+
+
+ floatを追加
+
+
+ 画像を追加
+
+
+ intを追加
+
+
+ ポータルタイプ:{0}
+
+
+ リンクを追加
+
+
+ nullを追加
+
+
+ shortを追加
+
+
+ 音声を追加
+
+
+ 文字列を追加
+
+
+ サブを追加
+
+
+ タブを追加
+
+
+ ベクトルを追加
+
+
+ 選択されたオブジェクトをこのタイプのWZノードに挿入できません。
+
+
+ 現在の操作を中止してもよろしいですか?
+
+
+ WZノードをクリップボードにコピーしますか?(警告 - 多くのノードが選択されている場合、時間がかかる可能性があります)
+
+
+ 終了してもよろしいですか?
+
+
+ クリップボードからWZノードを貼り付けますか?(警告 - 多くのノードが貼り付けられる場合、時間がかかる可能性があります)
+
+
+ これを削除してもよろしいですか?
+
+
+ このノードを削除してもよろしいですか?
+
+
+ 名前を変更する
+
+
+ 「{0}」を必要なタイプに変換できませんでした
+
+
+ ディレクトリは多くのメモリを必要とするためコピーできません
+
+
+ WZファイル「{0}」を開くことができませんでした
+
+
+ {0}.imgファイルのインポート中にエラーが発生しました。正しいWZ暗号化を選択していますか?
+
+
+ 指定されたファイルパスを開く/保存できません。代わりに管理者として実行してください。
+
+
+ ヘルプファイル({0})が見つからなかったため、ヘルプを表示できませんでした
+
+
+ 画像を読み込めませんでした
+
+
+ ファイル「{0}」は無効であるためスキップされます。エラー:{1}
+
+
+ {0}にあるファイルはList.wzファイルであるため、スキップされます。
+
+
+ その名前のノードはすでに存在します。別の名前を選んでください
+
+
+ すべてのファイルを再読み込みしてもよろしいですか?
+
+
+ 保存するWZファイルを選択してください
+
+
+ このWzDirectoryPropertyを追加する親WzFileが見つかりませんでした。
+
+
+ ツリーの終端に達しました
+
+
+ すべてのファイルをアンロードしてもよろしいですか?
+
+
+ {0}
+
+
+ 新しいバージョン
+
+
+ エクスポートディレクトリが見つかりません。ツール -> オプションで指定してください
+
+
+ MPEG-1 Audio Layer 3 (*.mp3)
+
+
+ インデントは0より大きくなければなりません
+
+
+ ノード「{0}」はすでに存在します。置き換えますか?
+
+
+ バージョンは0より大きくなければなりません
+
+
+ デフォルトのXMLフォルダを選択
+
+
+ 画像を選択
+
+
+ MP3ファイルを選択
+
+
+ アニメーションの保存先を選択
+
+
+ 出力ディレクトリを選択
+
+
+ ファイルの保存先を選択
+
+
+ XMLの保存先を選択
+
+
+ WZファイルを選択
+
+
+ IMGファイルを選択
+
+
+ XMLファイルを選択
+
+
+ 警告
+
+
+ WZファイル (*.wz)
+
+
+ WZ画像ファイル (*.img)
+
+
+ 拡張マークアップ言語 (*.xml)
+
+
+ 読み込み中
+
+
+ これはHaRepackerのx86バージョンでのみ利用可能です。別のバージョンを入手してください。
+
+
+ カスタム暗号化を使用する
+
+
+ Bruteforce AESキー(生成)
+
+
+ {0} 日前
+
+
+ {0} 時間前
+
+
+ {0} 分前
+
+
+ {0} ヶ月前
+
+
+ {0} 秒前
+
+
+ {0} 年前
+
+
+ 画像、MP3、その他のバイナリデータのbase64データをJSONに含めますか?
+
+
+ データ
+
+
+ バッチ処理
+
+
+ 画像をアップスケール
+
+
+ 古いメイプルストーリー用に'_inlink'、'_outlink'ノードを修正
+
+
+ 品質のみ
+
\ No newline at end of file
diff --git a/HaRepacker/Properties/Resources.ko.resx b/HaRepacker/Properties/Resources.ko.resx
index 318dcf1c..dcba0712 100644
--- a/HaRepacker/Properties/Resources.ko.resx
+++ b/HaRepacker/Properties/Resources.ko.resx
@@ -117,301 +117,298 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 브라우저나 이미지 뷰어가 너무 오래되어 이 이미지를 볼 수 없습니다. Firefox와 같은 새로운 브라우저를 다운로드해 주세요.
-
-
- 애니메이션 빌더에서 오류 발생, 프레임 {0}
-
-
- 애니메이션 포터블 네트워크 그래픽스 (*.png)
-
-
- 발판
-
-
- 포털
-
-
- 몬스터 스폰 포인트
-
-
- 글로벌 메이플스토리 (구)
-
-
- MSEA/ EMS/ 대만 (구)
-
-
- BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
-
-
- 유효한 입력을 입력해주세요
-
-
- 오류
-
-
- 입력이 유효하지 않습니다.
-
-
- 힘 값
-
-
- {0}이(가) 유효하지 않습니다.
-
-
- 다음 값
-
-
- 포털 유형 값
-
-
- 이전 값
-
-
- X 값
-
-
- Y 값
-
-
- 이미지 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
-
-
- 사용할 WZ 암호화를 선택하세요:
-
-
- WZ 암호화
-
-
- 캔버스 추가
-
-
- 볼록 추가
-
-
- 디렉토리 추가
-
-
- double 추가
-
-
- float 추가
-
-
- 이미지 추가
-
-
- int 추가
-
-
- 포털 유형: {0}
-
-
- 링크 추가
-
-
- null 추가
-
-
- short 추가
-
-
- 소리 추가
-
-
- 문자열 추가
-
-
- 하위 항목 추가
-
-
- 탭 추가
-
-
- 벡터 추가
-
-
- 선택한 객체를 이 유형의 wz 노드에 삽입할 수 없습니다.
-
-
- 현재 작업을 중단하시겠습니까?
-
-
- WZ 노드를 클립보드에 복사하시겠습니까? (경고 - 많은 노드가 선택된 경우 시간이 오래 걸릴 수 있습니다)
-
-
- 종료하시겠습니까?
-
-
- 클립보드에서 WZ 노드를 붙여넣기하시겠습니까? (경고 - 많은 노드가 붙여넣기되는 경우 시간이 오래 걸릴 수 있습니다)
-
-
- 이것을 삭제하시겠습니까?
-
-
- 이 노드를 제거하시겠습니까?
-
-
- 이름 바꾸기
-
-
- '{0}'을(를) 필요한 유형으로 변환할 수 없었습니다
-
-
- 디렉토리는 너무 많은 메모리를 필요로 하므로 복사할 수 없습니다
-
-
- WZ 파일 "{0}"을(를) 열 수 없었습니다
-
-
- {0}.img 파일을 가져오는 중 오류가 발생했습니다. 올바른 WZ 암호화를 선택하셨습니까?
-
-
- 지정된 파일 경로를 열거나 저장할 수 없습니다. 대신 관리자 권한으로 실행해 주세요.
-
-
- 도움말 파일({0})을 찾을 수 없어 도움말을 표시할 수 없습니다
-
-
- 이미지를 로드할 수 없었습니다
-
-
- 파일 "{0}"이(가) 유효하지 않아 건너뛰게 됩니다. 오류: {1}
-
-
- {0}에 있는 파일은 List.wz 파일이므로 건너뛰게 됩니다.
-
-
- 해당 이름의 노드가 이미 존재합니다. 다른 이름을 선택해 주세요
-
-
- 모든 파일을 다시 로드하시겠습니까?
-
-
- 저장할 WZ 파일을 선택해 주세요
-
-
- 이 WzDirectoryProperty를 추가할 부모 WzFile을 찾을 수 없습니다.
-
-
- 트리의 끝에 도달했습니다
-
-
- 모든 파일을 언로드하시겠습니까?
-
-
- {0}
-
-
- 새 버전
-
-
- 내보내기 디렉토리를 찾을 수 없습니다. 도구 -> 옵션에서 지정해 주세요
-
-
- MPEG-1 오디오 레이어 3 (*.mp3)
-
-
- 들여쓰기는 0보다 커야 합니다
-
-
- 노드 "{0}"이(가) 이미 존재합니다. 교체하시겠습니까?
-
-
- 버전은 0보다 커야 합니다
-
-
- 기본 XML 폴더 선택
-
-
- 이미지 선택
-
-
- 선택 유형: {0}
-
-
- MP3 파일 선택
-
-
- 애니메이션을 저장할 위치 선택
-
-
- 출력 디렉토리 선택
-
-
- 파일을 저장할 위치 선택
-
-
- XML을 저장할 위치 선택
-
-
- WZ 파일 선택
-
-
- IMG 파일 선택
-
-
- XML 파일 선택
-
-
- 경고
-
-
- WZ 파일 (*.wz)
-
-
- WZ 이미지 파일 (*.img)
-
-
- 확장 마크업 언어 (*.xml)
-
-
- 로딩 중
-
-
- 이것은 HaRepacker의 x86 버전에서만 사용할 수 있습니다. 대체 버전을 구해주세요.
-
-
- 사용자 정의 암호화 사용
-
-
- Bruteforce AES 키 (생성)
-
-
- {0}일 전
-
-
- {0}시간 전
-
-
- {0}분 전
-
-
- {0}개월 전
-
-
- {0}초 전
-
-
- {0}년 전
-
-
- JSON에 이미지, MP3 및 기타 이진 데이터의 base64 데이터를 포함하시겠습니까?
-
-
- 데이터
-
-
- 일괄 처리
-
-
- 이미지 업스케일
-
-
- 구 메이플스토리용 '_inlink', '_outlink' 노드 수정
-
-
- 품질만
-
+
+ 브라우저나 이미지 뷰어가 너무 오래되어 이 이미지를 볼 수 없습니다. Firefox와 같은 새로운 브라우저를 다운로드해 주세요.
+
+
+ 애니메이션 빌더에서 오류 발생, 프레임 {0}
+
+
+ 애니메이션 포터블 네트워크 그래픽스 (*.png)
+
+
+ 발판
+
+
+ 포털
+
+
+ 몬스터 스폰 포인트
+
+
+ 글로벌 메이플스토리 (구)
+
+
+ MSEA/ EMS/ 대만 (구)
+
+
+ BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
+
+
+ 유효한 입력을 입력해주세요
+
+
+ 오류
+
+
+ 입력이 유효하지 않습니다.
+
+
+ 힘 값
+
+
+ {0}이(가) 유효하지 않습니다.
+
+
+ 다음 값
+
+
+ 포털 유형 값
+
+
+ 이전 값
+
+
+ X 값
+
+
+ Y 값
+
+
+ 이미지 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
+
+
+ 사용할 WZ 암호화를 선택하세요:
+
+
+ WZ 암호화
+
+
+ 캔버스 추가
+
+
+ 볼록 추가
+
+
+ 디렉토리 추가
+
+
+ double 추가
+
+
+ float 추가
+
+
+ 이미지 추가
+
+
+ int 추가
+
+
+ 포털 유형: {0}
+
+
+ 링크 추가
+
+
+ null 추가
+
+
+ short 추가
+
+
+ 소리 추가
+
+
+ 문자열 추가
+
+
+ 하위 항목 추가
+
+
+ 탭 추가
+
+
+ 벡터 추가
+
+
+ 선택한 객체를 이 유형의 wz 노드에 삽입할 수 없습니다.
+
+
+ 현재 작업을 중단하시겠습니까?
+
+
+ WZ 노드를 클립보드에 복사하시겠습니까? (경고 - 많은 노드가 선택된 경우 시간이 오래 걸릴 수 있습니다)
+
+
+ 종료하시겠습니까?
+
+
+ 클립보드에서 WZ 노드를 붙여넣기하시겠습니까? (경고 - 많은 노드가 붙여넣기되는 경우 시간이 오래 걸릴 수 있습니다)
+
+
+ 이것을 삭제하시겠습니까?
+
+
+ 이 노드를 제거하시겠습니까?
+
+
+ 이름 바꾸기
+
+
+ '{0}'을(를) 필요한 유형으로 변환할 수 없었습니다
+
+
+ 디렉토리는 너무 많은 메모리를 필요로 하므로 복사할 수 없습니다
+
+
+ WZ 파일 "{0}"을(를) 열 수 없었습니다
+
+
+ {0}.img 파일을 가져오는 중 오류가 발생했습니다. 올바른 WZ 암호화를 선택하셨습니까?
+
+
+ 지정된 파일 경로를 열거나 저장할 수 없습니다. 대신 관리자 권한으로 실행해 주세요.
+
+
+ 도움말 파일({0})을 찾을 수 없어 도움말을 표시할 수 없습니다
+
+
+ 이미지를 로드할 수 없었습니다
+
+
+ 파일 "{0}"이(가) 유효하지 않아 건너뛰게 됩니다. 오류: {1}
+
+
+ {0}에 있는 파일은 List.wz 파일이므로 건너뛰게 됩니다.
+
+
+ 해당 이름의 노드가 이미 존재합니다. 다른 이름을 선택해 주세요
+
+
+ 모든 파일을 다시 로드하시겠습니까?
+
+
+ 저장할 WZ 파일을 선택해 주세요
+
+
+ 이 WzDirectoryProperty를 추가할 부모 WzFile을 찾을 수 없습니다.
+
+
+ 트리의 끝에 도달했습니다
+
+
+ 모든 파일을 언로드하시겠습니까?
+
+
+ {0}
+
+
+ 새 버전
+
+
+ 내보내기 디렉토리를 찾을 수 없습니다. 도구 -> 옵션에서 지정해 주세요
+
+
+ MPEG-1 오디오 레이어 3 (*.mp3)
+
+
+ 들여쓰기는 0보다 커야 합니다
+
+
+ 노드 "{0}"이(가) 이미 존재합니다. 교체하시겠습니까?
+
+
+ 버전은 0보다 커야 합니다
+
+
+ 기본 XML 폴더 선택
+
+
+ 이미지 선택
+
+
+ MP3 파일 선택
+
+
+ 애니메이션을 저장할 위치 선택
+
+
+ 출력 디렉토리 선택
+
+
+ 파일을 저장할 위치 선택
+
+
+ XML을 저장할 위치 선택
+
+
+ WZ 파일 선택
+
+
+ IMG 파일 선택
+
+
+ XML 파일 선택
+
+
+ 경고
+
+
+ WZ 파일 (*.wz)
+
+
+ WZ 이미지 파일 (*.img)
+
+
+ 확장 마크업 언어 (*.xml)
+
+
+ 로딩 중
+
+
+ 이것은 HaRepacker의 x86 버전에서만 사용할 수 있습니다. 대체 버전을 구해주세요.
+
+
+ 사용자 정의 암호화 사용
+
+
+ Bruteforce AES 키 (생성)
+
+
+ {0}일 전
+
+
+ {0}시간 전
+
+
+ {0}분 전
+
+
+ {0}개월 전
+
+
+ {0}초 전
+
+
+ {0}년 전
+
+
+ JSON에 이미지, MP3 및 기타 이진 데이터의 base64 데이터를 포함하시겠습니까?
+
+
+ 데이터
+
+
+ 일괄 처리
+
+
+ 이미지 업스케일
+
+
+ 구 메이플스토리용 '_inlink', '_outlink' 노드 수정
+
+
+ 품질만
+
\ No newline at end of file
diff --git a/HaRepacker/Properties/Resources.resx b/HaRepacker/Properties/Resources.resx
index a12bdbd6..4c13f785 100644
--- a/HaRepacker/Properties/Resources.resx
+++ b/HaRepacker/Properties/Resources.resx
@@ -437,9 +437,6 @@ Click "Yes" to download the new version.
Select the image
-
- Selection Type: {0}
-
Select MP3 File
diff --git a/HaRepacker/Properties/Resources.zh-CHS.resx b/HaRepacker/Properties/Resources.zh-CHS.resx
index 47510946..d7be9f23 100644
--- a/HaRepacker/Properties/Resources.zh-CHS.resx
+++ b/HaRepacker/Properties/Resources.zh-CHS.resx
@@ -117,301 +117,298 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 您的浏览器或图像查看器太旧,无法查看此图像。请下载较新的浏览器,如Firefox。
-
-
- 动画生成器出错,帧 {0}
-
-
- 动画便携式网络图形 (*.png)
-
-
- 立足点
-
-
- 传送门
-
-
- 怪物刷新点
-
-
- 全球冒险岛 (旧)
-
-
- MSEA/ EMS/ 台湾 (旧)
-
-
- BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
-
-
- 请输入有效的内容
-
-
- 错误
-
-
- 输入无效。
-
-
- 力值
-
-
- {0}无效。
-
-
- 下一个值
-
-
- 传送门类型值
-
-
- 前一个值
-
-
- X值
-
-
- Y值
-
-
- 图像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
-
-
- 选择要使用的WZ加密:
-
-
- WZ加密
-
-
- 添加画布
-
-
- 添加凸形
-
-
- 添加目录
-
-
- 添加双精度浮点数
-
-
- 添加浮点数
-
-
- 添加图像
-
-
- 添加整数
-
-
- 传送门类型:{0}
-
-
- 添加链接
-
-
- 添加空值
-
-
- 添加短整数
-
-
- 添加声音
-
-
- 添加字符串
-
-
- 添加子项
-
-
- 添加标签
-
-
- 添加向量
-
-
- 无法将选定的对象插入到这种类型的wz节点中。
-
-
- 您确定要中止当前操作吗?
-
-
- 将WZ节点复制到剪贴板?(警告 - 如果选择了许多节点,可能需要很长时间)
-
-
- 您确定要退出吗?
-
-
- 从剪贴板粘贴WZ节点?(警告 - 如果粘贴了许多节点,可能需要很长时间)
-
-
- 您确定要删除这个吗?
-
-
- 您确定要删除这个节点吗?
-
-
- 重命名
-
-
- 无法将"{0}"转换为所需的类型
-
-
- 您不能复制目录,因为它们需要太多内存
-
-
- 无法打开WZ文件"{0}"
-
-
- 导入{0}.img文件时出错。您确定选择了正确的WZ加密吗?
-
-
- 无法打开/保存到指定的文件路径。请以管理员身份运行。
-
-
- 无法显示帮助,因为找不到帮助文件({0})
-
-
- 无法加载图像
-
-
- 文件"{0}"无效,将被跳过。错误:{1}
-
-
- 在{0}的文件是List.wz文件,将被跳过。
-
-
- 已存在具有该名称的节点。请选择一个不同的名称
-
-
- 您确定要重新加载所有文件吗?
-
-
- 请选择要保存的WZ文件
-
-
- 找不到父WzFile来添加这个WzDirectoryProperty。
-
-
- 已到达树的末端
-
-
- 您确定要卸载所有文件吗?
-
-
- {0}
-
-
- 新版本
-
-
- 找不到导出目录。请在工具 -> 选项中指定它
-
-
- MPEG-1音频层3 (*.mp3)
-
-
- 缩进必须大于0
-
-
- 节点"{0}"已存在。您想替换它吗?
-
-
- 版本必须大于0
-
-
- 选择默认XML文件夹
-
-
- 选择图像
-
-
- 选择类型:{0}
-
-
- 选择MP3文件
-
-
- 选择保存动画的位置
-
-
- 选择输出目录
-
-
- 选择保存文件的位置
-
-
- 选择保存XML的位置
-
-
- 选择WZ文件
-
-
- 选择IMG文件
-
-
- 选择XML文件
-
-
- 警告
-
-
- WZ文件 (*.wz)
-
-
- WZ图像文件 (*.img)
-
-
- 可扩展标记语言 (*.xml)
-
-
- 加载中
-
-
- 这只在HaRepacker的x86版本下可用,请获取替代版本。
-
-
- 使用自定义加密
-
-
- 暴力破解AES密钥(生成)
-
-
- {0} 天前
-
-
- {0} 小时前
-
-
- {0} 分钟前
-
-
- {0} 个月前
-
-
- {0} 秒前
-
-
- {0} 年前
-
-
- 您想在JSON中包含图像、MP3和其他二进制数据的base64数据吗?
-
-
- 数据
-
-
- 批处理
-
-
- 图像放大
-
-
- 修复旧版冒险岛的'_inlink'、'_outlink'节点
-
-
- 仅质量
-
+
+ 您的浏览器或图像查看器太旧,无法查看此图像。请下载较新的浏览器,如Firefox。
+
+
+ 动画生成器出错,帧 {0}
+
+
+ 动画便携式网络图形 (*.png)
+
+
+ 立足点
+
+
+ 传送门
+
+
+ 怪物刷新点
+
+
+ 全球冒险岛 (旧)
+
+
+ MSEA/ EMS/ 台湾 (旧)
+
+
+ BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
+
+
+ 请输入有效的内容
+
+
+ 错误
+
+
+ 输入无效。
+
+
+ 力值
+
+
+ {0}无效。
+
+
+ 下一个值
+
+
+ 传送门类型值
+
+
+ 前一个值
+
+
+ X值
+
+
+ Y值
+
+
+ 图像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
+
+
+ 选择要使用的WZ加密:
+
+
+ WZ加密
+
+
+ 添加画布
+
+
+ 添加凸形
+
+
+ 添加目录
+
+
+ 添加双精度浮点数
+
+
+ 添加浮点数
+
+
+ 添加图像
+
+
+ 添加整数
+
+
+ 传送门类型:{0}
+
+
+ 添加链接
+
+
+ 添加空值
+
+
+ 添加短整数
+
+
+ 添加声音
+
+
+ 添加字符串
+
+
+ 添加子项
+
+
+ 添加标签
+
+
+ 添加向量
+
+
+ 无法将选定的对象插入到这种类型的wz节点中。
+
+
+ 您确定要中止当前操作吗?
+
+
+ 将WZ节点复制到剪贴板?(警告 - 如果选择了许多节点,可能需要很长时间)
+
+
+ 您确定要退出吗?
+
+
+ 从剪贴板粘贴WZ节点?(警告 - 如果粘贴了许多节点,可能需要很长时间)
+
+
+ 您确定要删除这个吗?
+
+
+ 您确定要删除这个节点吗?
+
+
+ 重命名
+
+
+ 无法将"{0}"转换为所需的类型
+
+
+ 您不能复制目录,因为它们需要太多内存
+
+
+ 无法打开WZ文件"{0}"
+
+
+ 导入{0}.img文件时出错。您确定选择了正确的WZ加密吗?
+
+
+ 无法打开/保存到指定的文件路径。请以管理员身份运行。
+
+
+ 无法显示帮助,因为找不到帮助文件({0})
+
+
+ 无法加载图像
+
+
+ 文件"{0}"无效,将被跳过。错误:{1}
+
+
+ 在{0}的文件是List.wz文件,将被跳过。
+
+
+ 已存在具有该名称的节点。请选择一个不同的名称
+
+
+ 您确定要重新加载所有文件吗?
+
+
+ 请选择要保存的WZ文件
+
+
+ 找不到父WzFile来添加这个WzDirectoryProperty。
+
+
+ 已到达树的末端
+
+
+ 您确定要卸载所有文件吗?
+
+
+ {0}
+
+
+ 新版本
+
+
+ 找不到导出目录。请在工具 -> 选项中指定它
+
+
+ MPEG-1音频层3 (*.mp3)
+
+
+ 缩进必须大于0
+
+
+ 节点"{0}"已存在。您想替换它吗?
+
+
+ 版本必须大于0
+
+
+ 选择默认XML文件夹
+
+
+ 选择图像
+
+
+ 选择MP3文件
+
+
+ 选择保存动画的位置
+
+
+ 选择输出目录
+
+
+ 选择保存文件的位置
+
+
+ 选择保存XML的位置
+
+
+ 选择WZ文件
+
+
+ 选择IMG文件
+
+
+ 选择XML文件
+
+
+ 警告
+
+
+ WZ文件 (*.wz)
+
+
+ WZ图像文件 (*.img)
+
+
+ 可扩展标记语言 (*.xml)
+
+
+ 加载中
+
+
+ 这只在HaRepacker的x86版本下可用,请获取替代版本。
+
+
+ 使用自定义加密
+
+
+ 暴力破解AES密钥(生成)
+
+
+ {0} 天前
+
+
+ {0} 小时前
+
+
+ {0} 分钟前
+
+
+ {0} 个月前
+
+
+ {0} 秒前
+
+
+ {0} 年前
+
+
+ 您想在JSON中包含图像、MP3和其他二进制数据的base64数据吗?
+
+
+ 数据
+
+
+ 批处理
+
+
+ 图像放大
+
+
+ 修复旧版冒险岛的'_inlink'、'_outlink'节点
+
+
+ 仅质量
+
\ No newline at end of file
diff --git a/HaRepacker/Properties/Resources.zh-CHT.resx b/HaRepacker/Properties/Resources.zh-CHT.resx
index 3395c46a..125117b2 100644
--- a/HaRepacker/Properties/Resources.zh-CHT.resx
+++ b/HaRepacker/Properties/Resources.zh-CHT.resx
@@ -117,301 +117,298 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 您的瀏覽器或圖像檢視器太舊,無法檢視此圖像。請下載較新的瀏覽器,如Firefox。
-
-
- 動畫生成器出錯,幀 {0}
-
-
- 動畫可攜式網路圖形 (*.png)
-
-
- 立足點
-
-
- 傳送門
-
-
- 怪物生成點
-
-
- 全球楓之谷 (舊)
-
-
- MSEA/ EMS/ 台灣 (舊)
-
-
- BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
-
-
- 請輸入有效的內容
-
-
- 錯誤
-
-
- 輸入無效。
-
-
- 力值
-
-
- {0}無效。
-
-
- 下一個值
-
-
- 傳送門類型值
-
-
- 前一個值
-
-
- X值
-
-
- Y值
-
-
- 圖像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
-
-
- 選擇要使用的WZ加密:
-
-
- WZ加密
-
-
- 新增畫布
-
-
- 新增凸形
-
-
- 新增目錄
-
-
- 新增雙精度浮點數
-
-
- 新增浮點數
-
-
- 新增圖像
-
-
- 新增整數
-
-
- 傳送門類型:{0}
-
-
- 新增連結
-
-
- 新增空值
-
-
- 新增短整數
-
-
- 新增聲音
-
-
- 新增字串
-
-
- 新增子項
-
-
- 新增標籤
-
-
- 新增向量
-
-
- 無法將選定的物件插入到這種類型的wz節點中。
-
-
- 您確定要中止當前操作嗎?
-
-
- 將WZ節點複製到剪貼簿?(警告 - 如果選擇了許多節點,可能需要很長時間)
-
-
- 您確定要退出嗎?
-
-
- 從剪貼簿貼上WZ節點?(警告 - 如果貼上了許多節點,可能需要很長時間)
-
-
- 您確定要刪除這個嗎?
-
-
- 您確定要刪除這個節點嗎?
-
-
- 重新命名
-
-
- 無法將"{0}"轉換為所需的類型
-
-
- 您不能複製目錄,因為它們需要太多記憶體
-
-
- 無法開啟WZ檔案"{0}"
-
-
- 匯入{0}.img檔案時出錯。您確定選擇了正確的WZ加密嗎?
-
-
- 無法開啟/儲存到指定的檔案路徑。請以管理員身份執行。
-
-
- 無法顯示說明,因為找不到說明檔案({0})
-
-
- 無法載入圖像
-
-
- 檔案"{0}"無效,將被跳過。錯誤:{1}
-
-
- 在{0}的檔案是List.wz檔案,將被跳過。
-
-
- 已存在具有該名稱的節點。請選擇一個不同的名稱
-
-
- 您確定要重新載入所有檔案嗎?
-
-
- 請選擇要儲存的WZ檔案
-
-
- 找不到父WzFile來新增這個WzDirectoryProperty。
-
-
- 已到達樹的末端
-
-
- 您確定要卸載所有檔案嗎?
-
-
- {0}
-
-
- 新版本
-
-
- 找不到匯出目錄。請在工具 -> 選項中指定它
-
-
- MPEG-1音訊層3 (*.mp3)
-
-
- 縮排必須大於0
-
-
- 節點"{0}"已存在。您想替換它嗎?
-
-
- 版本必須大於0
-
-
- 選擇預設XML資料夾
-
-
- 選擇圖像
-
-
- 選擇類型:{0}
-
-
- 選擇MP3檔案
-
-
- 選擇儲存動畫的位置
-
-
- 選擇輸出目錄
-
-
- 選擇儲存檔案的位置
-
-
- 選擇儲存XML的位置
-
-
- 選擇WZ檔案
-
-
- 選擇IMG檔案
-
-
- 選擇XML檔案
-
-
- 警告
-
-
- WZ檔案 (*.wz)
-
-
- WZ圖像檔案 (*.img)
-
-
- 可延伸標記語言 (*.xml)
-
-
- 載入中
-
-
- 這只在HaRepacker的x86版本下可用,請獲取替代版本。
-
-
- 使用自定義加密
-
-
- 暴力破解AES金鑰(生成)
-
-
- {0} 天前
-
-
- {0} 小時前
-
-
- {0} 分鐘前
-
-
- {0} 個月前
-
-
- {0} 秒前
-
-
- {0} 年前
-
-
- 您想在JSON中包含圖像、MP3和其他二進位資料的base64資料嗎?
-
-
- 資料
-
-
- 批次處理
-
-
- 圖像放大
-
-
- 修復舊版楓之谷的'_inlink'、'_outlink'節點
-
-
- 僅品質
-
-
\ No newline at end of file
+
+ 您的瀏覽器或圖像檢視器太舊,無法檢視此圖像。請下載較新的瀏覽器,如Firefox。
+
+
+ 動畫生成器出錯,幀 {0}
+
+
+ 動畫可攜式網路圖形 (*.png)
+
+
+ 立足點
+
+
+ 傳送門
+
+
+ 怪物生成點
+
+
+ 全球楓之谷 (舊)
+
+
+ MSEA/ EMS/ 台灣 (舊)
+
+
+ BMS / GMS / MapleSEA / メイプルストーリー / 메이플스토리
+
+
+ 請輸入有效的內容
+
+
+ 錯誤
+
+
+ 輸入無效。
+
+
+ 力值
+
+
+ {0}無效。
+
+
+ 下一個值
+
+
+ 傳送門類型值
+
+
+ 前一個值
+
+
+ X值
+
+
+ Y值
+
+
+ 圖像 (*.jpg;*.bmp;*.png;*.gif;*.tiff)
+
+
+ 選擇要使用的WZ加密:
+
+
+ WZ加密
+
+
+ 新增畫布
+
+
+ 新增凸形
+
+
+ 新增目錄
+
+
+ 新增雙精度浮點數
+
+
+ 新增浮點數
+
+
+ 新增圖像
+
+
+ 新增整數
+
+
+ 傳送門類型:{0}
+
+
+ 新增連結
+
+
+ 新增空值
+
+
+ 新增短整數
+
+
+ 新增聲音
+
+
+ 新增字串
+
+
+ 新增子項
+
+
+ 新增標籤
+
+
+ 新增向量
+
+
+ 無法將選定的物件插入到這種類型的wz節點中。
+
+
+ 您確定要中止當前操作嗎?
+
+
+ 將WZ節點複製到剪貼簿?(警告 - 如果選擇了許多節點,可能需要很長時間)
+
+
+ 您確定要退出嗎?
+
+
+ 從剪貼簿貼上WZ節點?(警告 - 如果貼上了許多節點,可能需要很長時間)
+
+
+ 您確定要刪除這個嗎?
+
+
+ 您確定要刪除這個節點嗎?
+
+
+ 重新命名
+
+
+ 無法將"{0}"轉換為所需的類型
+
+
+ 您不能複製目錄,因為它們需要太多記憶體
+
+
+ 無法開啟WZ檔案"{0}"
+
+
+ 匯入{0}.img檔案時出錯。您確定選擇了正確的WZ加密嗎?
+
+
+ 無法開啟/儲存到指定的檔案路徑。請以管理員身份執行。
+
+
+ 無法顯示說明,因為找不到說明檔案({0})
+
+
+ 無法載入圖像
+
+
+ 檔案"{0}"無效,將被跳過。錯誤:{1}
+
+
+ 在{0}的檔案是List.wz檔案,將被跳過。
+
+
+ 已存在具有該名稱的節點。請選擇一個不同的名稱
+
+
+ 您確定要重新載入所有檔案嗎?
+
+
+ 請選擇要儲存的WZ檔案
+
+
+ 找不到父WzFile來新增這個WzDirectoryProperty。
+
+
+ 已到達樹的末端
+
+
+ 您確定要卸載所有檔案嗎?
+
+
+ {0}
+
+
+ 新版本
+
+
+ 找不到匯出目錄。請在工具 -> 選項中指定它
+
+
+ MPEG-1音訊層3 (*.mp3)
+
+
+ 縮排必須大於0
+
+
+ 節點"{0}"已存在。您想替換它嗎?
+
+
+ 版本必須大於0
+
+
+ 選擇預設XML資料夾
+
+
+ 選擇圖像
+
+
+ 選擇MP3檔案
+
+
+ 選擇儲存動畫的位置
+
+
+ 選擇輸出目錄
+
+
+ 選擇儲存檔案的位置
+
+
+ 選擇儲存XML的位置
+
+
+ 選擇WZ檔案
+
+
+ 選擇IMG檔案
+
+
+ 選擇XML檔案
+
+
+ 警告
+
+
+ WZ檔案 (*.wz)
+
+
+ WZ圖像檔案 (*.img)
+
+
+ 可延伸標記語言 (*.xml)
+
+
+ 載入中
+
+
+ 這只在HaRepacker的x86版本下可用,請獲取替代版本。
+
+
+ 使用自定義加密
+
+
+ 暴力破解AES金鑰(生成)
+
+
+ {0} 天前
+
+
+ {0} 小時前
+
+
+ {0} 分鐘前
+
+
+ {0} 個月前
+
+
+ {0} 秒前
+
+
+ {0} 年前
+
+
+ 您想在JSON中包含圖像、MP3和其他二進位資料的base64資料嗎?
+
+
+ 資料
+
+
+ 批次處理
+
+
+ 圖像放大
+
+
+ 修復舊版楓之谷的'_inlink'、'_outlink'節點
+
+
+ 僅品質
+
+
\ No newline at end of file
diff --git a/HaSharedLibrary/GUI/FieldLimitChangedEventArgs.cs b/HaSharedLibrary/GUI/FieldLimitChangedEventArgs.cs
new file mode 100644
index 00000000..f7fb2b78
--- /dev/null
+++ b/HaSharedLibrary/GUI/FieldLimitChangedEventArgs.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HaSharedLibrary.GUI {
+
+ ///
+ /// Event handler on field limit change
+ ///
+ public class FieldLimitChangedEventArgs : EventArgs {
+ public ulong FieldLimit { get; }
+
+ public FieldLimitChangedEventArgs(ulong fieldLimit) {
+ FieldLimit = fieldLimit;
+ }
+ }
+}
diff --git a/HaSharedLibrary/GUI/FieldLimitPanel.cs b/HaSharedLibrary/GUI/FieldLimitPanel.cs
index aa23b745..def92fab 100644
--- a/HaSharedLibrary/GUI/FieldLimitPanel.cs
+++ b/HaSharedLibrary/GUI/FieldLimitPanel.cs
@@ -8,11 +8,11 @@
namespace HaSharedLibrary.GUI
{
+
public partial class FieldLimitPanel : UserControl
{
- // UI
- private TextBox setTextboxOnFieldLimitChange = null;
- private ChangeableTextBox setTextboxOnFieldLimitChange_wpf = null;
+ // Event handler
+ public event EventHandler FieldLimitChanged;
// misc
private bool initializingListViewForFieldLimit = false;
@@ -37,14 +37,6 @@ private void FieldLimitPanel_Load(object sender, EventArgs e)
PopulateDefaultListView();
}
- public void SetTextboxOnFieldLimitChange(TextBox setTextboxOnFieldLimitChange)
- {
- this.setTextboxOnFieldLimitChange = setTextboxOnFieldLimitChange;
- }
- public void SetTextboxOnFieldLimitChange(ChangeableTextBox setTextboxOnFieldLimitChange_wpf)
- {
- this.setTextboxOnFieldLimitChange_wpf = setTextboxOnFieldLimitChange_wpf;
- }
///
/// Update the checkboxes upon selection of a 'fieldLimit' WzIntProperty
@@ -139,13 +131,15 @@ private void ListView_fieldLimitType_ItemChecked(object sender, ItemCheckedEvent
}
}
//System.Diagnostics.Debug.WriteLine("Result " + fieldLimit);
- if (setTextboxOnFieldLimitChange != null)
+ /* if (setTextboxOnFieldLimitChange != null)
setTextboxOnFieldLimitChange.Text = fieldLimit.ToString();
if (setTextboxOnFieldLimitChange_wpf != null)
setTextboxOnFieldLimitChange_wpf.Text = fieldLimit.ToString();
-
+ */
// set value
this._fieldLimit = fieldLimit;
+
+ FieldLimitChanged?.Invoke(this, new FieldLimitChangedEventArgs(this._fieldLimit));
}
#endregion
diff --git a/HaSharedLibrary/HaSharedLibrary.csproj b/HaSharedLibrary/HaSharedLibrary.csproj
index 24fe0b9b..e9a48584 100644
--- a/HaSharedLibrary/HaSharedLibrary.csproj
+++ b/HaSharedLibrary/HaSharedLibrary.csproj
@@ -115,6 +115,7 @@
+
FieldTypePanel.xaml
diff --git a/HaSharedLibrary/Util/BitmapHelper.cs b/HaSharedLibrary/Util/BitmapHelper.cs
index 06817e7a..7dcc94d3 100644
--- a/HaSharedLibrary/Util/BitmapHelper.cs
+++ b/HaSharedLibrary/Util/BitmapHelper.cs
@@ -55,6 +55,12 @@ public static Bitmap ConvertImageSourceToBitmap(this ImageSource imageSource) {
return bitmap;
}
+ ///
+ /// Converts a System.Drawing.Bitmap bitmap to Texture2D
+ ///
+ ///
+ ///
+ ///
public static Texture2D ToTexture2D(this System.Drawing.Bitmap bitmap, GraphicsDevice device)
{
if (bitmap == null)
@@ -70,6 +76,30 @@ public static Texture2D ToTexture2D(this System.Drawing.Bitmap bitmap, GraphicsD
}
}
+ ///
+ /// Get the size of an image in Kilobytes
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double GetImageSizeInKB(ImageSource imageSource) {
+ if (imageSource == null)
+ throw new ArgumentNullException(nameof(imageSource));
+
+ if (!(imageSource is BitmapSource bitmapSource))
+ throw new ArgumentException("ImageSource must be a BitmapSource", nameof(imageSource));
+
+ using (MemoryStream stream = new MemoryStream()) {
+ BitmapEncoder encoder = new PngBitmapEncoder(); // You can change this to other formats if needed
+ encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
+ encoder.Save(stream);
+
+ return stream.Length / 1024.0; // Convert bytes to kilobytes
+ }
+ }
+
///
/// Gets the image format extention from ImageFormat object i.e Png returns "png"
///
@@ -108,7 +138,7 @@ public static Bitmap ApplyColorFilter(Bitmap originalBitmap, System.Windows.Medi
new float[] {filterColor.R / 255f, 0, 0, 0, 0},
new float[] {0, filterColor.G / 255f, 0, 0, 0},
new float[] {0, 0, filterColor.B / 255f, 0, 0},
- new float[] {0, 0, 0, 1, 0},
+ new float[] {0, 0, 0, filterColor.A / 255f, 0},
new float[] {0, 0, 0, 0, 1}
});