Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
- Removed unused settings from Config.json
- Reimplement assembly version info in the .csproj file
- Moved enums related to RDB2 into Tabs.Enums
- Replaced Dump Client groupbox with Dump Client button.
- Correctly implemented file selection logic when clicking dump client btn and reenabled drag-n-drop for this button
  • Loading branch information
iSmokeDrow committed Apr 24, 2022
1 parent 4e57909 commit 9ffe0c7
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 101 deletions.
4 changes: 1 addition & 3 deletions Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"ScriptsDirectory": ".\\Scripts"
},
"RDB": {
"Struct_AutoLoad": true,
"DefaultSaveType": 1,
"DefaultSqlSaveType": 0,
"DefaultDirectory": "",
Expand All @@ -45,8 +44,7 @@
"Backup": true,
"UseModifiedXOR": false,
"ModifiedXORKey": [],
"ClearOnCreate": false,
"InputTimeout": 0
"ClearOnCreate": false
},
"Hash": {
"AutoClear": true,
Expand Down
6 changes: 6 additions & 0 deletions Grimoire.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<StartupObject>Grimoire.Program</StartupObject>
<Company>rzLabs Software</Company>
<Copyright>Copyright © 2022</Copyright>
<AssemblyVersion>0.5.1.6</AssemblyVersion>
<FileVersion>0.5.1.6</FileVersion>
<Version>0.5.1.6</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
19 changes: 18 additions & 1 deletion Tabs/Enums.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Grimoire.Tabs
using System;

namespace Grimoire.Tabs
{
public enum Style
{
Expand All @@ -12,4 +14,19 @@ public enum Style
RDB2 = 98,
NONE = 99
}

[Flags]
public enum SaveFileType
{
RDB = 1,
SQL = 2,
CSV = 4,
ALL = RDB | SQL | CSV
}

public enum SaveSqlFileType
{
Insert,
Update
}
}
49 changes: 17 additions & 32 deletions Tabs/Styles/Launcher.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 65 additions & 41 deletions Tabs/Styles/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void launch_btn_Click(object sender, EventArgs e)

private void launch_market_btn_MouseUp(object sender, MouseEventArgs e) => launch_market_btn.BorderStyle = BorderStyle.FixedSingle;

private async void dumpClient_btn_DragDrop(object sender, DragEventArgs e)
private void dumpClient_btn_DragDrop(object sender, DragEventArgs e)
{
Encoding encoding = Encoding.GetEncoding(configMgr.Get<int>("Codepage", "Grim"));
bool backup = configMgr.Get<bool>("Backup", "data");
Expand All @@ -129,7 +129,7 @@ private async void dumpClient_btn_DragDrop(object sender, DragEventArgs e)

string[] paths = (string[])e.Data.GetData(DataFormats.FileDrop);
string dataPath = null;
string buildDir = configMgr.GetDirectory("BuildDirectory", "Grim");


if (File.GetAttributes(paths[0]).HasFlag(FileAttributes.Directory))
{
Expand All @@ -145,50 +145,20 @@ private async void dumpClient_btn_DragDrop(object sender, DragEventArgs e)
else
dataPath = paths[0];

data.CurrentMaxDetermined += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Maximum = (int)x.Maximum;
}));
};

data.CurrentProgressChanged += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Value = (int)x.Value;
}));
};

data.CurrentProgressReset += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Maximum = 100;
data_prg.Value = 0;
}));
};

await Task.Run(() =>
{
data.Load(dataPath);
});

if (data.RowCount <= 0)
{
string exMsg = "No data has been loaded!";
dumpClient(dataPath);
}

Log.Error(exMsg);
private void dumpClient_btn_Click(object sender, EventArgs e)
{
Paths.DefaultDirectory = configMgr.GetDirectory("LoadDirectory", "Data");
Paths.DefaultFileName = "data.000";

MessageBox.Show(exMsg, "Client Dump Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
string path = Paths.FilePath;

if (Paths.FileResult != DialogResult.OK)
return;
}

#pragma warning disable CS4014
Task.Run(() => { data.ExportAllEntries(buildDir); });
#pragma warning restore CS4014
dumpClient(path);
}

private void newClient_btn_Click(object sender, EventArgs e) => createClient();
Expand Down Expand Up @@ -541,6 +511,59 @@ async void createClient(string dumpDirectory = null)
}

data_status_lb.ResetText();

newClient_btn.Enabled = true;
dumpClient_btn.Enabled = true;
}

async void dumpClient(string dataPath)
{
string buildDir = configMgr.GetDirectory("BuildDirectory", "Grim");

data.CurrentMaxDetermined += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Maximum = (int)x.Maximum;
}));
};

data.CurrentProgressChanged += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Value = (int)x.Value;
}));
};

data.CurrentProgressReset += (o, x) =>
{
this.Invoke(new MethodInvoker(delegate
{
data_prg.Maximum = 100;
data_prg.Value = 0;
}));
};

await Task.Run(() =>
{
data.Load(dataPath);
});

if (data.RowCount <= 0)
{
string exMsg = "No data has been loaded!";

Log.Error(exMsg);

MessageBox.Show(exMsg, "Client Dump Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);

return;
}

#pragma warning disable CS4014
Task.Run(() => { data.ExportAllEntries(buildDir); });
#pragma warning restore CS4014
}

async void saveRDBToSQL(string path)
Expand Down Expand Up @@ -657,5 +680,6 @@ private void onHashProgress(int value)
}

#endregion

}
}
14 changes: 7 additions & 7 deletions Tabs/Styles/Launcher.resx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<data name="dmpClient_ico.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAABMVJREFUaEPVmd9PHFUUx9lqNKkFSluxYKsvtcGFNiRQ8cGYzACFQB/nshQ2We2r
DgAACw4BQL7hQQAABMVJREFUaEPVmd9PHFUUx9lqNKkFSluxYKsvtcGFNiRQ8cGYzACFQB/nshQ2We2r
4K9nQaP/lg++mvigbYxN06RKVfwBKNDGWqDj55x77s7SSOyDC5eTfPM9O3Nn5nzvOefe3dmW/8sqcwuB
Wytzi0vT732S429V5he2K+9+LP5v4IyNKengmIxAjRfbpuYXfpn54LN8msAFM+9/mk/NL/4JzsoYOEIB
c4uBJQM3ELIBy6z/LsHDt0C3HxNhBtw7HwUugS5wFpxpQDd4qnFsdDZR+9C8vW3yrf8ecyA2NFnzPFET
Expand All @@ -87,7 +87,7 @@
<data name="newClient_ico.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAChZJREFUaEPFmttvXUcVxh0nbR9SgmilFpAqKBAiEEVJaQONqlZQEPDQSpQH/heQ
DgAACw4BQL7hQQAAChZJREFUaEPFmttvXUcVxh0nbR9SgmilFpAqKBAiEEVJaQONqlZQEPDQSpQH/heQ
+gBvJFSiD8ilQAkteaCRQ5M0cauWJhIiiSjIIXHIrU7sxPe9j6+JHR8fD99vzcw+c272sXFhpM9r7bms
9a25733csRFpfGqqYyzPTUeOZRnYNJrnm5ABHXq2OlH+31IkgyQZ0TzvFDaPZtnmkVLJ8uuT6m9WXdCp
epssT3awBT7yZL0bHAXHnZCyjLqk/K0q/4QkuDdk1yQCVllnJI/Us+kbmqLhxBE92GkPSnreKjJPq86P
Expand Down Expand Up @@ -136,7 +136,7 @@
<data name="launch_data_btn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAABiFJREFUeF7tWl1PVEcY3h+wy2+osS0ImqYiUK2o0A+hqFg+rQsYlXgj1GhNrwoN
DgAACw4BQL7hQQAABiFJREFUeF7tWl1PVEcY3h+wy2+osS0ImqYiUK2o0A+hqFg+rQsYlXgj1GhNrwoN
cNOr0iZtb6oX7UXxoq1pmtQ2ktYPUFcQFwRdbdA22R+wG5bLOn2e95xZh5UFTM6eHeO+yZN3cmbmfZ95
5p05u9kNFMwDi0TvpT1xczqW9t7DycW2VaZF8MO0CNZYRgUEsTsh+FCE3gMwnotgxMYKMATgwuMgl4JP
wCc9QTTGWCkgDgGCZk4rzBCgCEjdvjuvJmbuq8k7DzwBYzFmJBpbAEJOLjsrIKcC4OwvACKAVfeAIQCO
Expand Down Expand Up @@ -168,7 +168,7 @@
<data name="launch_rdb_btn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAAuFJREFUeF7tl1Fu2zAQRH2A5DR2z2C3V7Db0/cAzYc/m3TfylNQWVqGQX0MED2A
DgAACw4BQL7hQQAAAuFJREFUeF7tl1Fu2zAQRH2A5DR2z2C3V7Db0/cAzYc/m3TfylNQWVqGQX0MED2A
0EIzOyYIAl7tNoLD6fL/ub8t6qXV+tQr2neOeV0eGhbo9brnzTiczvncH8+YX+L5Gu9iXe6s8+vkSW/2
KgPc8wr743RCYX45HC+/o/Ea1+dPPN9666Zd8dLTZoB7XmGvE+bkTufrtx+/Pg6nnx+H73dWaHjw0tNm
gGo0PG55hTgtPbk2cXqEXP7Ger+zQksPJ50/EM/MANVok8crryARc6y36RQziGdvvd88XLlHG7bLK0jE
Expand All @@ -186,7 +186,7 @@
<data name="launch_hash_btn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAABO5JREFUeF7tmM1uFEcQx21i8yGBfeGUKxzhdWwgjmQ4RInUCzjkFvUQ8vUU2O/D
DgAACw4BQL7hQQAABO5JREFUeF7tmM1uFEcQx21i8yGBfeGUKxzhdWwgjmQ4RInUCzjkFvUQ8vUU2O/D
BQmeIXcvRBF4vR/5/au7Z2btWa1n7eBx3H+pVL2z3dVV1dVV3b2UkZGRkZGRkZGRkZGRcUGw2fMlr7cv
DTZcURnuimUotY1fGiQnbCgS3CWKhJrht1n1Z7G9LEfEtvGFUYZUT6FWEHLeKP0+CW2Ia1xsC4nXUQ9f
UVjNaVlHiS2wrDH0XaPvGN1+jjKunKETTimgBmSxOsedIEMTR2Ezqg2Qe51x/a0Xf07gz8O3ygkL21BX
Expand All @@ -213,7 +213,7 @@
<data name="launch_item_btn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAABzVJREFUeF7tms9PXFUUx4cf7koj7GTjpit+pKkMdAELhyIz0CaldpC2b4pFTdyg
DgAACw4BQL7hQQAABzVJREFUeF7tms9PXFUUx4cf7koj7GTjpit+pKkMdAELhyIz0CaldpC2b4pFTdyg
i6oxQRMTNxpN3OnOhTap/0ZdNFLS8sPGgtho6qYRXNREfswMw/P7Pffe551fzAzMwLxhTnJyDu89eO/z
vb/OvW2gbnWrW93qVre6VaUFI7FAT9hReTjWEAw7TYjN8KZgxFx35LmaM0AKnMqdRkkyDOI06AivMRGs
FhZ4CNKCfBJxBj4WHLmWeb8GRfDgnC4APu47P+WevfCG23f+htsTid0BcJu6H2vSUbwmzOsBEYdjf4Hg
Expand Down Expand Up @@ -250,7 +250,7 @@
<data name="launch_market_btn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAC8NJREFUeF7tWE1sXNUVdpwEsUFKW6midNGKREj4J2kSJ8GChs6YOP/ESd54Yo8d
DgAACw4BQL7hQQAAC8NJREFUeF7tWE1sXNUVdpwEsUFKW6midNGKREj4J2kSJ8GChs6YOP/ESd54Yo8d
EiA/TWbyBy1NYSZpoNANLLtppbQVy3aTCiG1C1gRqa1KJVatVMQCqS0FgZCiSjP2vH7f+Xm+M37jTBLb
saMc6eieue/de77vnHPveXbHXbkrd2XeJF+sdAwXy2JzHMZvSr7EebXvWBkulYWo2Z1iQBAUsfN8fqcG
wbNOQaaX6lheDns5bZCXOUr47qIXkgmyTnuZ2pUH8OwqAnAVWf8m5/jMK4DHgRWxqIWE/VyDbCcILjF7
Expand Down
Loading

0 comments on commit 9ffe0c7

Please sign in to comment.