1
0
mirror of synced 2024-11-24 04:20:10 +01:00
TaikoSoundEditor/Program.cs

67 lines
2.3 KiB
C#
Raw Normal View History

2023-10-01 18:40:41 +02:00
using System;
using System.Collections.Generic;
2023-07-17 10:20:00 +02:00
using System.Diagnostics;
2023-07-19 07:10:25 +02:00
using System.Globalization;
2023-10-01 18:40:41 +02:00
using System.IO;
using System.Linq;
using System.Reflection;
2023-07-21 19:02:02 +02:00
using System.Text;
2023-10-01 18:40:41 +02:00
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Windows.Forms;
using TaikoSoundEditor.Commons.Emit;
using TaikoSoundEditor.Commons.Extensions;
using TaikoSoundEditor.Commons.IO;
using TaikoSoundEditor.Commons.Utils;
2023-09-18 17:53:43 +02:00
using TaikoSoundEditor.Data;
2023-10-01 18:40:41 +02:00
using TaikoSoundEditor.Properties;
2023-07-17 10:20:00 +02:00
namespace TaikoSoundEditor
{
internal static class Program
{
2023-10-01 18:40:41 +02:00
private static void InitTypesJson()
{
var wordProps = new List<EntityPropertyInfo>
{
new EntityPropertyInfo("Key", typeof(string), defaultValue:"song_...", isReadOnly:true),
new EntityPropertyInfo("JapaneseText", typeof(string), defaultValue:"text.."),
new EntityPropertyInfo("JapaneseFontType", typeof(int), defaultValue:0),
}.Select(EntityPropertyInfoDTO.FromPropertyInfo).ToArray();
var col = new DynamicTypeCollection(
new DynamicType("Word", typeof(IWord), wordProps)
);
File.WriteAllText("adef.json", JsonSerializer.Serialize(col, new JsonSerializerOptions() { WriteIndented = true }));
}
2023-07-17 10:20:00 +02:00
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
2023-10-01 18:40:41 +02:00
{
2023-07-21 19:02:02 +02:00
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
2023-07-19 07:10:25 +02:00
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
2023-10-01 18:40:41 +02:00
SSL.LoadKeys();
2023-08-16 18:40:36 +02:00
2023-10-01 18:40:41 +02:00
string json = Resources.datatable_def_08_18;
try
{
json = File.ReadAllText(Config.DatatableDefPath);
}
catch { }
finally
{
DatatableTypes.LoadFromJson(json);
Config.DatatableDefPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "datatable_def.json");
File.WriteAllText(Config.DatatableDefPath, json);
}
2023-08-16 18:40:36 +02:00
2023-10-01 18:40:41 +02:00
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
2023-07-17 10:20:00 +02:00
Application.Run(new MainForm());
}
}
}