From 0b62560e1aae1f102a31a652874adc66f117cadf Mon Sep 17 00:00:00 2001 From: sth4nothing <892223922@qq.com> Date: Fri, 23 Nov 2018 22:55:53 +0800 Subject: [PATCH] C#7 => C#6 --- CMakeLists.txt | 2 +- DynamicExecutor/Main.cs | 2 +- NotEnoughHarvest/NotEnoughHarvest.cs | 6 ++-- TrainingRoom/TrainingRoom.cs | 47 ++++++++++++++-------------- TreasureDetector/TreasureDetector.cs | 10 ++++-- 5 files changed, 37 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78f40f8..8320eb7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if (WIN32) cmake_minimum_required(VERSION 3.11) project("Taiwu_Mods" CSharp) -set(CMAKE_CSharp_FLAGS "/langversion:7") +set(CMAKE_CSharp_FLAGS "/langversion:6") include(CSharpUtilities) SET(DLLPATH "The Scroll Of Taiwu Alpha V1.0_Data/Managed/") diff --git a/DynamicExecutor/Main.cs b/DynamicExecutor/Main.cs index c60d239..0b0b861 100644 --- a/DynamicExecutor/Main.cs +++ b/DynamicExecutor/Main.cs @@ -73,7 +73,7 @@ public static bool Load(UMM.ModEntry modEntry) { rootPath = modEntry.Path; Logger = modEntry.Logger; - string convert(UMM.ModEntry mod) => + Func convert = (mod) => $"\t\n" + "\t\ttrue\n" + "\t\tfalse\n" + diff --git a/NotEnoughHarvest/NotEnoughHarvest.cs b/NotEnoughHarvest/NotEnoughHarvest.cs index 01dfe72..084aa8e 100755 --- a/NotEnoughHarvest/NotEnoughHarvest.cs +++ b/NotEnoughHarvest/NotEnoughHarvest.cs @@ -116,7 +116,8 @@ static void OnGUI(UnityModManager.ModEntry modEntry) static void OnSaveGUI(UnityModManager.ModEntry modEntry) { - if (!int.TryParse(Settings.L, out int L)) { + int L; + if (!int.TryParse(Settings.L, out L)) { if (Settings.debug) Main.logger.Log("OnSaveGUI: invalid taiwu length, setting to 13 (default)..."); Settings.L = "13"; @@ -172,7 +173,8 @@ static void Prefix() if (Settings.debug) Main.logger.Log("entering next month, perparing..."); Settings.valid_coords.Clear(); - if (!int.TryParse(Settings.L, out int L)) { + int L; + if (!int.TryParse(Settings.L, out L)) { if (Settings.debug) Main.logger.Log("invalid taiwu length, setting to 13 (default)..."); Settings.L = "13"; diff --git a/TrainingRoom/TrainingRoom.cs b/TrainingRoom/TrainingRoom.cs index a8e40be..10af778 100644 --- a/TrainingRoom/TrainingRoom.cs +++ b/TrainingRoom/TrainingRoom.cs @@ -78,7 +78,7 @@ public static void Prefix(int[] baseEventDate, int chooseId) //Main.Logger.Log("GangID:" + GangID.ToString()); int GangGroupID = DateFile.instance.GetGangValueId(GangID, int.Parse(DateFile.instance.GetActorDate(任務對象ID, 20, false))); //Main.Logger.Log("GangGroupID:" + GangGroupID.ToString()); - + Dictionary GangGroupValue = DateFile.instance.presetGangGroupDateValue[GangGroupID]; //Main.Logger.Log("GangGroupValue:" + GangGroupValue.Select(x => String.Format("{0}:{1}", x.Key, x.Value)).ToArray().Join()); //Main.Logger.Log("\n"); @@ -94,30 +94,29 @@ public static void Prefix(int[] baseEventDate, int chooseId) // Main.Logger.Log("\n"); //} - - if (chooseId == 1000000002 && GangGroupID == 0) // "无" - { - EventSeries.Series1(GangGroupID); // 添加 相枢幻身 - } - else - if (chooseId == 1000000002 && GangGroupID == 1) //"太吾村民" - { - EventSeries.Series2(GangGroupID); // 添加 剑冢再临 - } - else - if (chooseId == 1000000002 && GangGroupValue.TryGetValue(812, out string eventId) && eventId == "901300001") //城主,村长,镇长,大当家 - { - EventSeries.Series3(GangGroupID);// 添加 清理宵小&剿灭邪道 - } - else - if (chooseId == 1000000002 && GangID == 15) // "血犼教" - { -// EventSeries.Series4(GangGroupID); // 添加 門派弟子互动 - } - else - if (Main.settings.moreEvents && chooseId == 1000000002 && GangID >= 1 && GangID < 15) //其他門派弟子互動 + string eventId; + if (chooseId == 1000000002) { -// EventSeries.Series4(GangGroupID); // 添加 門派弟子互动 + if (GangGroupID == 0) // "无" + { + EventSeries.Series1(GangGroupID); // 添加 相枢幻身 + } + else if (GangGroupID == 1) //"太吾村民" + { + EventSeries.Series2(GangGroupID); // 添加 剑冢再临 + } + else if (GangGroupValue.TryGetValue(812, out eventId) && eventId == "901300001") //城主,村长,镇长,大当家 + { + EventSeries.Series3(GangGroupID);// 添加 清理宵小&剿灭邪道 + } + else if (GangID == 15) // "血犼教" + { + // EventSeries.Series4(GangGroupID); // 添加 門派弟子互动 + } + else if (Main.settings.moreEvents && GangID >= 1 && GangID < 15) //其他門派弟子互動 + { + // EventSeries.Series4(GangGroupID); // 添加 門派弟子互动 + } } } diff --git a/TreasureDetector/TreasureDetector.cs b/TreasureDetector/TreasureDetector.cs index 8c4a8cc..17f7fbe 100644 --- a/TreasureDetector/TreasureDetector.cs +++ b/TreasureDetector/TreasureDetector.cs @@ -113,7 +113,10 @@ public static void Postfix(bool on, GameObject tips, ref Text ___itemMoneyText, int width = int.Parse(DateFile.instance.partWorldMapDate[partId][98]); for (int workTyp = 0; workTyp < 5; workTyp++) { - GetWorkItemDetail(worldId, partId, placeId, workTyp, out float 现有资源, out float 最大资源, out int 最高品阶, out int 最低品阶, out float 掉宝率, out float 掉极品率, out string 全部可得物品); + float 现有资源, 最大资源, 掉宝率, 掉极品率; + int 最高品阶, 最低品阶; + string 全部可得物品; + GetWorkItemDetail(worldId, partId, placeId, workTyp, out 现有资源, out 最大资源, out 最高品阶, out 最低品阶, out 掉宝率, out 掉极品率, out 全部可得物品); if (最高品阶 >= 最低品阶 && 现有资源 > 100) { ___informationMassage.text += String.Format("{0} {1}/{2}\t掉宝率{3}\t掉极品率:{4}\n\n可获物品: {5} - {6}\n\n包括:{7}\n", @@ -148,7 +151,10 @@ public static void Postfix(bool on, GameObject tips, ref Text ___itemMoneyText, List 位置 = new List { }; for (placeId = 0; placeId < num2; placeId++) { - GetWorkItemDetail(worldId, partId, placeId, workTyp, out float 现有资源, out float 最大资源, out int 高品阶, out int 低品阶, out float 掉宝率, out float 掉极品率, out string 全部可得物品); + float 现有资源, 最大资源, 掉宝率, 掉极品率; + int 高品阶, 低品阶; + string 全部可得物品; + GetWorkItemDetail(worldId, partId, placeId, workTyp, out 现有资源, out 最大资源, out 高品阶, out 低品阶, out 掉宝率, out 掉极品率, out 全部可得物品); if (Main.settings.calByDropRate) { if (掉极品率 > 最大值)