Browse Source

Add logger and JSON reader

denikson 5 years ago
parent
commit
bc23cfc661

+ 0 - 5
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Init.cs

@@ -1207,11 +1207,7 @@ namespace CM3D2.MultipleMaids.Plugin
             bgArray = stringList8.ToArray();
             var strArray8 = new string[3] {"dokidokifallinlove_short_inst", "dokidokifallinlove_short", "entrancetoyou_short"};
             var strArray9 = new string[1] {"scarlet leap_short"};
-            var strArray10 = new string[3] {"stellarmytears_short", "stellarmytears_short2", "stellarmytears_short3"};
             var strArray11 = new string[1] {"RhythmixToYou"};
-            var strArray12 = new string[3] {"happy_happy_scandal1", "happy_happy_scandal2", "happy_happy_scandal3"};
-            var strArray13 = new string[1] {"can_know_two_close"};
-            var strArray14 = new string[3] {"sweetsweeteveryday_short1", "sweetsweeteveryday_short2", "sweetsweeteveryday_short3"};
             var strArray15 = new string[5]
             {
                     "bloomingdreaming_short", "kiminiaijodelicious_short", "luminousmoment_short", "nightmagicfire_short",
@@ -1236,7 +1232,6 @@ namespace CM3D2.MultipleMaids.Plugin
             stringList10.AddRange(strArray11);
             stringList10.AddRange(strArray15);
             bgmArray = stringList10.ToArray();
-            var strArray16 = new string[2] {"OutletPark:54", "HoneymoonRoom:102"};
             var stringList12 = new List<string>(50 + parArray2.Length);
             stringList12.AddRange(parArray2);
             var enabled_id_list = new HashSet<int>();

+ 0 - 7
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.cs

@@ -616,13 +616,6 @@ namespace CM3D2.MultipleMaids.Plugin
                 "Kitchen_Night", "Shitsumu", "Shitsumu_Night", "Salon_Entrance", "Bar"
         };
 
-        private string[] bgArrayB = new string[24]
-        {
-                "Salon", "Salon_Day", "Syosai", "Syosai_Night", "DressRoom_NoMirror", "MyBedRoom", "MyBedRoom_Night", "Bathroom",
-                "PlayRoom", "Pool", "SMRoom", "PlayRoom2", "Salon_Garden", "LargeBathRoom", "MaidRoom", "OiranRoom", "Penthouse", "Town",
-                "Kitchen", "Kitchen_Night", "Shitsumu", "Shitsumu_Night", "Salon_Entrance", "Bar"
-        };
-
         private readonly ComboBox2 bgCombo = new ComboBox2();
         private readonly ComboBox2 bgCombo2 = new ComboBox2();
         private GUIContent[] bgCombo2List;

+ 2 - 0
MultipleMaids/MultipleMaids.csproj

@@ -88,6 +88,8 @@
     <Compile Include="ImportCM2.cs" />
     <Compile Include="CM3D2\MultipleMaids\Plugin\MultipleMaids.cs" />
     <Compile Include="AssemblyInfo.cs" />
+    <Compile Include="Util\Logger.cs" />
+    <Compile Include="Util\SimpleJSON.cs" />
   </ItemGroup>
   <ItemGroup>
     <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">

+ 44 - 0
MultipleMaids/Util/Logger.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using UnityInjector.ConsoleUtil;
+
+namespace Util
+{
+    internal class LogLevel
+    {
+        public static LogLevel Info = new LogLevel(ConsoleColor.White, "INF");
+        public static LogLevel Debug = new LogLevel(ConsoleColor.Gray, "DBG");
+        public static LogLevel Warning = new LogLevel(ConsoleColor.Yellow, "WRN");
+        public static LogLevel Error = new LogLevel(ConsoleColor.Red, "ERR");
+
+        public ConsoleColor Color { get; }
+        public string Tag { get; }
+
+        private LogLevel(ConsoleColor color, string tag)
+        {
+            Color = color;
+            Tag = tag;
+        }
+    }
+
+    internal static class Logger
+    {
+        public const string PRE_TAG = "MultipleMaids";
+
+        public static void Log(LogLevel level, string msg)
+        {
+            SafeConsole.ForegroundColor = level.Color;
+            Console.WriteLine($"[{PRE_TAG}][{level.Tag}] {msg}");
+            SafeConsole.ForegroundColor = ConsoleColor.White;
+        }
+
+        [Conditional("DEBUG")]
+        public static void Debug(string msg)
+        {
+            Log(LogLevel.Debug, msg);
+        }
+    }
+}

File diff suppressed because it is too large
+ 1353 - 0
MultipleMaids/Util/SimpleJSON.cs