Additions and WIP
Deleted obsolete code New additions: base for an updater WIP: Making the editor read FLW1 and FLI1 from provided file
This commit is contained in:
1313
BMGEditor/BMG.cs
1313
BMGEditor/BMG.cs
File diff suppressed because it is too large
Load Diff
@@ -1,48 +0,0 @@
|
|||||||
/*if (i + 2 > strToWrite.Count)
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EscapeSequence escSeq = new EscapeSequence();
|
|
||||||
string strEscSeqLen = String.Concat(strToWrite[i + 1], strToWrite[i + 2]);
|
|
||||||
escSeq.length = Byte.Parse(strEscSeqLen, NumberStyles.HexNumber);
|
|
||||||
escSeq.unk1 = Byte.Parse(String.Concat(strToWrite[i + 3], strToWrite[i + 4]), NumberStyles.HexNumber);
|
|
||||||
|
|
||||||
switch (escSeq.length)
|
|
||||||
{
|
|
||||||
case 0x06:
|
|
||||||
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x08:
|
|
||||||
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
|
||||||
escSeq.binValue2 = UInt16.Parse(String.Concat(strToWrite[i + 9], strToWrite[i + 10], strToWrite[i + 11], strToWrite[i + 12]), NumberStyles.HexNumber);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x0E:
|
|
||||||
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
|
||||||
escSeq.binValue2 = UInt16.Parse(String.Concat(strToWrite[i + 9], strToWrite[i + 10], strToWrite[i + 11], strToWrite[i + 12]), NumberStyles.HexNumber);
|
|
||||||
escSeq.binValue3 = UInt16.Parse(String.Concat(strToWrite[i + 13], strToWrite[i + 14], strToWrite[i + 15], strToWrite[i + 16]), NumberStyles.HexNumber);
|
|
||||||
escSeq.binValue4 = UInt16.Parse(String.Concat(strToWrite[i + 17], strToWrite[i + 18], strToWrite[i + 19], strToWrite[i + 20]), NumberStyles.HexNumber);
|
|
||||||
escSeq.binValue5 = UInt16.Parse(String.Concat(strToWrite[i + 21], strToWrite[i + 22], strToWrite[i + 23], strToWrite[i + 24]), NumberStyles.HexNumber);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x36:
|
|
||||||
for (int j = 0; j < escSeq.length)
|
|
||||||
{
|
|
||||||
escSeq.bigBinValue += Byte.Parse(strToWrite)
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
System.Windows.Forms.MessageBox.Show($"Error, please report this issue to Bussun#0586 on Discord. What went wrong: Unknown escape sequence\nMessage name: {entry.entryName} {entry.entryNo}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Byte> escSeqToWrite = BytesFromEscapeSequence(escSeq);
|
|
||||||
foreach (Byte b in escSeqToWrite)
|
|
||||||
{
|
|
||||||
m_File.Writer.Write(b);
|
|
||||||
}
|
|
||||||
i += escSeq.length * 2 - 3;
|
|
||||||
}*/
|
|
||||||
@@ -4,13 +4,16 @@ using System.Collections.Generic;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace BMGEditor
|
namespace BMGEditor
|
||||||
{
|
{
|
||||||
public static class Variables
|
public static class Variables
|
||||||
{
|
{
|
||||||
public const string softwareName = "Luma";
|
public const string softwareName = "Luma";
|
||||||
public const string softwareVersion = "v0.4";
|
public const string softwareVersion = "v0.4.5";
|
||||||
|
public const UInt64 softwareInternalVersion = 45;
|
||||||
public const bool isBeta = true;
|
public const bool isBeta = true;
|
||||||
public const bool isPrivateBeta = false;
|
public const bool isPrivateBeta = false;
|
||||||
}
|
}
|
||||||
@@ -23,15 +26,40 @@ namespace BMGEditor
|
|||||||
Bcsv.PopulateHashtable();
|
Bcsv.PopulateHashtable();
|
||||||
if (Variables.isBeta && Variables.isPrivateBeta) MessageBox.Show("This is a private beta, please don\'t leak it.", "Private", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
if (Variables.isBeta && Variables.isPrivateBeta) MessageBox.Show("This is a private beta, please don\'t leak it.", "Private", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
Application.Run(new MainForm());
|
Application.Run(new MainForm());
|
||||||
|
|
||||||
//Test();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Test()
|
static readonly HttpClient wrClient = new HttpClient();
|
||||||
|
static async void CheckUpdates()
|
||||||
{
|
{
|
||||||
string str = "FF";
|
const string verCheckURL = "https://bussun.github.io/res/checks/luma/upre1";
|
||||||
Byte octet = Byte.Parse(str, NumberStyles.HexNumber);
|
Stream wrAnswer;
|
||||||
Console.WriteLine(octet);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
wrAnswer = await wrClient.GetStreamAsync(verCheckURL);
|
||||||
|
StreamReader wrAnswerReader = new StreamReader(wrAnswer);
|
||||||
|
string wrAnswerContent = wrAnswerReader.ReadToEnd();
|
||||||
|
|
||||||
|
if (wrAnswerContent.Length != 0)
|
||||||
|
{
|
||||||
|
UInt64 wrAnswerVersion = UInt64.Parse(wrAnswerContent);
|
||||||
|
|
||||||
|
if (wrAnswerVersion > Variables.softwareInternalVersion)
|
||||||
|
MessageBox.Show("New version available", "Update available", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
else if (wrAnswerVersion == Variables.softwareInternalVersion)
|
||||||
|
MessageBox.Show("Luma is up to date.", "No update available", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
else
|
||||||
|
MessageBox.Show("Woah, you got a developpement version !", "The most up to date ever (for now)", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Couldn\'t check for updates, null response", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
MessageBox.Show("Couldn\'t check for updates", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user