Skip to content

Commit

Permalink
C#7 => C#6
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nothing committed Nov 23, 2018
1 parent bbde386 commit 0b62560
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 30 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down
2 changes: 1 addition & 1 deletion DynamicExecutor/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static bool Load(UMM.ModEntry modEntry)
{
rootPath = modEntry.Path;
Logger = modEntry.Logger;
string convert(UMM.ModEntry mod) =>
Func<UMM.ModEntry, string> convert = (mod) =>
$"\t<Reference Include=\"{mod.Info.AssemblyName.Replace(".dll", "")}\">\n" +
"\t\t<ReferenceOutputAssembly>true</ReferenceOutputAssembly>\n" +
"\t\t<Private>false</Private>\n" +
Expand Down
6 changes: 4 additions & 2 deletions NotEnoughHarvest/NotEnoughHarvest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
47 changes: 23 additions & 24 deletions TrainingRoom/TrainingRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, string> 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");
Expand All @@ -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); // 添加 門派弟子互动
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions TreasureDetector/TreasureDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("<color=#FFFF8FFF>{0}</color> {1}/<color=#FFFFFFFF>{2}</color>\t掉宝率{3}\t掉极品率:{4}\n\n可获物品: {5} - {6}\n\n<color=#add8e6ff>包括:</color>{7}\n",
Expand Down Expand Up @@ -148,7 +151,10 @@ public static void Postfix(bool on, GameObject tips, ref Text ___itemMoneyText,
List<int> 位置 = new List<int> { };
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 (掉极品率 > 最大值)
Expand Down

0 comments on commit 0b62560

Please sign in to comment.