Skip to content

Commit a5518a1

Browse files
authored
Added the option to display the hue index as it is ingame in every client and server (#152)
* Added the option to display the hue index as it is ingame in every client and server, as opposed to how they are ordered in the client file * Search should find the correct hue, depending on the offset
1 parent 6e8c67c commit a5518a1

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

UoFiddler.Controls/UserControls/HuesControl.Designer.cs

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UoFiddler.Controls/UserControls/HuesControl.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,11 @@ private void OnPaint(object sender, PaintEventArgs e)
158158
float size = (float)(pictureBox.Width - 200) / 32;
159159
Hue hue = Hues.List[index];
160160
Rectangle stringRect = new Rectangle(3, y * _itemHeight, pictureBox.Width, _itemHeight);
161+
162+
int hueDisplayIndex = hue.Index + (IndexOffsetButton.Checked ? 1 : 0);
163+
161164
e.Graphics.DrawString(
162-
$"{hue.Index,-5} {$"(0x{hue.Index:X})",-7} {hue.Name}", Font, Brushes.Black, stringRect);
165+
$"{hueDisplayIndex,-5} {$"(0x{hueDisplayIndex:X})",-7} {hue.Name}", Font, Brushes.Black, stringRect);
163166

164167
for (int i = 0; i < hue.Colors.Length; ++i)
165168
{
@@ -314,6 +317,11 @@ private void HueIndexToolStripTextBox_KeyUp(object sender, KeyEventArgs e)
314317
return;
315318
}
316319

320+
if (IndexOffsetButton.Checked)
321+
{
322+
indexValue--;
323+
}
324+
317325
if (indexValue < 0)
318326
{
319327
indexValue = 0;
@@ -390,5 +398,10 @@ private void ExportAllHueNamesListToolStripMenuItem_Click(object sender, EventAr
390398

391399
MessageBox.Show($"Hue names list saved to {fileName}", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
392400
}
401+
402+
private void IndexOffsetButton_CheckedChanged(object sender, EventArgs e)
403+
{
404+
pictureBox.Invalidate();
405+
}
393406
}
394407
}

UoFiddler.Controls/UserControls/HuesControl.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
33
<!--
4-
Microsoft ResX Schema
4+
Microsoft ResX Schema
55
66
Version 2.0
77
@@ -18,7 +18,7 @@
1818
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
1919
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
2020
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21-
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
2222
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
2323
<value>[base64 mime encoded serialized .NET Framework object]</value>
2424
</data>
@@ -48,7 +48,7 @@
4848
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
5353
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter

0 commit comments

Comments
 (0)