File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+
2+
3+ using MelonLoader ;
4+ using WorldLink ;
5+
6+ static class AquaMai
7+ {
8+ public static string ReadString ( string key )
9+ {
10+ return key == "Mods.WorldLink.LobbyUrl" ? Core . Config . LobbyUrl : null ;
11+ }
12+ }
13+
14+ [ AttributeUsage ( AttributeTargets . Class ) ]
15+ class EnableIf : Attribute
16+ {
17+ public EnableIf ( Type tpye , string condition ) { }
18+ }
19+
20+ [ AttributeUsage ( AttributeTargets . All ) ]
21+ class ConfigEntry : Attribute
22+ {
23+ public ConfigEntry ( bool hideWhenDefault ) { }
24+
25+ public ConfigEntry ( string name , string desc ) { }
26+ }
27+
28+ [ AttributeUsage ( AttributeTargets . All ) ]
29+ public class ConfigSection : Attribute
30+ {
31+ public ConfigSection ( string zh , string en , bool defaultOn = false ) { }
32+ }
Original file line number Diff line number Diff line change 1+ using MelonLoader ;
2+ using Tomlet ;
3+
4+ [ assembly: MelonInfo ( typeof ( WorldLink . Core ) , "WorldLink" , "1.0.0" , "Azalea" ) ]
5+ [ assembly: MelonGame ( "sega-interactive" , "Sinmai" ) ]
6+
7+ namespace WorldLink ;
8+
9+ public class Config
10+ {
11+ public string LobbyUrl { get ; set ; }
12+ public bool Debug { get ; set ; }
13+ }
14+
15+ public class Core : MelonMod
16+ {
17+ public static Config Config ;
18+
19+ public override void OnInitializeMelon ( )
20+ {
21+ // Load config
22+ LoggerInstance . Msg ( "Loading config..." ) ;
23+ Config = TomletMain . To < Config > ( File . ReadAllText ( "WorldLink.toml" ) ) ;
24+
25+ LoggerInstance . Msg ( "Patching..." ) ;
26+ HarmonyLib . Harmony . CreateAndPatchAll ( typeof ( Futari ) ) ;
27+
28+ if ( Config . Debug )
29+ {
30+ LoggerInstance . Msg ( "Patching debug..." ) ;
31+ HarmonyLib . Harmony . CreateAndPatchAll ( typeof ( Futari . FutariDebug ) ) ;
32+ }
33+
34+ LoggerInstance . Msg ( "Initialized." ) ;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments