Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit dced997

Browse files
committed
Stable | 3.3
* Implemented Update Service * Added Automatic Log dumping; as an option. * Implemented Dark-theme; can be disabled/enabled. * Removed old code and forms. * Refined the Interface. * Cleaned the code-base. * Added code-base comments here & there.
1 parent c1df1b9 commit dced997

28 files changed

+666
-1116
lines changed

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/3DNUS Material Edition.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@
9898
<Reference Include="System.Xml" />
9999
</ItemGroup>
100100
<ItemGroup>
101-
<Compile Include="Main\MnExtension.cs">
102-
<SubType>Form</SubType>
103-
</Compile>
104-
<Compile Include="Main\MnExtension.Designer.cs">
105-
<DependentUpon>MnExtension.cs</DependentUpon>
106-
</Compile>
107101
<Compile Include="Main\MnSettings.cs">
108102
<SubType>Form</SubType>
109103
</Compile>
@@ -142,9 +136,6 @@
142136
<Compile Include="Parser\PsSyncDown.cs" />
143137
<Compile Include="Services\SvcUpd.cs" />
144138
<Compile Include="Parser\PsYLS.cs" />
145-
<EmbeddedResource Include="Main\MnExtension.resx">
146-
<DependentUpon>MnExtension.cs</DependentUpon>
147-
</EmbeddedResource>
148139
<EmbeddedResource Include="Main\MnSettings.resx">
149140
<DependentUpon>MnSettings.cs</DependentUpon>
150141
<SubType>Designer</SubType>

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/App.config

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,34 @@
1111
<userSettings>
1212
<_3DNUS_Material_Edition.Properties.Settings>
1313
<setting name="dev_auto_upd" serializeAs="String">
14-
<value/>
14+
<value />
1515
</setting>
1616
<setting name="dev_dump_info" serializeAs="String">
17-
<value/>
17+
<value />
1818
</setting>
1919
<setting name="dev_flags" serializeAs="String">
20-
<value/>
20+
<value />
2121
</setting>
2222
<setting name="dev_def_titlelist" serializeAs="String">
23-
<value/>
23+
<value />
2424
</setting>
2525
<setting name="dev_music" serializeAs="String">
26-
<value/>
26+
<value />
2727
</setting>
2828
<setting name="dev_mode" serializeAs="String">
29-
<value/>
29+
<value />
3030
</setting>
3131
<setting name="eula_read" serializeAs="String">
32-
<value/>
32+
<value />
3333
</setting>
3434
<setting name="dev_tour" serializeAs="String">
35-
<value/>
35+
<value />
36+
</setting>
37+
<setting name="dev_dark_theme" serializeAs="String">
38+
<value>0</value>
39+
</setting>
40+
<setting name="dev_auto_dump_log" serializeAs="String">
41+
<value />
3642
</setting>
3743
</_3DNUS_Material_Edition.Properties.Settings>
3844
</userSettings>

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/FmLoad.Designer.cs

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/FmLoad.cs

Lines changed: 29 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ public partial class FmLoad : Form
88
{
99
public readonly String cd = Path.GetDirectoryName(Application.ExecutablePath);
1010
private bool is64 = System.Environment.Is64BitOperatingSystem;
11-
private bool checksum;
12-
13-
private MnMain frm;
11+
private Form mn = new MnMain();
1412

1513
public FmLoad()
1614
{
@@ -19,163 +17,57 @@ public FmLoad()
1917

2018
private void main_load_Load(object sender, EventArgs e)
2119
{
22-
//string cd = Application.StartupPath;
23-
//if (!Directory.Exists(cd)) Directory.CreateDirectory(cd);
24-
25-
//Assembly ass = Assembly.GetExecutingAssembly();
26-
//String prefix = "_3DNUS.RuntimeAssets." + wat + ".";
27-
//int prefixlen = prefix.Length;
28-
29-
//foreach (String ss in ass.GetManifestResourceNames().Where(str => str.StartsWith(prefix)))
30-
//{
31-
// String s = ss.Substring(prefixlen);
32-
// String fn = Path.Combine(cd, s);
33-
34-
// if (File.Exists(fn))
35-
// if (checksum)
36-
// {
37-
// String cs = null;
38-
39-
// using (Stream sr = ass.GetManifestResourceStream(ss))
40-
// {
41-
// using (MD5 md = MD5.Create())
42-
// {
43-
// cs = BitConverter.ToString(md.ComputeHash(sr)).ToLower();
44-
// }
45-
// }
46-
47-
// using (FileStream fs = File.OpenRead(fn))
48-
// {
49-
// using (MD5 md = MD5.Create())
50-
// {
51-
// if (BitConverter.ToString(md.ComputeHash(fs)).ToLower() == cs) continue;
52-
// }
53-
// }
54-
// }
55-
// else continue;
56-
57-
// using (Stream sr = ass.GetManifestResourceStream(ss))
58-
// {
59-
// using (FileStream fs = File.OpenWrite(fn))
60-
// {
61-
// byte[] buf = new byte[0x1000];
62-
// int read = -1;
63-
// while (true)
64-
// {
65-
// read = sr.Read(buf, 0, buf.Length);
66-
// if (read == 0) break;
67-
// fs.Write(buf, 0, read);
68-
if (Properties.Settings.Default.dev_music == "")
69-
{
70-
Properties.Settings.Default.dev_music = "0";
71-
Properties.Settings.Default.Save();
72-
//Application.Restart();
73-
}
74-
if (Properties.Settings.Default.dev_auto_upd == "")
75-
{
76-
Properties.Settings.Default.dev_auto_upd = "1";
77-
Properties.Settings.Default.Save();
78-
//Application.Restart();
79-
}
80-
if (Properties.Settings.Default.eula_read == "")
20+
if (Properties.Settings.Default.dev_auto_upd == "1")
8121
{
82-
Properties.Settings.Default.eula_read = "nope";
83-
Properties.Settings.Default.Save();
22+
splash_timer.Stop();
23+
SvcUpd.SvcUpdate();
24+
tmr_get_upd_stat.Start();
8425
}
85-
/*
86-
if (Properties.Settings.Default.dev_auto_upd == "1")
26+
else
8727
{
88-
try
28+
if (Properties.Settings.Default.dev_tour == "")
8929
{
90-
dev_status.Text = "Checking for Updates...";
91-
File.Delete(Path.Combine(cd, "Update_info.txt"));
92-
File.Delete(Path.Combine(cd, "Update_URI.txt"));
93-
File.Delete(Path.Combine(cd, "3DNUS_old.exe"));
94-
File.Delete(Path.Combine(cd, "3DNUS_new.exe"));
95-
File.Delete(Path.Combine(cd, "upd_fin.exe"));
96-
WebClient get_info = new WebClient();
97-
get_info.DownloadFile(new Uri("https://raw.githubusercontent.com/zoltx23/3DNUS/master/Update_Info.txt"), cd + "\\Update_info.txt");
98-
WebClient upd_dwld = new WebClient();
99-
using (Stream upd = File.Open(cd + "\\Update_info.txt", FileMode.Open))
100-
{
101-
using (StreamReader reader = new StreamReader(upd))
102-
{
103-
string rd_upd = null;
104-
105-
rd_upd = reader.ReadToEnd();
106-
107-
if (rd_upd == Application.ProductVersion)
108-
{
109-
dev_status.Text = "No new Updates";
110-
splash_timer.Start();
111-
}
112-
else
113-
{
114-
dev_status.Text = "Downloading New update...";
115-
if (is64 == true)
116-
{
117-
upd_dwld.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/x64/3DNUS.exe?raw=true"), cd + "\\3DNUS_new.exe");
118-
WebClient get_fin = new WebClient();
119-
get_fin.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/upd_fin.exe?raw=true"), cd + "\\upd_fin.exe");
120-
Process.Start(cd + "\\upd_fin.exe");
121-
dev_status.Text = "Preparing...";
122-
Application.Exit();
123-
}
124-
if (is64 == false)
125-
{
126-
upd_dwld.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/x32/3DNUS.exe?raw=true"), cd + "\\3DNUS_new.exe");
127-
WebClient get_fin = new WebClient();
128-
get_fin.DownloadFile(new Uri("https://github.com/zoltx23/3DNUS/blob/master/Updates/upd_fin.exe?raw=true"), cd + "\\upd_fin.exe");
129-
Process.Start(cd + "\\upd_fin.exe");
130-
dev_status.Text = "Preparing...";
131-
Application.Exit();
132-
}
133-
}
134-
}
135-
}
30+
Form dv = new dev_tour();
31+
dv.Show();
32+
this.Hide();
13633
}
137-
catch
34+
else
13835
{
139-
dev_status.Text = "Unable to update...";
14036
splash_timer.Start();
14137
}
14238
}
143-
else
144-
{*/
145-
14639
if (!File.Exists(cd + "\\3DNUS Material Edition.exe.old"))
14740
{
14841
File.Delete(cd + "\\3DNUS Material Edition.exe.old");
14942
}
150-
151-
if (Properties.Settings.Default.dev_tour == "")
152-
{
153-
Form dv = new dev_tour();
154-
dv.Show();
155-
this.Hide();
156-
}
157-
else
158-
{
159-
frm = new MnMain();
160-
splash_timer.Start();
161-
}
162-
163-
//}
16443
}
16544

16645
private void timer1_Tick(object sender, EventArgs e)
16746
{
16847
splash_timer.Stop();
169-
frm.Show();
48+
mn.Show();
17049
Hide();
17150
}
17251

173-
private void main_load_QueryAccessibilityHelp(object sender, QueryAccessibilityHelpEventArgs e)
52+
private void tmr_get_upd_stat_Tick(object sender, EventArgs e)
17453
{
175-
}
54+
//Fetch Svc Status
55+
dev_status.Text = SvcUpd.SvcUpdateStat;
56+
this.Refresh();
17657

177-
private void pic_splash_logo_Click(object sender, EventArgs e)
178-
{
58+
//Fetch and check Error codes
59+
if (SvcUpd.SvcUpdateStat == "Unable to update. [Overall Failure]")
60+
{
61+
splash_timer.Start();
62+
}
63+
if (SvcUpd.SvcUpdateStat == "Unable to update. [Get Binary Failed]")
64+
{
65+
splash_timer.Start();
66+
}
67+
if (SvcUpd.SvcUpdateStat == "No new Updates")
68+
{
69+
splash_timer.Start();
70+
}
17971
}
18072
}
18173
}

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/FmLoad.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
<metadata name="splash_timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123+
<metadata name="tmr_get_upd_stat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124+
<value>136, 17</value>
125+
</metadata>
123126
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
124127
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
125128
<value>

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/Main/MnExtension.Designer.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

Source/3DNUS_Material_Source/3DNUS Material Edition/3DNUS Material Edition/Main/MnExtension.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)