2023-10-01 18:40:41 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
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;
|
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.Windows.Forms;
|
|
|
|
using TaikoSoundEditor.Commons.Emit;
|
|
|
|
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-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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|