├── Zeldahud.rar
├── bin
└── Release
│ └── items.png
├── App.config
├── Properties
├── Settings.settings
├── Settings.Designer.cs
├── AssemblyInfo.cs
├── Resources.Designer.cs
└── Resources.resx
├── .gitattributes
├── Stats.cs
├── Program.cs
├── Version.cs
├── CustomItem.cs
├── ItemSelectorForm.cs
├── Stats.Designer.cs
├── OptionsForm.cs
├── itemlist.txt
├── HudForm.Designer.cs
├── TilesetChooserForm.cs
├── HudZelda.csproj
├── zeldaGui.csproj
├── ItemSelectorForm.Designer.cs
├── Stats.resx
├── TilesetChooserForm.resx
├── ItemSelectorForm.resx
├── OptionsForm.Designer.cs
├── HudForm.resx
├── OptionsForm.resx
├── TilesetChooserForm.Designer.cs
├── Form1.resx
├── Form1.Designer.cs
├── HudForm.cs
└── Form1.cs
/Zeldahud.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zarby89/ZeldaHud/HEAD/Zeldahud.rar
--------------------------------------------------------------------------------
/bin/Release/items.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zarby89/ZeldaHud/HEAD/bin/Release/items.png
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/Stats.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace zeldaGui
12 | {
13 | public partial class Stats : Form
14 | {
15 | public Stats()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace zeldaGui
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Version.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Net;
7 | namespace zeldaGui
8 | {
9 | class Version
10 | {
11 |
12 | public static bool CheckUpdate()
13 | {
14 | string CurrentVersion = "3.0";
15 | string checkVersion = "";
16 | using (WebClient wc = new WebClient())
17 | {
18 | checkVersion = wc.DownloadString("https://zarby89.github.io/ZeldaHud/version.txt");
19 | }
20 | if (!checkVersion.Contains(CurrentVersion))
21 | {
22 | return true;
23 | }
24 | return false;
25 | }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CustomItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace zeldaGui
8 | {
9 | public class CustomItem
10 | {
11 | public byte[] iconsId;
12 | public byte level;
13 | public bool on;
14 | public string name;
15 | public bool loop = false;
16 | public bool bottle = false;
17 | public bool count = false;
18 | public byte counter = 0;
19 | public CustomItem(byte[] iconsId, string name, bool loop = false,bool bottle = false,bool count = false)
20 | {
21 | this.iconsId = iconsId;
22 | this.level = 0;
23 | this.on = false;
24 | this.name = name;
25 | this.bottle = bottle;
26 | this.loop = loop;
27 | this.count = count;
28 | }
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace zeldaGui.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ItemSelectorForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace zeldaGui
12 | {
13 | public partial class ItemSelectorForm : Form
14 | {
15 | public ItemSelectorForm()
16 | {
17 | InitializeComponent();
18 | }
19 | public int selectedItem = 0;
20 | private void button1_Click(object sender, EventArgs e)
21 | {
22 | if (listView1.SelectedIndices.Count > 0)
23 | {
24 | selectedItem = listView1.SelectedIndices[0];
25 | }
26 | this.Close();
27 | }
28 |
29 | private void button2_Click(object sender, EventArgs e)
30 | {
31 | this.Close();
32 | }
33 |
34 | private void ItemSelectorForm_Load(object sender, EventArgs e)
35 | {
36 | imageList1.Images.AddRange(Form1.iconSet);
37 | listView1.LargeImageList = imageList1;
38 | for (int i = 0; i < Form1.itemsList.Count; i++)
39 | {
40 | listView1.Items.Add(Form1.itemsList[i].name, Form1.itemsList[i].iconsId[0]);
41 | }
42 | }
43 |
44 | private void button3_Click(object sender, EventArgs e)
45 | {
46 | selectedItem = 255;
47 | this.Close();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("zeldaGui")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("zeldaGui")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("affcfa3b-ae19-4dac-a211-50d3f7f8b028")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Stats.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace zeldaGui
2 | {
3 | partial class Stats
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.richTextBox1 = new System.Windows.Forms.RichTextBox();
32 | this.SuspendLayout();
33 | //
34 | // richTextBox1
35 | //
36 | this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.richTextBox1.Location = new System.Drawing.Point(0, 0);
38 | this.richTextBox1.Name = "richTextBox1";
39 | this.richTextBox1.Size = new System.Drawing.Size(384, 561);
40 | this.richTextBox1.TabIndex = 0;
41 | this.richTextBox1.Text = "";
42 | //
43 | // Stats
44 | //
45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
47 | this.ClientSize = new System.Drawing.Size(384, 561);
48 | this.Controls.Add(this.richTextBox1);
49 | this.Name = "Stats";
50 | this.Text = "Stats";
51 | this.ResumeLayout(false);
52 |
53 | }
54 |
55 | #endregion
56 |
57 | public System.Windows.Forms.RichTextBox richTextBox1;
58 | }
59 | }
--------------------------------------------------------------------------------
/OptionsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 |
12 | namespace zeldaGui
13 | {
14 | public partial class OptionsForm : Form
15 | {
16 | public OptionsForm()
17 | {
18 | InitializeComponent();
19 | }
20 | public string iconset = @"IconsSets\Defaults";
21 | private void panel1_MouseDoubleClick(object sender, MouseEventArgs e)
22 | {
23 | colorDialog1.Color = Form1.clearColor;
24 | colorDialog1.ShowDialog();
25 | Form1.clearColor = colorDialog1.Color;
26 | panel1.BackColor = colorDialog1.Color;
27 | }
28 |
29 | private void OptionsForm_Load(object sender, EventArgs e)
30 | {
31 | panel1.BackColor = Form1.clearColor;
32 | label3.MaximumSize = new Size(250, 200);
33 | label3.AutoSize = true;
34 | label3.Text = iconset;
35 | }
36 | public string bgr;
37 | private void button1_Click(object sender, EventArgs e)
38 | {
39 | //Path.
40 | /*folderBrowserDialog1.SelectedPath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
41 | if (folderBrowserDialog1.ShowDialog() == DialogResult.Cancel)
42 | {
43 |
44 | }
45 | else
46 | {
47 | label3.MaximumSize = new Size(250, 200);
48 | label3.AutoSize = true;
49 |
50 | label3.Text = folderBrowserDialog1.SelectedPath;
51 | iconset = folderBrowserDialog1.SelectedPath;
52 | }*/
53 | TilesetChooserForm tcf = new TilesetChooserForm();
54 | if (tcf.ShowDialog() == DialogResult.OK)
55 | {
56 | iconset = tcf.selectetIconset;
57 | label3.Text = iconset;
58 | bgr = tcf.selectedBgr;
59 | }
60 |
61 | }
62 |
63 | private void button2_Click(object sender, EventArgs e)
64 | {
65 | fontDialog1.ShowDialog();
66 |
67 | }
68 |
69 | private void fontDialog1_Apply(object sender, EventArgs e)
70 | {
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/itemlist.txt:
--------------------------------------------------------------------------------
1 | //Please note the first 45 items (45 is Agahnim)
2 | //order should not be changed if you use auto-update
3 | //<- commentary not readed by the program
4 | //Also do not use , in item name :p
5 |
6 | //Name, {Icons Order},Loop,isBottle,haveCount
7 | :Bow,{48,49,49},false,false,false;
8 | :Boomerang,{1},false,false,false;
9 | :Hookshot,{2},false,false,false;
10 | :Bombs,{3},false,false,false;
11 | :Mushroom,{4,56},false,false,false;
12 | :Fire Rod,{5},false,false,false;
13 | :Ice Rod,{6},false,false,false;
14 | :Bombos,{7},false,false,false;
15 | :Ether,{8},false,false,false;
16 | :Quake,{9},false,false,false;
17 | :Lamp,{10},false,false,false;
18 | :Hammer,{11},false,false,false;
19 | :Shovel,{12,57},false,false,false;
20 | :Net,{13},false,false,false;
21 | :Book,{14},false,false,false;
22 | :Cane of Somaria,{15},false,false,false;
23 | :Cane of Byrna,{16},false,false,false;
24 | :Cape,{17},false,false,false;
25 | :Mirror,{18,18},false,false,false;
26 | :Gloves,{19,43},false,false,false;
27 | :Boots,{20},false,false,false;
28 | :Flippers,{21},false,false,false;
29 | :Moon Pearl,{22},false,false,false;
30 | :Swords,{23,38,39,40},false,false,false;
31 | :Shield,{24,44,45},false,false,false;
32 | :Tunic,{25,41,42},false,false,false;
33 | :Bottle 1,{26,26,50,51,52,53,54,54},false,true,false;
34 | :Bottle 2,{26,26,50,51,52,53,54,54},false,true,false;
35 | :Bottle 3,{26,26,50,51,52,53,54,54},false,true,false;
36 | :Bottle 4,{26,26,50,51,52,53,54,54},false,true,false;
37 | :Eastern Pendant,{27},false,false,false;
38 | :Desert Pendant,{28},false,false,false;
39 | :Hera,{29},false,false,false;
40 | :Crystal 1,{30},false,false,false;
41 | :Crystal 2,{31},false,false,false;
42 | :Crystal 3,{32},false,false,false;
43 | :Crystal 4,{33},false,false,false;
44 | :Crystal 5,{34},false,false,false;
45 | :Crystal 6,{35},false,false,false;
46 | :Crystal 7,{36},false,false,false;
47 | :Red Boomerang,{37},false,false,false;
48 | :Powder,{46},false,false,false;
49 | :Flute,{47},false,false,false;
50 | :Agahnim,{55},false,false,false; //Here end autoupdate logic
51 | :Timer,{61},false,false,false; //show a timer that start when pressing Timer_Start
52 | :Timer_Start,{62},false,false,false; //start the timer
53 | :Timer_Done,{63},false,false,false; //end the timer
54 | :Time_StartDone,{62,63},false,false,false; //start and end the timer
55 | :Nothing,{53},false,false,false; //can be changed in something else - do not remove
56 | :Nothing,{54},false,false,false; //can be changed in something else - do not remove
57 | :Nothing,{55},false,false,false;
58 | :Chest,{58,59},false,false,false; //Do not remove anything above here
59 | :Sanc Heart,{60},false,false,false;
60 | :Heart Pieces,{66,67,68,69},true,false,false;
61 | :Heart Pieces,{66,67,68,69},true,false,false;
62 | :Bottle Counter,{70,71,72,73},false,false,false;
63 | :Bottle Counter2,{26,71,72,73},false,false,false;
64 | :ShovelFlute,{12,47},false,false,false;
65 | :MushPowder,{46,4},false,false,false;
66 | :BothBoomerang,{1,37},false,false,false;
67 | :DoubleQuarterMagic,{64,65},false,false,false;
68 | :Heart Counter,{60},false,false,true;
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace zeldaGui.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("zeldaGui.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/HudForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace HudZelda
2 | {
3 | partial class HudForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.imageList1 = new System.Windows.Forms.ImageList(this.components);
34 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
35 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
36 | this.SuspendLayout();
37 | //
38 | // pictureBox1
39 | //
40 | this.pictureBox1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
41 | this.pictureBox1.Location = new System.Drawing.Point(12, 12);
42 | this.pictureBox1.Name = "pictureBox1";
43 | this.pictureBox1.Size = new System.Drawing.Size(100, 50);
44 | this.pictureBox1.TabIndex = 0;
45 | this.pictureBox1.TabStop = false;
46 | this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
47 | this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick);
48 | //
49 | // imageList1
50 | //
51 | this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
52 | this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
53 | this.imageList1.TransparentColor = System.Drawing.Color.Fuchsia;
54 | //
55 | // contextMenuStrip1
56 | //
57 | this.contextMenuStrip1.Name = "contextMenuStrip1";
58 | this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
59 | this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked);
60 | this.contextMenuStrip1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.contextMenuStrip1_MouseClick);
61 | //
62 | // HudForm
63 | //
64 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
65 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
66 | this.BackColor = System.Drawing.SystemColors.ActiveCaption;
67 | this.ClientSize = new System.Drawing.Size(224, 192);
68 | this.Controls.Add(this.pictureBox1);
69 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
70 | this.Name = "HudForm";
71 | this.Text = "HudForm";
72 | this.TopMost = true;
73 | this.Load += new System.EventHandler(this.HudForm_Load);
74 | this.SizeChanged += new System.EventHandler(this.HudForm_SizeChanged);
75 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
76 | this.ResumeLayout(false);
77 |
78 | }
79 |
80 | #endregion
81 |
82 | public System.Windows.Forms.PictureBox pictureBox1;
83 | private System.Windows.Forms.ImageList imageList1;
84 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
85 | }
86 | }
--------------------------------------------------------------------------------
/TilesetChooserForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 |
12 | namespace zeldaGui
13 | {
14 | public partial class TilesetChooserForm : Form
15 | {
16 | public TilesetChooserForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void TilesetChooserForm_Load(object sender, EventArgs e)
22 | {
23 | var files = Directory.EnumerateDirectories("IconsSets\\");
24 |
25 | foreach (string folder in files)
26 | {
27 | listBox1.Items.Add(folder);
28 | }
29 |
30 | files = Directory.EnumerateFiles("Backgrounds\\");
31 | listBox2.Items.Add("None");
32 | foreach (string file in files)
33 | {
34 | listBox2.Items.Add(file);
35 | }
36 | listBox1.SelectedIndex = 0;
37 | listBox2.SelectedIndex = 0;
38 |
39 | }
40 | Bitmap[] iconSet;
41 | public void loadIconsSet(string data)
42 | {
43 | iconSet = new Bitmap[25];
44 | for (int i = 0; i < 25; i++)
45 | {
46 | if (File.Exists(data + "\\" + i.ToString("D4") + ".png"))
47 | {
48 | iconSet[i] = new Bitmap(data + "\\" + i.ToString("D4") + ".png");
49 | iconSet[i].MakeTransparent(Color.Fuchsia);
50 | }
51 | }
52 | //GC.Collect();
53 | drawIcons();
54 | }
55 |
56 | private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
57 | {
58 | if (listBox1.SelectedIndex != -1)
59 | {
60 | loadIconsSet((string)listBox1.Items[listBox1.SelectedIndex]);
61 | }
62 | }
63 |
64 |
65 |
66 | public void drawIcons()
67 | {
68 | pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
69 |
70 | Graphics g = Graphics.FromImage(pictureBox1.Image);
71 | g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
72 | g.Clear(pictureBox1.BackColor);
73 | int icon = 0;
74 | for (int x = 0; x < 5; x++)
75 | {
76 | for (int y = 0; y < 5; y++)
77 | {
78 | if (bgr != null)
79 | {
80 | g.DrawImage(bgr, new Rectangle(x * 32, y * 32, 32, 32), 0, 0, 32, 32, GraphicsUnit.Pixel);
81 | }
82 | if (iconSet != null)
83 | {
84 | g.DrawImage(iconSet[icon], new Rectangle(x * 32, y * 32, 32, 32), 0, 0, 32, 32, GraphicsUnit.Pixel);
85 | }
86 | icon++;
87 | }
88 | }
89 | pictureBox1.Refresh();
90 | }
91 | public string selectetIconset = "";
92 | public string selectedBgr = "";
93 | private void button1_Click(object sender, EventArgs e)
94 | {
95 | if (listBox1.SelectedIndex != -1)
96 | {
97 | selectetIconset = (string)listBox1.Items[listBox1.SelectedIndex];
98 | }
99 | if (listBox2.SelectedIndex != -1)
100 | {
101 | selectedBgr = (string)listBox2.Items[listBox2.SelectedIndex];
102 | }
103 | }
104 | Bitmap bgr;
105 | private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
106 | {
107 | if (listBox2.SelectedIndex <= 0)
108 | {
109 | bgr = null;
110 | }
111 | else
112 | {
113 | bgr = new Bitmap((string)listBox2.Items[listBox2.SelectedIndex]);
114 | bgr.MakeTransparent(Color.Fuchsia);
115 | drawIcons();
116 | }
117 | }
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/HudZelda.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {08C2AE9D-8743-4DB7-9891-8AE2E6DCA47B}
8 | WinExe
9 | Properties
10 | HudZelda
11 | HudZelda
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | Form
51 |
52 |
53 | Form1.cs
54 |
55 |
56 | Form
57 |
58 |
59 | HudForm.cs
60 |
61 |
62 |
63 |
64 | Form1.cs
65 |
66 |
67 | HudForm.cs
68 |
69 |
70 | ResXFileCodeGenerator
71 | Resources.Designer.cs
72 | Designer
73 |
74 |
75 | True
76 | Resources.resx
77 |
78 |
79 | SettingsSingleFileGenerator
80 | Settings.Designer.cs
81 |
82 |
83 | True
84 | Settings.settings
85 | True
86 |
87 |
88 |
89 |
90 |
91 |
92 |
99 |
--------------------------------------------------------------------------------
/zeldaGui.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {AFFCFA3B-AE19-4DAC-A211-50D3F7F8B028}
8 | WinExe
9 | Properties
10 | zeldaGui
11 | zeldaGui
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | Form
55 |
56 |
57 | Form1.cs
58 |
59 |
60 | Form
61 |
62 |
63 | ItemSelectorForm.cs
64 |
65 |
66 | Form
67 |
68 |
69 | OptionsForm.cs
70 |
71 |
72 |
73 |
74 | Form
75 |
76 |
77 | Stats.cs
78 |
79 |
80 | Form
81 |
82 |
83 | TilesetChooserForm.cs
84 |
85 |
86 |
87 | Form1.cs
88 |
89 |
90 | ItemSelectorForm.cs
91 |
92 |
93 | OptionsForm.cs
94 |
95 |
96 | ResXFileCodeGenerator
97 | Resources.Designer.cs
98 | Designer
99 |
100 |
101 | True
102 | Resources.resx
103 |
104 |
105 | Stats.cs
106 |
107 |
108 | TilesetChooserForm.cs
109 |
110 |
111 | SettingsSingleFileGenerator
112 | Settings.Designer.cs
113 |
114 |
115 | True
116 | Settings.settings
117 | True
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
134 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ItemSelectorForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace zeldaGui
2 | {
3 | partial class ItemSelectorForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.button1 = new System.Windows.Forms.Button();
34 | this.button2 = new System.Windows.Forms.Button();
35 | this.imageList1 = new System.Windows.Forms.ImageList(this.components);
36 | this.listView1 = new System.Windows.Forms.ListView();
37 | this.button3 = new System.Windows.Forms.Button();
38 | this.panel1.SuspendLayout();
39 | this.SuspendLayout();
40 | //
41 | // panel1
42 | //
43 | this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
44 | | System.Windows.Forms.AnchorStyles.Left)
45 | | System.Windows.Forms.AnchorStyles.Right)));
46 | this.panel1.Controls.Add(this.listView1);
47 | this.panel1.Location = new System.Drawing.Point(0, 1);
48 | this.panel1.Name = "panel1";
49 | this.panel1.Size = new System.Drawing.Size(345, 289);
50 | this.panel1.TabIndex = 0;
51 | //
52 | // button1
53 | //
54 | this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
55 | this.button1.Location = new System.Drawing.Point(268, 297);
56 | this.button1.Name = "button1";
57 | this.button1.Size = new System.Drawing.Size(75, 23);
58 | this.button1.TabIndex = 1;
59 | this.button1.Text = "Add";
60 | this.button1.UseVisualStyleBackColor = true;
61 | this.button1.Click += new System.EventHandler(this.button1_Click);
62 | //
63 | // button2
64 | //
65 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
66 | this.button2.Location = new System.Drawing.Point(187, 297);
67 | this.button2.Name = "button2";
68 | this.button2.Size = new System.Drawing.Size(75, 23);
69 | this.button2.TabIndex = 2;
70 | this.button2.Text = "Cancel";
71 | this.button2.UseVisualStyleBackColor = true;
72 | this.button2.Click += new System.EventHandler(this.button2_Click);
73 | //
74 | // imageList1
75 | //
76 | this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit;
77 | this.imageList1.ImageSize = new System.Drawing.Size(32, 32);
78 | this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
79 | //
80 | // listView1
81 | //
82 | this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
83 | this.listView1.Location = new System.Drawing.Point(0, 0);
84 | this.listView1.MultiSelect = false;
85 | this.listView1.Name = "listView1";
86 | this.listView1.Size = new System.Drawing.Size(345, 289);
87 | this.listView1.TabIndex = 0;
88 | this.listView1.UseCompatibleStateImageBehavior = false;
89 | //
90 | // button3
91 | //
92 | this.button3.DialogResult = System.Windows.Forms.DialogResult.OK;
93 | this.button3.Location = new System.Drawing.Point(106, 297);
94 | this.button3.Name = "button3";
95 | this.button3.Size = new System.Drawing.Size(75, 23);
96 | this.button3.TabIndex = 3;
97 | this.button3.Text = "Remove";
98 | this.button3.UseVisualStyleBackColor = true;
99 | this.button3.Click += new System.EventHandler(this.button3_Click);
100 | //
101 | // ItemSelectorForm
102 | //
103 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
105 | this.ClientSize = new System.Drawing.Size(344, 321);
106 | this.Controls.Add(this.button3);
107 | this.Controls.Add(this.button2);
108 | this.Controls.Add(this.button1);
109 | this.Controls.Add(this.panel1);
110 | this.Name = "ItemSelectorForm";
111 | this.Text = "ItemSelectorForm";
112 | this.Load += new System.EventHandler(this.ItemSelectorForm_Load);
113 | this.panel1.ResumeLayout(false);
114 | this.ResumeLayout(false);
115 |
116 | }
117 |
118 | #endregion
119 |
120 | private System.Windows.Forms.Panel panel1;
121 | private System.Windows.Forms.Button button1;
122 | private System.Windows.Forms.Button button2;
123 | private System.Windows.Forms.ListView listView1;
124 | private System.Windows.Forms.ImageList imageList1;
125 | private System.Windows.Forms.Button button3;
126 | }
127 | }
--------------------------------------------------------------------------------
/Stats.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/TilesetChooserForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/ItemSelectorForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/OptionsForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace zeldaGui
2 | {
3 | partial class OptionsForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.panel1 = new System.Windows.Forms.Panel();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.label3 = new System.Windows.Forms.Label();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.colorDialog1 = new System.Windows.Forms.ColorDialog();
37 | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
38 | this.checkBox1 = new System.Windows.Forms.CheckBox();
39 | this.fontDialog1 = new System.Windows.Forms.FontDialog();
40 | this.SuspendLayout();
41 | //
42 | // panel1
43 | //
44 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(60)))));
45 | this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
46 | this.panel1.ForeColor = System.Drawing.SystemColors.ControlText;
47 | this.panel1.Location = new System.Drawing.Point(15, 25);
48 | this.panel1.Name = "panel1";
49 | this.panel1.Size = new System.Drawing.Size(45, 28);
50 | this.panel1.TabIndex = 0;
51 | this.panel1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDoubleClick);
52 | //
53 | // label1
54 | //
55 | this.label1.AutoSize = true;
56 | this.label1.Location = new System.Drawing.Point(12, 9);
57 | this.label1.Name = "label1";
58 | this.label1.Size = new System.Drawing.Size(101, 13);
59 | this.label1.TabIndex = 1;
60 | this.label1.Text = "Background Color : ";
61 | //
62 | // label2
63 | //
64 | this.label2.AutoSize = true;
65 | this.label2.Location = new System.Drawing.Point(12, 56);
66 | this.label2.Name = "label2";
67 | this.label2.Size = new System.Drawing.Size(89, 13);
68 | this.label2.TabIndex = 2;
69 | this.label2.Text = "Icons Set Used : ";
70 | //
71 | // label3
72 | //
73 | this.label3.AutoSize = true;
74 | this.label3.Location = new System.Drawing.Point(12, 98);
75 | this.label3.Name = "label3";
76 | this.label3.Size = new System.Drawing.Size(113, 13);
77 | this.label3.TabIndex = 3;
78 | this.label3.Text = "IconsSets\\\\Defaults\\\\";
79 | //
80 | // button1
81 | //
82 | this.button1.Location = new System.Drawing.Point(15, 72);
83 | this.button1.Name = "button1";
84 | this.button1.Size = new System.Drawing.Size(75, 23);
85 | this.button1.TabIndex = 4;
86 | this.button1.Text = "Browse";
87 | this.button1.UseVisualStyleBackColor = true;
88 | this.button1.Click += new System.EventHandler(this.button1_Click);
89 | //
90 | // folderBrowserDialog1
91 | //
92 | this.folderBrowserDialog1.ShowNewFolderButton = false;
93 | //
94 | // checkBox1
95 | //
96 | this.checkBox1.AutoSize = true;
97 | this.checkBox1.Location = new System.Drawing.Point(119, 8);
98 | this.checkBox1.Name = "checkBox1";
99 | this.checkBox1.Size = new System.Drawing.Size(146, 17);
100 | this.checkBox1.TabIndex = 5;
101 | this.checkBox1.Text = "Check for update on start";
102 | this.checkBox1.UseVisualStyleBackColor = true;
103 | //
104 | // fontDialog1
105 | //
106 | this.fontDialog1.Apply += new System.EventHandler(this.fontDialog1_Apply);
107 | //
108 | // OptionsForm
109 | //
110 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
111 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
112 | this.ClientSize = new System.Drawing.Size(274, 250);
113 | this.Controls.Add(this.checkBox1);
114 | this.Controls.Add(this.button1);
115 | this.Controls.Add(this.label3);
116 | this.Controls.Add(this.label2);
117 | this.Controls.Add(this.label1);
118 | this.Controls.Add(this.panel1);
119 | this.Name = "OptionsForm";
120 | this.Text = "OptionsForm";
121 | this.Load += new System.EventHandler(this.OptionsForm_Load);
122 | this.ResumeLayout(false);
123 | this.PerformLayout();
124 |
125 | }
126 |
127 | #endregion
128 |
129 | private System.Windows.Forms.Panel panel1;
130 | private System.Windows.Forms.Label label1;
131 | private System.Windows.Forms.Label label2;
132 | private System.Windows.Forms.Label label3;
133 | private System.Windows.Forms.Button button1;
134 | private System.Windows.Forms.ColorDialog colorDialog1;
135 | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
136 | public System.Windows.Forms.CheckBox checkBox1;
137 | private System.Windows.Forms.FontDialog fontDialog1;
138 | }
139 | }
--------------------------------------------------------------------------------
/HudForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 127, 17
125 |
126 |
--------------------------------------------------------------------------------
/OptionsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 138, 17
125 |
126 |
127 | 307, 17
128 |
129 |
--------------------------------------------------------------------------------
/TilesetChooserForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace zeldaGui
2 | {
3 | partial class TilesetChooserForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.listBox1 = new System.Windows.Forms.ListBox();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.button2 = new System.Windows.Forms.Button();
37 | this.label3 = new System.Windows.Forms.Label();
38 | this.listBox2 = new System.Windows.Forms.ListBox();
39 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
40 | this.SuspendLayout();
41 | //
42 | // label1
43 | //
44 | this.label1.AutoSize = true;
45 | this.label1.Location = new System.Drawing.Point(9, 9);
46 | this.label1.Name = "label1";
47 | this.label1.Size = new System.Drawing.Size(93, 13);
48 | this.label1.TabIndex = 0;
49 | this.label1.Text = "Selected Iconset :";
50 | //
51 | // listBox1
52 | //
53 | this.listBox1.FormattingEnabled = true;
54 | this.listBox1.Location = new System.Drawing.Point(12, 25);
55 | this.listBox1.Name = "listBox1";
56 | this.listBox1.Size = new System.Drawing.Size(172, 121);
57 | this.listBox1.TabIndex = 1;
58 | this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
59 | //
60 | // label2
61 | //
62 | this.label2.AutoSize = true;
63 | this.label2.Location = new System.Drawing.Point(187, 9);
64 | this.label2.Name = "label2";
65 | this.label2.Size = new System.Drawing.Size(51, 13);
66 | this.label2.TabIndex = 2;
67 | this.label2.Text = "Preview :";
68 | //
69 | // pictureBox1
70 | //
71 | this.pictureBox1.BackColor = System.Drawing.SystemColors.GrayText;
72 | this.pictureBox1.Location = new System.Drawing.Point(190, 25);
73 | this.pictureBox1.Name = "pictureBox1";
74 | this.pictureBox1.Size = new System.Drawing.Size(160, 160);
75 | this.pictureBox1.TabIndex = 3;
76 | this.pictureBox1.TabStop = false;
77 | //
78 | // button1
79 | //
80 | this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
81 | this.button1.Location = new System.Drawing.Point(275, 237);
82 | this.button1.Name = "button1";
83 | this.button1.Size = new System.Drawing.Size(75, 23);
84 | this.button1.TabIndex = 4;
85 | this.button1.Text = "Accept";
86 | this.button1.UseVisualStyleBackColor = true;
87 | this.button1.Click += new System.EventHandler(this.button1_Click);
88 | //
89 | // button2
90 | //
91 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
92 | this.button2.Location = new System.Drawing.Point(190, 237);
93 | this.button2.Name = "button2";
94 | this.button2.Size = new System.Drawing.Size(75, 23);
95 | this.button2.TabIndex = 5;
96 | this.button2.Text = "Cancel";
97 | this.button2.UseVisualStyleBackColor = true;
98 | //
99 | // label3
100 | //
101 | this.label3.AutoSize = true;
102 | this.label3.Location = new System.Drawing.Point(9, 149);
103 | this.label3.Name = "label3";
104 | this.label3.Size = new System.Drawing.Size(116, 13);
105 | this.label3.TabIndex = 6;
106 | this.label3.Text = "Selected Background :";
107 | //
108 | // listBox2
109 | //
110 | this.listBox2.FormattingEnabled = true;
111 | this.listBox2.Location = new System.Drawing.Point(12, 165);
112 | this.listBox2.Name = "listBox2";
113 | this.listBox2.Size = new System.Drawing.Size(172, 95);
114 | this.listBox2.TabIndex = 7;
115 | this.listBox2.SelectedIndexChanged += new System.EventHandler(this.listBox2_SelectedIndexChanged);
116 | //
117 | // TilesetChooserForm
118 | //
119 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
120 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
121 | this.ClientSize = new System.Drawing.Size(362, 271);
122 | this.Controls.Add(this.listBox2);
123 | this.Controls.Add(this.label3);
124 | this.Controls.Add(this.button2);
125 | this.Controls.Add(this.button1);
126 | this.Controls.Add(this.pictureBox1);
127 | this.Controls.Add(this.label2);
128 | this.Controls.Add(this.listBox1);
129 | this.Controls.Add(this.label1);
130 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
131 | this.MaximizeBox = false;
132 | this.Name = "TilesetChooserForm";
133 | this.Text = "Icon Set Chooser";
134 | this.TopMost = true;
135 | this.Load += new System.EventHandler(this.TilesetChooserForm_Load);
136 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
137 | this.ResumeLayout(false);
138 | this.PerformLayout();
139 |
140 | }
141 |
142 | #endregion
143 |
144 | private System.Windows.Forms.Label label1;
145 | private System.Windows.Forms.ListBox listBox1;
146 | private System.Windows.Forms.Label label2;
147 | private System.Windows.Forms.PictureBox pictureBox1;
148 | private System.Windows.Forms.Button button1;
149 | private System.Windows.Forms.Button button2;
150 | private System.Windows.Forms.Label label3;
151 | private System.Windows.Forms.ListBox listBox2;
152 | }
153 | }
--------------------------------------------------------------------------------
/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 447, 17
125 |
126 |
127 | 587, 17
128 |
129 |
130 | 674, 17
131 |
132 |
133 | 814, 17
134 |
135 |
--------------------------------------------------------------------------------
/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace zeldaGui
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
33 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
34 | this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
35 | this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
36 | this.topMostToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.importOldLayoutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.saveLayoutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.clearItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.showStatsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
41 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
42 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
43 | this.timer1 = new System.Windows.Forms.Timer(this.components);
44 | this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog();
45 | this.label1 = new System.Windows.Forms.Label();
46 | this.timer2 = new System.Windows.Forms.Timer(this.components);
47 | this.contextMenuStrip1.SuspendLayout();
48 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
49 | this.SuspendLayout();
50 | //
51 | // contextMenuStrip1
52 | //
53 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
54 | this.toolStripMenuItem1,
55 | this.toolStripMenuItem2,
56 | this.toolStripMenuItem3,
57 | this.topMostToolStripMenuItem,
58 | this.importOldLayoutToolStripMenuItem,
59 | this.saveLayoutToolStripMenuItem,
60 | this.clearItemsToolStripMenuItem,
61 | this.showStatsToolStripMenuItem1});
62 | this.contextMenuStrip1.Name = "contextMenuStrip1";
63 | this.contextMenuStrip1.Size = new System.Drawing.Size(199, 180);
64 | //
65 | // toolStripMenuItem1
66 | //
67 | this.toolStripMenuItem1.CheckOnClick = true;
68 | this.toolStripMenuItem1.Name = "toolStripMenuItem1";
69 | this.toolStripMenuItem1.Size = new System.Drawing.Size(198, 22);
70 | this.toolStripMenuItem1.Text = "Edit Mode";
71 | this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
72 | //
73 | // toolStripMenuItem2
74 | //
75 | this.toolStripMenuItem2.Name = "toolStripMenuItem2";
76 | this.toolStripMenuItem2.Size = new System.Drawing.Size(198, 22);
77 | this.toolStripMenuItem2.Text = "Options";
78 | this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
79 | //
80 | // toolStripMenuItem3
81 | //
82 | this.toolStripMenuItem3.CheckOnClick = true;
83 | this.toolStripMenuItem3.Name = "toolStripMenuItem3";
84 | this.toolStripMenuItem3.Size = new System.Drawing.Size(198, 22);
85 | this.toolStripMenuItem3.Text = "AutoUpdate";
86 | this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
87 | //
88 | // topMostToolStripMenuItem
89 | //
90 | this.topMostToolStripMenuItem.CheckOnClick = true;
91 | this.topMostToolStripMenuItem.Name = "topMostToolStripMenuItem";
92 | this.topMostToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
93 | this.topMostToolStripMenuItem.Text = "Top Most";
94 | this.topMostToolStripMenuItem.Click += new System.EventHandler(this.topMostToolStripMenuItem_Click);
95 | //
96 | // importOldLayoutToolStripMenuItem
97 | //
98 | this.importOldLayoutToolStripMenuItem.Name = "importOldLayoutToolStripMenuItem";
99 | this.importOldLayoutToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
100 | this.importOldLayoutToolStripMenuItem.Text = "Import old Layout";
101 | this.importOldLayoutToolStripMenuItem.Click += new System.EventHandler(this.importOldLayoutToolStripMenuItem_Click);
102 | //
103 | // saveLayoutToolStripMenuItem
104 | //
105 | this.saveLayoutToolStripMenuItem.Name = "saveLayoutToolStripMenuItem";
106 | this.saveLayoutToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
107 | this.saveLayoutToolStripMenuItem.Text = "Save Layout";
108 | this.saveLayoutToolStripMenuItem.Click += new System.EventHandler(this.saveLayoutToolStripMenuItem_Click);
109 | //
110 | // clearItemsToolStripMenuItem
111 | //
112 | this.clearItemsToolStripMenuItem.Name = "clearItemsToolStripMenuItem";
113 | this.clearItemsToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
114 | this.clearItemsToolStripMenuItem.Text = "Set all items unchecked";
115 | this.clearItemsToolStripMenuItem.Click += new System.EventHandler(this.clearItemsToolStripMenuItem_Click);
116 | //
117 | // showStatsToolStripMenuItem1
118 | //
119 | this.showStatsToolStripMenuItem1.Name = "showStatsToolStripMenuItem1";
120 | this.showStatsToolStripMenuItem1.Size = new System.Drawing.Size(198, 22);
121 | this.showStatsToolStripMenuItem1.Text = "Show Stats";
122 | this.showStatsToolStripMenuItem1.Click += new System.EventHandler(this.showStatsToolStripMenuItem1_Click);
123 | //
124 | // pictureBox1
125 | //
126 | this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
127 | this.pictureBox1.Location = new System.Drawing.Point(0, 0);
128 | this.pictureBox1.Name = "pictureBox1";
129 | this.pictureBox1.Size = new System.Drawing.Size(224, 192);
130 | this.pictureBox1.TabIndex = 1;
131 | this.pictureBox1.TabStop = false;
132 | this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick);
133 | this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
134 | this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp);
135 | //
136 | // openFileDialog1
137 | //
138 | this.openFileDialog1.FileName = "openFileDialog1";
139 | this.openFileDialog1.Filter = "SRAM Files|*.srm";
140 | //
141 | // timer1
142 | //
143 | this.timer1.Interval = 5000;
144 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
145 | //
146 | // openFileDialog2
147 | //
148 | this.openFileDialog2.FileName = "openFileDialog2";
149 | this.openFileDialog2.Filter = "Zelda Hud Layout Config|*.config";
150 | //
151 | // label1
152 | //
153 | this.label1.AutoSize = true;
154 | this.label1.Font = new System.Drawing.Font("DS-Digital", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
155 | this.label1.Location = new System.Drawing.Point(114, -26);
156 | this.label1.Name = "label1";
157 | this.label1.Size = new System.Drawing.Size(90, 27);
158 | this.label1.TabIndex = 2;
159 | this.label1.Text = "label1";
160 | this.label1.Visible = false;
161 | //
162 | // timer2
163 | //
164 | this.timer2.Interval = 800;
165 | this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
166 | //
167 | // Form1
168 | //
169 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
170 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
171 | this.ClientSize = new System.Drawing.Size(224, 192);
172 | this.Controls.Add(this.label1);
173 | this.Controls.Add(this.pictureBox1);
174 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
175 | this.MaximizeBox = false;
176 | this.MinimizeBox = false;
177 | this.Name = "Form1";
178 | this.Text = "Form1";
179 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
180 | this.Load += new System.EventHandler(this.Form1_Load);
181 | this.ResizeEnd += new System.EventHandler(this.Form1_ResizeEnd);
182 | this.contextMenuStrip1.ResumeLayout(false);
183 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
184 | this.ResumeLayout(false);
185 | this.PerformLayout();
186 |
187 | }
188 |
189 | #endregion
190 |
191 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
192 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
193 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
194 | private System.Windows.Forms.PictureBox pictureBox1;
195 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
196 | private System.Windows.Forms.ToolStripMenuItem topMostToolStripMenuItem;
197 | private System.Windows.Forms.ToolStripMenuItem saveLayoutToolStripMenuItem;
198 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
199 | private System.Windows.Forms.Timer timer1;
200 | private System.Windows.Forms.ToolStripMenuItem importOldLayoutToolStripMenuItem;
201 | private System.Windows.Forms.OpenFileDialog openFileDialog2;
202 | private System.Windows.Forms.ToolStripMenuItem clearItemsToolStripMenuItem;
203 | private System.Windows.Forms.ToolStripMenuItem showStatsToolStripMenuItem1;
204 | private System.Windows.Forms.Timer timer2;
205 | public System.Windows.Forms.Label label1;
206 | }
207 | }
208 |
209 |
--------------------------------------------------------------------------------
/HudForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 | using System.Drawing.Imaging;
12 |
13 | namespace HudZelda
14 | {
15 | public partial class HudForm : Form
16 | {
17 | public HudForm()
18 | {
19 | InitializeComponent();
20 | }
21 | //byte[,] items_placement = new byte[6,6]; // contains items id in [Read in order from loop x:y:]
22 | public byte[] items = new byte[40];
23 | string[] itemsName = new string[40];
24 | private void HudForm_Load(object sender, EventArgs e)
25 | {
26 | this.pictureBox1.Size = this.Size;
27 | this.pictureBox1.Location = new Point(0, 0);
28 | //init code for items
29 | imageList1.Images.AddStrip(new Bitmap("items.png"));
30 | updateGraphics();
31 |
32 | defineitemsname();
33 | for(int i = 0;i<41;i++)
34 | {
35 | if (i == 0)
36 | {
37 | contextMenuStrip1.Items.Add(254.ToString("000") + itemsName[i]);
38 | }
39 | else
40 | {
41 | contextMenuStrip1.Items.Add((i-1).ToString("000") + itemsName[i]);
42 | }
43 |
44 | }
45 |
46 |
47 | /*GlobalSettings.items_placement = new byte[GlobalSettings.sizeX, GlobalSettings.sizeY];
48 | for (int i = 0; i < GlobalSettings.sizeX; i++)
49 | {
50 | for (int j = 0; j < GlobalSettings.sizeY; j++)
51 | {
52 | GlobalSettings.items_placement[i, j] = (byte)(i + (j * GlobalSettings.sizeX));
53 | if (GlobalSettings.items_placement[i, j] > 36)
54 | {
55 | GlobalSettings.items_placement[i, j] = 255;
56 | }
57 | }
58 | }*/
59 | }
60 |
61 | Graphics g;
62 | private void HudForm_SizeChanged(object sender, EventArgs e)
63 | {
64 | this.pictureBox1.Size = this.Size;
65 | }
66 | int lsizex = 0;
67 | int lsizey = 0;
68 | public void updateGraphics()
69 | {
70 | //public static byte[,] items_placement;
71 | byte[,] items_placementold = new byte[GlobalSettings.sizeX,GlobalSettings.sizeY];
72 | for (int i = 0; i < GlobalSettings.sizeX; i++)
73 | {
74 | for (int j = 0; j < GlobalSettings.sizeY; j++)
75 | {
76 | if (i < GlobalSettings.items_placement.GetLength(0) && j < GlobalSettings.items_placement.GetLength(1))
77 | {
78 | items_placementold[i, j] = GlobalSettings.items_placement[i, j];
79 | }
80 | else
81 | {
82 | items_placementold[i, j] = 254;
83 | }
84 |
85 | }
86 | }
87 | GlobalSettings.items_placement = new byte[GlobalSettings.sizeX, GlobalSettings.sizeY];
88 | for (int i = 0; i < GlobalSettings.sizeX; i++)
89 | {
90 | for (int j = 0; j < GlobalSettings.sizeY; j++)
91 | {
92 | GlobalSettings.items_placement[i, j] = items_placementold[i, j];
93 | }
94 | }
95 |
96 |
97 | ColorMatrix colorMatrix = new ColorMatrix(
98 | new float[][]
99 | {
100 | new float[] {.3f, .3f, .3f, 0, 0},
101 | new float[] {.59f, .59f, .59f, 0, 0},
102 | new float[] {.11f, .11f, .11f, 0, 0},
103 | new float[] {0, 0, 0,.5f, 0},
104 | new float[] {0, 0, 0, 0, .5f}
105 | });
106 | pictureBox1.Image = new Bitmap(pictureBox1.Size.Width, pictureBox1.Size.Height);
107 | g = Graphics.FromImage(pictureBox1.Image);
108 | ImageAttributes attributes = new ImageAttributes();
109 | g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
110 | attributes.SetColorMatrix(colorMatrix);
111 |
112 |
113 | int ii = 0;
114 |
115 | //PseudoDraw Code
116 | for (int x = 0; x < GlobalSettings.sizeX; x++)
117 | {
118 | for (int y = 0; y < GlobalSettings.sizeY; y++)
119 | {
120 | if (GlobalSettings.items_placement[x, y] != 254)
121 | {
122 | int imgid = 0;
123 | if (items[GlobalSettings.items_placement[x, y]] == 0)
124 | {
125 | //Use Color matrix
126 |
127 | g.DrawImage(imageList1.Images[GlobalSettings.items_placement[x, y]], new Rectangle(x * (GlobalSettings.size * 16), y * (GlobalSettings.size * 16), GlobalSettings.size * 16, GlobalSettings.size * 16), 0, 0, 16, 16, GraphicsUnit.Pixel, attributes);
128 | if (GlobalSettings.items_placement[x, y] == 25)//Mail
129 | {
130 | g.DrawImage(imageList1.Images[25], new Rectangle(x * (GlobalSettings.size * 16), y * (GlobalSettings.size * 16), GlobalSettings.size * 16, GlobalSettings.size * 16), 0, 0, 16, 16, GraphicsUnit.Pixel);
131 | }
132 | }
133 | else
134 | {
135 | imgid = GlobalSettings.items_placement[x, y];
136 | byte itemid = GlobalSettings.items_placement[x, y];
137 | if (itemid == 0)//Bow
138 | {
139 | if (items[itemid] == 2)
140 | {
141 | imgid =51;
142 | }
143 | else if (items[itemid] == 3)
144 | {
145 | imgid = 52;
146 | }
147 | }
148 | else if (itemid == 1)//Boomerang
149 | {
150 | if (items[itemid] == 2)
151 | {
152 | imgid = 40;
153 |
154 | }
155 | }
156 | else if (itemid == 4)//Powder
157 | {
158 | if (items[itemid] == 2)
159 | {
160 | imgid = 49;
161 |
162 | }
163 | }
164 | else if (itemid == 12)//Shovel/Flute
165 | {
166 | if (items[itemid] == 2)
167 | {
168 | imgid = 50;
169 |
170 | }
171 | else if (items[itemid] == 3)
172 | {
173 | imgid = 50;
174 |
175 | }
176 | }
177 | else if (itemid == 19)//Gloves
178 | {
179 | if (items[itemid] == 2)
180 | {
181 | imgid = 46;
182 |
183 | }
184 | }
185 | else if (itemid == 23)//Sword
186 | {
187 | if (items[itemid] == 2)
188 | {
189 | imgid = 41;
190 |
191 | }
192 | else if (items[itemid] == 3)
193 | {
194 | imgid = 42;
195 |
196 | }
197 | else if (items[itemid] == 4)
198 | {
199 | imgid = 43;
200 |
201 | }
202 | }
203 | else if (itemid == 24)//Shield
204 | {
205 | if (items[itemid] == 2)
206 | {
207 | imgid = 47;
208 |
209 | }
210 | else if (items[itemid] == 3)
211 | {
212 | imgid = 48;
213 |
214 | }
215 | }
216 | else if (itemid == 25)//Mail
217 | {
218 | if (items[itemid] == 0)
219 | {
220 | imgid =25;
221 |
222 | }
223 | if (items[itemid] == 1)
224 | {
225 | imgid = 44;
226 |
227 | }
228 | else if (items[itemid] == 2 )
229 | {
230 | imgid = 45;
231 |
232 | }
233 | }
234 | else if (itemid == 26 | itemid == 27 | itemid == 28 | itemid == 29)//Bottles
235 | {
236 | if (items[itemid] == 0)//nobottle
237 | {
238 | imgid = 26;
239 | }
240 | if (items[itemid] == 1)//unused
241 | {
242 | imgid = 26;
243 | }
244 | if (items[itemid] == 2)//empty
245 | {
246 | imgid = 26;
247 | }
248 | else if(items[itemid] == 3)//r
249 | {
250 | imgid = 53;
251 | }
252 | else if (items[itemid] == 4)//g
253 | {
254 | imgid = 54;
255 | }
256 | else if (items[itemid] == 5)//b
257 | {
258 | imgid = 55;
259 | }
260 | else if (items[itemid] == 6)//fairy
261 | {
262 | imgid = 56;
263 | }
264 | else if (items[itemid] == 7)//bee
265 | {
266 | imgid = 57;
267 | }
268 | else if (items[itemid] == 8)//good bee
269 | {
270 | imgid = 57;
271 | }
272 | }
273 | /*else if (items[itemid] < 1)
274 | {
275 | if (items[itemid] < 8)
276 | {
277 | items[GlobalSettings.items_placement[msx, msy]] += 1;
278 | }
279 | }*/
280 | g.DrawImage(imageList1.Images[imgid], new Rectangle(x * (GlobalSettings.size * 16), y * (GlobalSettings.size * 16), GlobalSettings.size * 16, GlobalSettings.size * 16), 0, 0, 16, 16, GraphicsUnit.Pixel);
281 | }
282 | }
283 | }
284 | }
285 | }
286 |
287 | private void pictureBox1_Click(object sender, EventArgs e)
288 | {
289 |
290 |
291 | }
292 | int msx, msy;
293 | private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
294 | {
295 | msx = e.X / (16 * GlobalSettings.size);
296 | msy = e.Y / (16 * GlobalSettings.size);
297 |
298 | if (e.Button == MouseButtons.Right)
299 | {
300 | if (GlobalSettings.editmode == true)
301 | {
302 | if (GlobalSettings.configartionshow)
303 | {
304 |
305 | contextMenuStrip1.Show(Cursor.Position.X, Cursor.Position.Y);
306 | msx = e.X / (16 * GlobalSettings.size);
307 | msy = e.Y / (16 * GlobalSettings.size);
308 | }
309 | }
310 | if (GlobalSettings.configartionshow != true)
311 | {
312 | if (GlobalSettings.items_placement[msx, msy] != 254)
313 | {
314 | msx = e.X / (16 * GlobalSettings.size);
315 | msy = e.Y / (16 * GlobalSettings.size);
316 | if (items[GlobalSettings.items_placement[msx, msy]] > 0)
317 | {
318 | items[GlobalSettings.items_placement[msx, msy]] -= 1;
319 | }
320 | updateGraphics();
321 | }
322 | }
323 | else
324 | {
325 | if (GlobalSettings.editmode == false)
326 | {
327 | if (GlobalSettings.items_placement[msx, msy] != 254)
328 | {
329 | msx = e.X / (16 * GlobalSettings.size);
330 | msy = e.Y / (16 * GlobalSettings.size);
331 | if (items[GlobalSettings.items_placement[msx, msy]] > 0)
332 | {
333 | items[GlobalSettings.items_placement[msx, msy]] -= 1;
334 | }
335 | updateGraphics();
336 | }
337 | }
338 | }
339 | }
340 | if (GlobalSettings.items_placement[msx, msy] != 254)
341 | {
342 | if (e.Button == MouseButtons.Left)
343 | {
344 | msx = e.X / (16 * GlobalSettings.size);
345 | msy = e.Y / (16 * GlobalSettings.size);
346 | byte itemid = GlobalSettings.items_placement[msx, msy];
347 | if (itemid == 0)//Bow
348 | {
349 | if (items[itemid] < 3)
350 | {
351 | items[GlobalSettings.items_placement[msx, msy]] += 1;
352 | }
353 | }
354 | else if (itemid == 1)//Boomerang
355 | {
356 | if (items[itemid] < 2)
357 | {
358 | items[GlobalSettings.items_placement[msx, msy]] += 1;
359 | }
360 | }
361 | else if (itemid == 4)//Mush
362 | {
363 | if (items[itemid] < 2)
364 | {
365 | items[GlobalSettings.items_placement[msx, msy]] += 1;
366 | }
367 | }
368 | else if (itemid == 12)//Shovel
369 | {
370 | if (items[itemid] < 3)
371 | {
372 | items[GlobalSettings.items_placement[msx, msy]] += 1;
373 | }
374 | }
375 | else if (itemid == 19)//Gloves
376 | {
377 | if (items[itemid] < 2)
378 | {
379 | items[GlobalSettings.items_placement[msx, msy]] += 1;
380 | }
381 | }
382 | else if (itemid == 23)//Sword
383 | {
384 | if (items[itemid] < 4)
385 | {
386 | items[GlobalSettings.items_placement[msx, msy]] += 1;
387 | }
388 | }
389 | else if (itemid == 24)//Shield
390 | {
391 | if (items[itemid] < 3)
392 | {
393 | items[GlobalSettings.items_placement[msx, msy]] += 1;
394 | }
395 | }
396 | else if (itemid == 25)//Mail
397 | {
398 | if (items[itemid] < 3)
399 | {
400 | items[GlobalSettings.items_placement[msx, msy]] += 1;
401 | }
402 | }
403 | else if (itemid == 26)//Bottle1
404 | {
405 | if (items[itemid] < 7)
406 | {
407 | items[GlobalSettings.items_placement[msx, msy]] += 1;
408 | }
409 | }
410 | else if (itemid == 27)//Bottle2
411 | {
412 | if (items[itemid] < 7)
413 | {
414 | items[GlobalSettings.items_placement[msx, msy]] += 1;
415 | }
416 | }
417 | else if (itemid == 28)//Bottle3
418 | {
419 | if (items[itemid] < 7)
420 | {
421 | items[GlobalSettings.items_placement[msx, msy]] += 1;
422 | }
423 | }
424 | else if (itemid == 29)//Bottle4
425 | {
426 | if (items[itemid] < 7)
427 | {
428 | items[GlobalSettings.items_placement[msx, msy]] += 1;
429 | }
430 | }
431 | else if (items[itemid] < 1)
432 | {
433 | if (items[itemid] < 8)
434 | {
435 | items[GlobalSettings.items_placement[msx, msy]] += 1;
436 | }
437 | }
438 | updateGraphics();
439 |
440 | }
441 | }
442 | }
443 |
444 | public void defineitemsname()
445 | {
446 | itemsName = new string[41]{"Empty","Bow","Boomerang","Hookshot","Bombs","Mushroom","Fire Rod","Ice Rod","Bombos Medaillon",
447 | "Ether Medaillon","Quake Medaillon","Lamp","Hammer","Shovel","Bug Catching Net","Book of Mudora","Cane of Somaria",
448 | "Cane of Byrna","Magic Cape","Magic Mirror","Gloves","Boots","Flippers","Moonpearl","Sword","Shield","Mail",
449 | "Bottle1", "Bottle2","Bottle3","Bottle4","Pendant Eastern","Pendant Desert","Pendant Hera","Crystal6 MM","Crystal1 Pod",
450 | "Crystal5 IP","Crystal7 TR","Crystal2 SP", "Crystal4 TT","Crystal3 SW" };
451 | }
452 |
453 | private void contextMenuStrip1_MouseClick(object sender, MouseEventArgs e)
454 | {
455 |
456 | }
457 | int a;
458 | private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
459 | {
460 | //label1.Text = "x" + msx.ToString() + ",y" + msy.ToString();
461 |
462 | GlobalSettings.items_placement[msx, msy] = (byte)Convert.ToInt32(e.ClickedItem.Text.Substring(0,3));
463 | updateGraphics();
464 | }
465 | }
466 |
467 |
468 | //Items List in order :
469 | //[0]Bow - 1 = bow without arrow, 2 = with arrow, 3 = silver arrow
470 | //[1]Boomerang - 1 = Blue Boomerang, 2 = Red Boomerang
471 | //[2]Hookshot
472 | //[3]Bombs - Numbers of bombs
473 | //[4]Mushroom - 1 = Mushroom, 2 = Powder
474 | //[5]Fire Rod
475 | //[6]Ice Rod
476 | //[7]Bombos Medaillon
477 | //[8]Ether Medaillon
478 | //[9]Quake Medaillon
479 | //[10]Lamp
480 | //[11]Hammer
481 | //[12]Shovel - 1 = Shovel, 2 = Flute, 3 = Active Flute
482 | //[13]Bug Catching Net
483 | //[14]Book of Mudora
484 | //[15]Cane of Somaria
485 | //[16]Cane of Byrna
486 | //[17]Magic Cape
487 | //[18]Magic Mirror
488 | //[19]Gloves - 1 = Power Glove, 2 = Titans Mitts
489 | //[20]Boots
490 | //[21]Flippers
491 | //[22]Moonpearl
492 | //[23]Sword - 1 = Fighter Sword, 2 = Master Sword, 3 = Tempered Sword, 4 = Gold Sword
493 | //[24]Shield - 1 = Fighter Shield, 2 = Red Shield, 3 = Mirror Shield
494 | //[25]Mail - 0 = Green Mail, 1 = Blue Mail, 2 = Red Mail
495 | //[26]Bottle1 - 1(unused), 2 = Empty Bottle, 3 = Red Potion, 4 = Green Potion, 5 = Blue Potion, 6 = Fairy, 7 = Bee, 8 = Good Bee
496 | //[27]Bottle2
497 | //[28]Bottle3
498 | //[29]Bottle4
499 | //[30-32]Pendants (Bitwise)Bit 0: Courage,Bit 1: Wisdom,Bit 2: Power
500 | //[33-39]Crystals (Bitwise)Bit 0: MM,Bit 1: POD,Bit 2: IP,Bit 3: TR,Bit 4: SP,Bit 5: TT,Bit 6: SW
501 | //[]
502 |
503 | }
504 |
--------------------------------------------------------------------------------
/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Drawing.Imaging;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 | using System.IO;
12 | using System.Text.RegularExpressions;
13 |
14 | namespace zeldaGui
15 | {
16 | public partial class Form1 : Form
17 | {
18 | public Form1()
19 | {
20 | InitializeComponent();
21 |
22 | }
23 | string currentIconset = @"IconsSets\Defaults";
24 | string currentBgr = @"None";
25 | Bitmap bgr;
26 | List item_found = new List();
27 | private void Form1_Load(object sender, EventArgs e)
28 | {
29 | globalTimer.MakeTransparent(Color.Fuchsia);
30 | globalCount.MakeTransparent(Color.Fuchsia);
31 | this.Text = "Right Click Here";
32 | pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
33 | g = Graphics.FromImage(pictureBox1.Image);
34 |
35 | addItems();
36 | setDefaultItems();
37 |
38 | loadLayout();
39 | loadIconsSet(currentIconset);
40 | if (currentBgr != "None")
41 | {
42 | bgr = new Bitmap(currentBgr);
43 | bgr.MakeTransparent(Color.Fuchsia);
44 | }
45 | drawIcons();
46 | if (checkUpdate)
47 | {
48 | if (Version.CheckUpdate() == true)
49 | {
50 | var window = MessageBox.Show("There is a new version avaiable do you want to download the update?", "Update Avaible", MessageBoxButtons.YesNo);
51 | if (window == DialogResult.Yes)
52 | {
53 | Help.ShowHelp(null, @"https://zarby89.github.io/ZeldaHud/");
54 | }
55 | }
56 | }
57 |
58 | }
59 | int nbrIcons = 74;
60 | public static Bitmap[] iconSet;
61 | public Bitmap globalTimer = new Bitmap("IconsSets\\Global\\timer.png");
62 | public Bitmap globalCount = new Bitmap("IconsSets\\Global\\count.png");
63 |
64 | public void loadIconsSet(string data)
65 | {
66 | nbrIcons = Directory.GetFiles(data).Length;
67 |
68 | iconSet = new Bitmap[nbrIcons];
69 | for (int i = 0;i= 1)
132 | {
133 | drawCounter(g, x * 32, y * 32, itemsArray[x, y].counter);
134 | }
135 | }
136 | }
137 | else
138 | {
139 | g.DrawImage(iconSet[itemsArray[x, y].iconsId[itemsArray[x, y].level]], new Rectangle(x * 32, y * 32, 32, 32), 0, 0, 32, 32, GraphicsUnit.Pixel, ia);
140 | }
141 | }
142 | else
143 | {
144 | if (timer)
145 | {
146 |
147 | }
148 | else
149 | {
150 | g.DrawImage(iconSet[itemsArray[x, y].iconsId[itemsArray[x, y].level]], new Rectangle(x * 32, y * 32, 32, 32), 0, 0, 32, 32, GraphicsUnit.Pixel, ia);
151 | }
152 | }
153 | }
154 | catch (Exception e)
155 | {
156 |
157 | }
158 | }
159 | }
160 | }
161 | if (timer)
162 | {
163 | TimeSpan objt = DateTime.Now.Subtract(timestarted);
164 | if (timerend == false)
165 | {
166 | objt = DateTime.Now.Subtract(timestarted);
167 | }
168 | else
169 | {
170 |
171 | objt = timeended.Subtract(timestarted);
172 | }
173 |
174 | //g.DrawString(objt.Hours.ToString("D2") + ":" + objt.Minutes.ToString("D2") + ":" + objt.Seconds.ToString("D2"), label1.Font, Brushes.White, new Point(timerpospixel.X - 2, timerpospixel.Y + 4));
175 | drawTime(g,objt);
176 | }
177 |
178 | pictureBox1.Refresh();
179 | }
180 |
181 | public void drawCounter(Graphics g, int x, int y, byte count)
182 | {
183 | string s = count.ToString("D2");
184 | if (count <= 9)
185 | {
186 | g.DrawImage(globalCount, new Rectangle(x + 22, y + 18, 10, 14), count*10, 0, 10, 14, GraphicsUnit.Pixel);
187 | }
188 | else
189 | {
190 | int b = ((int)s[0] - 48);
191 | g.DrawImage(globalCount, new Rectangle(x + 12, y + 18, 10, 14), b * 10, 0, 10, 14, GraphicsUnit.Pixel);
192 | b = ((int)s[1] - 48);
193 | g.DrawImage(globalCount, new Rectangle(x + 22, y + 18, 10, 14), b * 10, 0, 10, 14, GraphicsUnit.Pixel);
194 | }
195 |
196 |
197 | g.DrawImage(globalCount, new Rectangle((x * 32) + 22, (y * 32) + 18, 10, 14), 0, 0, 32, 32, GraphicsUnit.Pixel);
198 | }
199 |
200 | public void drawTime(Graphics g, TimeSpan time)
201 | {
202 |
203 | string s = time.Hours.ToString("D2");
204 | int b = ((int)s[0] - 48);
205 | g.DrawImage(globalTimer, timerpospixel.X+1 , timerpospixel.Y + 4, new Rectangle(12*b,0,12,26), GraphicsUnit.Pixel);//hour1
206 | b = ((int)s[1] - 48);
207 | g.DrawImage(globalTimer, (timerpospixel.X+1)+13, timerpospixel.Y + 4, new Rectangle(12 * b, 0, 12, 26), GraphicsUnit.Pixel);//hour2
208 |
209 | g.DrawImage(globalTimer, (timerpospixel.X +1) + 26, timerpospixel.Y + 4, new Rectangle(120, 0, 8, 26), GraphicsUnit.Pixel);//:
210 | s = time.Minutes.ToString("D2");
211 | b = ((int)s[0] - 48);
212 | g.DrawImage(globalTimer, (timerpospixel.X+1) + 35, timerpospixel.Y + 4, new Rectangle(12 * b, 0, 12, 26), GraphicsUnit.Pixel);//minute1
213 | b = ((int)s[1] - 48);
214 | g.DrawImage(globalTimer, (timerpospixel.X +1) + 48, timerpospixel.Y + 4, new Rectangle(12 * b, 0, 12, 26), GraphicsUnit.Pixel);//minute2
215 |
216 | g.DrawImage(globalTimer, (timerpospixel.X +1) + 61, timerpospixel.Y + 4, new Rectangle(120, 0, 8, 26), GraphicsUnit.Pixel);//:
217 | s = time.Seconds.ToString("D2");
218 | b = ((int)s[0] - 48);
219 | g.DrawImage(globalTimer, (timerpospixel.X+1 ) + 69, timerpospixel.Y + 4, new Rectangle(12 * b, 0, 12, 26), GraphicsUnit.Pixel);//minute1
220 | b = ((int)s[1] - 48);
221 | g.DrawImage(globalTimer, (timerpospixel.X +1) + 82, timerpospixel.Y + 4, new Rectangle(12 * b, 0, 12, 26), GraphicsUnit.Pixel);//minute2
222 |
223 | }
224 |
225 |
226 | protected void OnTitlebarClick(Point pos)
227 | {
228 | contextMenuStrip1.Show(pos);
229 | }
230 |
231 |
232 | protected override void WndProc(ref Message m)
233 | {
234 | if (m.Msg == 0xa4)
235 | {
236 | Point pos = new Point(m.LParam.ToInt32() & 0xffff, m.LParam.ToInt32() >> 16);
237 | OnTitlebarClick(pos);
238 | return;
239 | }
240 | base.WndProc(ref m);
241 | }
242 |
243 | Graphics g;
244 | public static List itemsList = new List();
245 | public static CustomItem[,] itemsArray = new CustomItem[24, 24];
246 | public static Color clearColor = Color.FromArgb(10, 10, 15);
247 |
248 | public void addItems()
249 | {
250 | /* itemsList.Add(new CustomItem(new byte[] { 0, 48, 49, 49 }, "Bow"));//Bow 0
251 | itemsList.Add(new CustomItem(new byte[] { 1 }, "Blue Boomerang"));//Blue Boomerang 1
252 | itemsList.Add(new CustomItem(new byte[] { 2 }, "HookShot"));//Hookshot 2
253 | itemsList.Add(new CustomItem(new byte[] { 3 }, "Bombs"));//Bombs 3
254 | itemsList.Add(new CustomItem(new byte[] { 4, 56 }, "Mushroom"));//Mushroom 4
255 | itemsList.Add(new CustomItem(new byte[] { 5 }, "Fire Rod"));//Fire Rod 5
256 | itemsList.Add(new CustomItem(new byte[] { 6 }, "Ice Rod"));//Ice Rod 6
257 | itemsList.Add(new CustomItem(new byte[] { 7 }, "Bombos"));//Bombos 7
258 | itemsList.Add(new CustomItem(new byte[] { 8 }, "Ether"));//Ether 8
259 | itemsList.Add(new CustomItem(new byte[] { 9 }, "Quake"));//Quake 9
260 | itemsList.Add(new CustomItem(new byte[] { 10 }, "Lamp"));//Lamp 10
261 | itemsList.Add(new CustomItem(new byte[] { 11 }, "Hammer"));//Hammer 11
262 | itemsList.Add(new CustomItem(new byte[] { 12, 57 }, "Shovel"));//Shovel 12
263 | itemsList.Add(new CustomItem(new byte[] { 13 }, "Net"));//Net 13
264 | itemsList.Add(new CustomItem(new byte[] { 14 }, "Book"));//Book 14
265 | itemsList.Add(new CustomItem(new byte[] { 15 }, "Cane Somaria"));//Cane Somaria 15
266 | itemsList.Add(new CustomItem(new byte[] { 16 }, "Cane of Byrna"));//Cane Byrna 16
267 | itemsList.Add(new CustomItem(new byte[] { 17 }, "Cape"));//Cape 17
268 | itemsList.Add(new CustomItem(new byte[] { 18, 18 }, "Mirror"));//Mirror 18
269 | itemsList.Add(new CustomItem(new byte[] { 19, 43 }, "Power Glove"));//Power Glove 19
270 | itemsList.Add(new CustomItem(new byte[] { 20 }, "Boots"));//Boots 20
271 | itemsList.Add(new CustomItem(new byte[] { 21 }, "Flippers"));//Flippers 21
272 | itemsList.Add(new CustomItem(new byte[] { 22 }, "Moon Pearl"));//MoonPearl 22
273 | itemsList.Add(new CustomItem(new byte[] { 23, 38, 39, 40 }, "Sword"));//Sword 23
274 | itemsList.Add(new CustomItem(new byte[] { 24, 44, 45 }, "Shield"));//Shield 24
275 | itemsList.Add(new CustomItem(new byte[] { 25, 41, 42 }, "Tunic"));//Tunic //25
276 | itemsList.Add(new CustomItem(new byte[] { 26, 26, 50, 51, 52, 53, 54, 54 }, "Bottle 1",false,true));//Bottle1 26
277 | itemsList.Add(new CustomItem(new byte[] { 26, 26, 50, 51, 52, 53, 54, 54 }, "Bottle 2",false,true));//Bottle2 27
278 | itemsList.Add(new CustomItem(new byte[] { 26, 26, 50, 51, 52, 53, 54, 54 }, "Bottle 3",false,true));//Bottle3 28
279 | itemsList.Add(new CustomItem(new byte[] { 26, 26, 50, 51, 52, 53, 54, 54 }, "Bottle 4",false,true));//Bottle4 29
280 | itemsList.Add(new CustomItem(new byte[] { 27 }, "Eastern Pendant"));//Eastern (Green) //30
281 | itemsList.Add(new CustomItem(new byte[] { 28 }, "Desert Pendant"));//Desert (Blue) 31
282 | itemsList.Add(new CustomItem(new byte[] { 29 }, "Hera Pendant"));//Hera (Red) 32
283 | itemsList.Add(new CustomItem(new byte[] { 30 }, "Crystal 1"));//Crystal 1 33 pod
284 | itemsList.Add(new CustomItem(new byte[] { 31 }, "Crystal 2"));//Crystal 2 34 swamp
285 | itemsList.Add(new CustomItem(new byte[] { 32 }, "Crystal 3"));//Crystal 3 35 sw
286 | itemsList.Add(new CustomItem(new byte[] { 33 }, "Crystal 4"));//Crystal 4 36 tt
287 | itemsList.Add(new CustomItem(new byte[] { 34 }, "Crystal 5"));//Crystal 5 37 ice
288 | itemsList.Add(new CustomItem(new byte[] { 35 }, "Crystal 6"));//Crystal 6 38 mm
289 | itemsList.Add(new CustomItem(new byte[] { 36 }, "Crystal 7"));//Crystal 7 //39 trock
290 | itemsList.Add(new CustomItem(new byte[] { 37 }, "Red Boomerang"));//Red Boomerang 40
291 | itemsList.Add(new CustomItem(new byte[] { 46 }, "Powder"));//Powder 41
292 | itemsList.Add(new CustomItem(new byte[] { 47 }, "Flute"));//Flute 42
293 | itemsList.Add(new CustomItem(new byte[] { 55 }, "Agahnim"));//Agahnim //43
294 | itemsList.Add(new CustomItem(new byte[] { 58, 59 }, "Chest"));//Agahnim //44
295 | itemsList.Add(new CustomItem(new byte[] { 60 }, "Sanc Heart"));//Agahnim //45
296 | itemsList.Add(new CustomItem(new byte[] { 61 }, "Item Id 61"));//Agahnim //46
297 | itemsList.Add(new CustomItem(new byte[] { 62 }, "Item Id 62"));//Agahnim //47
298 | itemsList.Add(new CustomItem(new byte[] { 63 }, "Item Id 63"));//Agahnim //48
299 | itemsList.Add(new CustomItem(new byte[] { 64 }, "Item Id 64"));//Agahnim //49
300 | itemsList.Add(new CustomItem(new byte[] { 65 }, "Item Id 65"));//Agahnim //50
301 | itemsList.Add(new CustomItem(new byte[] { 66,67,68,69 }, "Heart Pieces",true));//Agahnim //51
302 | itemsList.Add(new CustomItem(new byte[] { 70, 71, 72, 73 }, "Bottle Counter"));//Agahnim //52
303 | itemsList.Add(new CustomItem(new byte[] { 26, 71, 72, 73 }, "Bottle Counter2"));//Agahnim //53*/
304 |
305 | //itemsList[51].on = true;
306 |
307 | string[] s = File.ReadAllLines("itemlist.txt");
308 |
309 | foreach(string line in s)
310 | {
311 | string name = "";
312 | byte[] order = new byte[0];
313 | bool loop = false;
314 | bool bottle = false;
315 | bool count = false;
316 | //Read character
317 | if (line.Length > 1)
318 | {
319 | if (line[0] == '/' && line[1] == '/')//skip line
320 | {
321 |
322 | }
323 | else
324 | {
325 | if (line[0] == ':')
326 | {
327 | for (int i = 1; i < line.Length; i++)//name
328 | {
329 | if (line[i] == ',')
330 | {
331 | break;
332 | }
333 | name += line[i];
334 | }
335 | int sta = line.IndexOf('{')+1;
336 | int end = line.IndexOf('}');
337 | string ord = line.Substring(sta, end - sta);
338 | string[] ords = ord.Split(',');
339 | order = new byte[ords.Length];
340 | for (int i = 0; i < ords.Length; i++)
341 | {
342 | order[i] = Convert.ToByte(ords[i]);
343 | }
344 | string last = line.Substring(end + 2);
345 | string[] loopbottle = last.Split(',');
346 | if (loopbottle[0] == "false")
347 | {
348 | loop = false;
349 | }
350 | if (loopbottle[0] == "true")
351 | {
352 | loop = true;
353 | }
354 |
355 | if (loopbottle[1] == "false")
356 | {
357 | bottle = false;
358 | }
359 | if (loopbottle[1] == "true")
360 | {
361 | bottle = true;
362 | }
363 |
364 | if (loopbottle[2][0] == 'f')
365 | {
366 | count = false;
367 | }
368 | if (loopbottle[2][0] == 't')
369 | {
370 | count = true;
371 | }
372 | CustomItem ci = new CustomItem(order, name, loop, bottle, count);
373 | if (count == true)
374 | {
375 | ci.on = true;
376 | }
377 | itemsList.Add(ci);
378 |
379 | }
380 | }
381 | }
382 | }
383 | }
384 |
385 |
386 | public void setDefaultItems()
387 | {
388 | //30,31,32,17,25,60,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
389 | byte[] ditems = new byte[] {15 ,0 ,1 ,2 ,3 ,41,30,
390 | 16,5 ,6 ,7 ,8 ,9 ,31,
391 | 18,10,11,42,13, 14,32,
392 | 27,46,44,255,255,45,17,
393 | 19,22,61,62,51,24,25,
394 | 20,21,40,12,4,23,60,
395 | 34,37,39,38,35,33,36};
396 | int i = 0;
397 | for (int y = 0; y < 7; y++)
398 | {
399 | for (int x = 0; x < 7; x++)
400 | {
401 |
402 | if (itemsList.Count >= ditems[i])
403 | {
404 | itemsArray[x, y] = itemsList[ditems[i]];
405 |
406 | }
407 | i++;
408 | }
409 | }
410 | }
411 |
412 |
413 | byte widthIcons = 7;
414 | byte heightIcons = 6;
415 | private void Form1_ResizeEnd(object sender, EventArgs e)
416 | {
417 |
418 | //Resize the form to always be a multiple of 32
419 | int w = (this.Size.Width / 32) * 32;
420 | int h = (this.Size.Height / 32) * 32;
421 | if (w >= 24 * 32)
422 | {
423 | w = (24 * 32);
424 | }
425 | if (h >= 24 * 32)
426 | {
427 | h = (24 * 32);
428 | }
429 | if (h <= 64)
430 | {
431 | h = 64;
432 | }
433 | if (w <= 48)
434 | {
435 | w = 32;
436 | }
437 | this.Size = new Size((w) + 16, (h) + 7);
438 | widthIcons = (byte)(w / 32);
439 | heightIcons = (byte)((h / 32) - 1);
440 | drawIcons();
441 |
442 | }
443 | bool editMode = false;
444 | private void toolStripMenuItem1_Click(object sender, EventArgs e)
445 | {
446 | if (toolStripMenuItem1.Checked)
447 | {
448 | editMode = true;
449 | this.FormBorderStyle = FormBorderStyle.Sizable;
450 | }
451 | else
452 | {
453 | editMode = false;
454 | this.FormBorderStyle = FormBorderStyle.FixedSingle;
455 | }
456 | }
457 | bool mDown = false;
458 | bool startDrag = true;
459 | CustomItem dragged = null;
460 | CustomItem swapped = null;
461 | int xdpos = -1;
462 | int ydpos = -1;
463 | private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
464 | {
465 | if (editMode == true)
466 | {
467 | if (mDown == false)
468 | {
469 | uiChanged = true;
470 | dragged = itemsArray[(e.X / 32), (e.Y / 32)];
471 | startDrag = true;
472 | xdpos = (e.X / 32);
473 | ydpos = (e.Y / 32);
474 | Cursor = Cursors.Hand;
475 | mDown = true;
476 | }
477 | }
478 | }
479 |
480 | private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
481 | {
482 | if (editMode == true)
483 | {
484 | if (mDown == true)
485 | {
486 | if (startDrag == true)
487 | {
488 | if ((e.X / 32) < 24 && (e.X / 32) >= 0)
489 | {
490 | if ((e.Y / 32) < 24 && (e.Y / 32) >= 0)
491 | {
492 | uiChanged = true;
493 | swapped = itemsArray[(e.X / 32), (e.Y / 32)];
494 | itemsArray[(e.X / 32), (e.Y / 32)] = dragged;
495 | if (dragged != null)
496 | {
497 | if (dragged.name == "Timer")
498 | {
499 | timerpospixel = new Point((e.X / 32) * 32, (e.Y / 32) * 32);
500 | }
501 | }
502 | itemsArray[xdpos, ydpos] = swapped;
503 | swapped = null;
504 | dragged = null;
505 | startDrag = false;
506 | xdpos = -1;
507 | ydpos = -1;
508 | Cursor = Cursors.Default;
509 | mDown = false;
510 | }
511 | }
512 | }
513 | }
514 | }
515 | drawIcons();
516 | }
517 |
518 |
519 | DateTime timestarted;
520 | DateTime timeended;
521 | bool timerend = false;
522 | bool uiChanged = false;
523 | private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
524 | {
525 | int mX = (e.X / 32);
526 | int mY = (e.Y / 32);
527 | if (editMode == false)
528 | {
529 | if (itemsArray[mX, mY] != null)
530 | {
531 | if (e.Button == MouseButtons.Left)
532 | {
533 |
534 |
535 | if (itemsArray[mX, mY].on)
536 | {
537 | if (itemsArray[mX, mY].count)
538 | {
539 | itemsArray[mX, mY].counter++;
540 | }
541 |
542 | if (itemsArray[mX, mY].level < itemsArray[mX, mY].iconsId.Length - 1)
543 | {
544 | if (itemsArray[mX, mY].name == "Timer_StartDone")
545 | {
546 | timeended = DateTime.Now;
547 | timerend = true;
548 | }
549 | //if (itemsArray)
550 | if (itemsArray[mX, mY].bottle)
551 | {
552 | if (itemsArray[mX,mY].level == 0)
553 | {
554 | itemsArray[mX, mY].level += 2;
555 | }
556 | else
557 | {
558 | if (itemsArray[mX, mY].level < 6)
559 | {
560 | itemsArray[mX, mY].level++;
561 | }
562 | }
563 | }
564 | else
565 | {
566 | itemsArray[mX, mY].level++;
567 | }
568 | //drawIcons();
569 | }
570 | else
571 | {
572 | if (itemsArray[mX, mY].level == itemsArray[mX, mY].iconsId.Length - 1)
573 | {
574 | if (itemsArray[mX, mY].loop == true)
575 | {
576 | itemsArray[mX, mY].level = 0;
577 | }
578 | }
579 | }
580 |
581 | }
582 | else
583 | {
584 | if (itemsArray[mX, mY].name == "Timer_Start" || itemsArray[mX, mY].name == "Timer_StartDone")
585 | {
586 |
587 | for (int x = 0; x < widthIcons; x++)
588 | {
589 | for (int y = 0; y < heightIcons; y++)
590 | {
591 | if (itemsArray[x, y] != null)
592 | {
593 | if (itemsArray[x, y].name == "Timer")
594 | {
595 | timerpospixel = new Point(x * 32, y * 32);
596 | timer2.Enabled = true;
597 | timer = true;
598 | timestarted = DateTime.Now;
599 | break;
600 | }
601 | }
602 | }
603 | }
604 | }
605 | if (itemsArray[mX, mY].name == "Timer_Done")
606 | {
607 | timeended = DateTime.Now;
608 | timerend = true;
609 | }
610 | itemsArray[mX, mY].on = true;
611 | //drawIcons();
612 | }
613 | TimeSpan objt = DateTime.Now.Subtract(timestarted);
614 | if (itemsArray[mX, mY].loop == false)
615 | {
616 | item_found.Add(itemsArray[mX, mY].name + " Added at " + objt.Hours.ToString("D2") + ":" + objt.Minutes.ToString("D2") + ":" + objt.Seconds.ToString("D2"));
617 | }
618 | }
619 | else if (e.Button == MouseButtons.Right)
620 | {
621 | if (itemsArray[mX, mY].on)
622 | {
623 | if (itemsArray[mX, mY].name == "Timer_Start" || itemsArray[mX, mY].name == "Timer_StartDone")
624 | {
625 | if (itemsArray[mX, mY].level == 0)
626 | {
627 | timer = false;
628 | }
629 | }
630 |
631 |
632 | if (itemsArray[mX, mY].count == false)
633 | {
634 | if (itemsArray[mX, mY].name == "Timer_Done" || itemsArray[mX, mY].name == "Timer_StartDone")
635 | {
636 |
637 | timerend = false;
638 | }
639 | TimeSpan objt = DateTime.Now.Subtract(timestarted);
640 | if (itemsArray[mX, mY].loop == false)
641 | {
642 | item_found.Add(itemsArray[mX, mY].name + " Removed at " + objt.Hours.ToString("D2") + ":" + objt.Minutes.ToString("D2") + ":" + objt.Seconds.ToString("D2"));
643 | }
644 | if (itemsArray[mX, mY].level > 0)
645 | {
646 | itemsArray[mX, mY].level--;
647 | if (itemsArray[mX, mY].bottle)
648 | {
649 | if (itemsArray[mX, mY].level == 1)
650 | {
651 | itemsArray[mX, mY].level--;
652 | }
653 | }
654 | }
655 | else if (itemsArray[mX, mY].level == 0)
656 | {
657 | if (itemsArray[mX, mY].loop == false)
658 | {
659 | itemsArray[mX, mY].on = false;
660 | }
661 | }
662 | }
663 | else
664 | {
665 | itemsArray[mX, mY].counter--;
666 | }
667 | }
668 | }
669 | }
670 | }
671 | else
672 | {
673 | if (e.Button == MouseButtons.Right)
674 | {
675 | ItemSelectorForm itemForm = new ItemSelectorForm();
676 | if (itemForm.ShowDialog() == DialogResult.OK)
677 | {
678 | if (itemForm.selectedItem == 255)
679 | {
680 | itemsArray[mX, mY] = null;
681 | }
682 | else
683 | {
684 | itemsArray[mX, mY] = itemsList[itemForm.selectedItem];
685 | }
686 | }
687 | }
688 | }
689 | drawIcons();
690 | }
691 |
692 | private void toolStripMenuItem2_Click(object sender, EventArgs e)
693 | {
694 | OptionsForm of = new OptionsForm();
695 | of.checkBox1.Checked = checkUpdate;
696 | of.iconset = currentIconset;
697 | of.bgr = currentBgr;
698 | of.ShowDialog();
699 | checkUpdate = of.checkBox1.Checked;
700 | currentBgr = of.bgr;
701 | loadIconsSet(of.iconset);
702 | drawIcons();
703 | }
704 |
705 | private void topMostToolStripMenuItem_Click(object sender, EventArgs e)
706 | {
707 | if (TopMost == false)
708 | {
709 | TopMost = true;
710 | topMostToolStripMenuItem.Checked = true;
711 | }
712 | else
713 | {
714 | TopMost = false;
715 | topMostToolStripMenuItem.Checked = false;
716 | }
717 | }
718 | bool autoUpdate = false;
719 | private void toolStripMenuItem3_Click(object sender, EventArgs e)
720 | {
721 | if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
722 | {
723 | toolStripMenuItem3.Checked = false;
724 | timer1.Enabled = false;
725 | }
726 | else
727 | {
728 | toolStripMenuItem3.Checked = true;
729 | autoUpdate = true;
730 | timer1.Enabled = true;
731 | }
732 |
733 | }
734 |
735 | private void Form1_FormClosing(object sender, CancelEventArgs e)
736 | {
737 | if (uiChanged == true)
738 | {
739 | if (MessageBox.Show("Your Layout has changed do you want to save?", "Warning",
740 | MessageBoxButtons.YesNo) == DialogResult.Yes)
741 | {
742 | //e.Cancel = true;
743 | save();
744 | }
745 | }
746 | }
747 |
748 |
749 |
750 |
751 |
752 |
753 | public void autoUpdateHud()
754 | {
755 | if (autoUpdate == true)
756 | {
757 | if (File.Exists(openFileDialog1.FileName))
758 | {
759 | try
760 | {
761 | byte[] buffer = new byte[255];
762 | FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
763 | fs.Position = 0x1E00;
764 | fs.Read(buffer, 0, 255);
765 | fs.Close();
766 |
767 | //0 - 14 bow to book of mudora
768 | //15 = bottle not used in my list
769 | //(16 - 23 somaria to moon pearl) -1 list
770 | for (int i = 0; i < 15; i++)
771 | {
772 |
773 | if (buffer[i] != 0)
774 | {
775 | if (i != 1)//bomerang
776 | {
777 | if (buffer[i] == 1)
778 | {
779 | itemsList[i].on = true;
780 | }
781 | }
782 | else if (i != 4) // Mushroom
783 | {
784 | if (buffer[i] == 1)
785 | {
786 | itemsList[i].on = true;
787 | }
788 | }
789 | else if (i != 12) // Shovel
790 | {
791 | if (buffer[i] == 1)
792 | {
793 | itemsList[i].on = true;
794 | }
795 | }
796 | else
797 | {
798 | itemsList[i].on = true;
799 | }
800 | if (i != 3) // bombs
801 | {
802 | if (i != 1)//bomerang
803 | {
804 | if (i != 4) // Mushroom
805 | {
806 | if (i != 12) // Shovel
807 | {
808 | itemsList[i].level = (byte)(buffer[i] - 1);
809 | itemsList[i].on = true;
810 | }
811 | else
812 | {
813 | if (buffer[i] >= 2)//if it the shovel and buffer >= 2
814 | {
815 | itemsList[42].on = true; //flute = on
816 | }
817 | }
818 | }
819 | else
820 | {
821 | if (buffer[i] == 2)//if it the mushroom and buffer == 2
822 | {
823 | itemsList[41].on = true; //powder = on
824 | }
825 | }
826 | }
827 | else
828 | {
829 | if (buffer[i] == 2)//if it the boomerang and buffer == 2
830 | {
831 | itemsList[40].on = true; //red boomerang = on
832 | }
833 | }
834 | }
835 | else
836 | {
837 | itemsList[i].on = true;
838 | }
839 |
840 |
841 | }
842 | else
843 | {
844 | itemsList[i].on = false;
845 | itemsList[i].level = 0;
846 | //itemsList[i].level = (byte)(buffer[i]-1);
847 | }
848 | }
849 | itemsList[51].on = true;
850 | if (buffer[43] == 0)
851 | {
852 | itemsList[51].level = 0;
853 | }
854 | if (buffer[43] == 1)
855 | {
856 | itemsList[51].level = 1;
857 | }
858 | if (buffer[43] == 2)
859 | {
860 | itemsList[51].level = 2;
861 | }
862 | if (buffer[43] == 3)
863 | {
864 | itemsList[51].level = 3;
865 | }
866 |
867 | for (int i = 16; i < 24; i++)
868 | {
869 | if (buffer[i] != 0)
870 | {
871 | itemsList[i - 1].on = true;
872 | itemsList[i - 1].level = (byte)(buffer[i] - 1);
873 | }
874 | }
875 |
876 | for (int i = 24; i < 32; i++)
877 | {
878 | if (i == 27)
879 | {
880 | itemsList[i - 2].on = true;
881 | }
882 | if (buffer[i] != 0)
883 | {
884 | itemsList[i - 2].on = true;
885 | if (i != 27)
886 | itemsList[i - 2].level = (byte)(buffer[i] - 1);
887 | else
888 | {
889 |
890 | itemsList[i - 2].level = (byte)(buffer[i]);
891 | }
892 | }
893 | }
894 | int adddoubles = 210;
895 | if (buffer[adddoubles] != 96)
896 | {
897 | if ((buffer[adddoubles] & 1) == 1)//flute working 42
898 | {
899 | itemsList[42].on = true;
900 | }
901 |
902 | if ((buffer[adddoubles] & 2) == 2)//flute fake 42
903 | {
904 | itemsList[42].on = true;
905 | }
906 | if ((buffer[adddoubles] & 4) == 4)//shovel 12
907 | {
908 | itemsList[12].on = true;
909 | }
910 | if ((buffer[adddoubles] & 16) == 16)//powder 41
911 | {
912 | itemsList[41].on = true;
913 | }
914 | if ((buffer[adddoubles] & 32) == 32)//mush 4
915 | {
916 | itemsList[4].on = true;
917 | }
918 | if ((buffer[adddoubles] & 64) == 64)//red boom 40
919 | {
920 | itemsList[40].on = true;
921 | }
922 | if ((buffer[adddoubles] & 128) == 128)//blue boom 1
923 | {
924 | itemsList[1].on = true;
925 | }
926 | }
927 | BitConverter.ToInt16(new byte[2] {0,1}, 0);
928 | if ((buffer[52] & 1) == 1) //hera
929 | {
930 | itemsList[32].on = true;
931 | }
932 | if ((buffer[52] & 2) == 2) //desert
933 | {
934 | itemsList[31].on = true;
935 | }
936 | if ((buffer[52] & 4) == 4) //eastern
937 | {
938 | itemsList[30].on = true;
939 | }
940 | if ((buffer[133]) == 3) //agahnim
941 | {
942 | itemsList[43].on = true;
943 | }
944 |
945 |
946 | if ((buffer[58] & 1) == 1)//mire
947 | {
948 | itemsList[33].on = true;
949 | }
950 | if ((buffer[58] & 2) == 2)//pod
951 | {
952 | itemsList[34].on = true;
953 | }
954 | if ((buffer[58] & 4) == 4)//ice
955 | {
956 | itemsList[35].on = true;
957 | }
958 | if ((buffer[58] & 8) == 8)//trock
959 | {
960 | itemsList[36].on = true;
961 | }
962 | if ((buffer[58] & 16) == 16)//swamp
963 | {
964 | itemsList[37].on = true;
965 | }
966 | if ((buffer[58] & 32) == 32)//tt
967 | {
968 | itemsList[38].on = true;
969 | }
970 | if ((buffer[58] & 64) == 64)//sw
971 | {
972 | itemsList[39].on = true;
973 | }
974 |
975 |
976 | drawIcons();
977 | }
978 | catch (Exception e)
979 | {
980 | this.Text = e.Message.ToString();
981 | }
982 | }
983 | }
984 | }
985 |
986 | private void timer1_Tick(object sender, EventArgs e)
987 | {
988 | //Autoupdate
989 | autoUpdateHud();
990 | }
991 |
992 | private void helpToolStripMenuItem_Click(object sender, EventArgs e)
993 | {
994 | System.Diagnostics.Process.Start("https://zarby89.github.io/ZeldaHud/");
995 | }
996 | public bool checkUpdate = true;
997 | private void save()
998 | {
999 | string[] config = new string[10];
1000 | config[0] = "width=" + widthIcons;
1001 | config[1] = "height=" + heightIcons;
1002 | config[2] = "items=" + stringitems();
1003 | byte b = 0;
1004 | if (TopMost)
1005 | { b = 1; }
1006 | else
1007 | { b = 0; }
1008 | config[3] = "topmost=" + b;
1009 | config[4] = "winposx=" + this.Location.X;
1010 | config[5] = "winposy=" + this.Location.Y;
1011 | config[6] = "color=" + clearColor.ToArgb();
1012 | config[7] = "iconset=" + currentIconset;
1013 | if (checkUpdate)
1014 | { b = 1; }
1015 | else
1016 | { b = 0; }
1017 | config[8] = "checkupdate=" + b;
1018 | config[9] = "background=" + currentBgr;
1019 |
1020 | File.WriteAllLines("layout.config", config);
1021 | }
1022 | private void saveLayoutToolStripMenuItem_Click(object sender, EventArgs e)
1023 | {
1024 | save();
1025 | uiChanged = false;
1026 | }
1027 |
1028 | public void loadLayout(string sx = "Layout.config")
1029 | {
1030 | if (File.Exists(sx))
1031 | {
1032 | string[] s = File.ReadAllLines(sx);
1033 | string[] itl = s[2].Split('=')[1].Split(',');
1034 | int w = Convert.ToInt32(s[0].Split('=')[1]);
1035 | int h = Convert.ToInt32(s[1].Split('=')[1]);
1036 | this.Location = new Point(Convert.ToInt32(s[4].Split('=')[1]), Convert.ToInt32(s[5].Split('=')[1]));
1037 | int b = Convert.ToInt32(s[3].Split('=')[1]);
1038 | if (b == 1)
1039 | { TopMost = true;topMostToolStripMenuItem.Checked = true; }
1040 | else
1041 | { TopMost = false; topMostToolStripMenuItem.Checked = false; }
1042 | b = Convert.ToInt32(s[8].Split('=')[1]);
1043 | if (b == 1)
1044 | { checkUpdate = true; }
1045 | else
1046 | { checkUpdate = false; }
1047 | clearColor = Color.FromArgb(Convert.ToInt32(s[6].Split('=')[1]));
1048 | currentIconset = s[7].Split('=')[1];
1049 | if (s.Length >= 10)
1050 | {
1051 | currentBgr = s[9].Split('=')[1];
1052 | }
1053 |
1054 |
1055 |
1056 | int p = 0;
1057 | for (int x = 0; x < 24; x++)
1058 | {
1059 | for (int y = 0; y < 24; y++)
1060 | {
1061 | if (Convert.ToInt32(itl[p]) != -1)
1062 | {
1063 | itemsArray[x, y] = itemsList[Convert.ToInt32(itl[p])];
1064 | }
1065 | else
1066 | {
1067 | itemsArray[x, y] = null;
1068 | }
1069 | p++;
1070 | }
1071 | }
1072 | this.Size = new Size((w * 32) + 16, ((h + 1) * 32) + 7);
1073 | widthIcons = (byte)(w);
1074 | heightIcons = (byte)((h));
1075 | drawIcons();
1076 | }
1077 | }
1078 |
1079 |
1080 | private string stringitems()
1081 | {
1082 | string s = "";
1083 | int p = 0;
1084 | for (int x = 0; x < 24; x++)
1085 | {
1086 | for (int y = 0; y < 24; y++)
1087 | {
1088 | if (itemsArray[x,y] != null)
1089 | {
1090 | s+=itemsList.FindIndex(i => i.Equals(itemsArray[x,y])).ToString();
1091 | s += ",";
1092 | }
1093 | else
1094 | {
1095 | s += "-1,";
1096 | }
1097 | p++;
1098 | }
1099 | }
1100 | return s;
1101 | }
1102 |
1103 | private void importOldLayoutToolStripMenuItem_Click(object sender, EventArgs e)
1104 | {
1105 | if (openFileDialog2.ShowDialog() == DialogResult.Cancel)
1106 | {
1107 |
1108 | }
1109 | else
1110 | {
1111 | /*string[] s = File.ReadAllLines(openFileDialog2.FileName);
1112 |
1113 | int w = Convert.ToInt32(s[0].Split('=')[1]);
1114 | int h = Convert.ToInt32(s[1].Split('=')[1]);
1115 | string[] itl = s[3].Split('=')[1].Split(',');
1116 | int p = 0;
1117 | for (int x = 0; x < w; x++)
1118 | {
1119 | for (int y = 0; y < h; y++)
1120 | {
1121 | if (Convert.ToInt32(itl[p]) != 254)
1122 | {
1123 | itemsArray[x, y] = itemsList[Convert.ToInt32(itl[p])];
1124 | }
1125 | else
1126 | {
1127 | itemsArray[x, y] = null;
1128 | }
1129 | p++;
1130 | }
1131 | }
1132 | this.Size = new Size((w*32) + 16, ((h+1)*32) + 7);
1133 | widthIcons = (byte)(w);
1134 | heightIcons = (byte)((h) - 1);*/
1135 |
1136 | loadLayout(openFileDialog2.FileName);
1137 | drawIcons();
1138 | }
1139 | }
1140 |
1141 | private void clearItemsToolStripMenuItem_Click(object sender, EventArgs e)
1142 | {
1143 | for(int x = 0;x<24;x++)
1144 | {
1145 | for (int y = 0; y < 24; y++)
1146 | {
1147 | if (itemsArray[x, y] != null)
1148 | {
1149 | itemsArray[x, y].on = false;
1150 | itemsArray[x, y].level = 0;
1151 | }
1152 | }
1153 | }
1154 | drawIcons();
1155 | }
1156 |
1157 | private void showStatsToolStripMenuItem_Click(object sender, EventArgs e)
1158 | {
1159 | timestarted = DateTime.Now;
1160 | }
1161 |
1162 | private void showStatsToolStripMenuItem1_Click(object sender, EventArgs e)
1163 | {
1164 | Stats f = new Stats();
1165 | for(int i = 0;i= 4)
1189 | {
1190 | y++;
1191 | x = 0;
1192 | }
1193 | }
1194 | b.Save("Test.png");
1195 |
1196 | }
1197 | bool timer = false;
1198 | Point timerpospixel;
1199 | private void timer2_Tick(object sender, EventArgs e)
1200 | {
1201 | drawIcons();
1202 | }
1203 | }
1204 | }
1205 |
--------------------------------------------------------------------------------