Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加对局记录写入战旗名次 #159

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion HsMod/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,8 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell
Utils.TryReportOpponent();
}
string finalResult = "未知";
if (GameMgr.Get().GetGameType() != PegasusShared.GameType.GT_BATTLEGROUNDS)
{
switch (playState)
{
case TAG_PLAYSTATE.WINNING:
Expand All @@ -1755,6 +1757,22 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell
default:
break;
}
}
else
{
switch (GameState.Get().GetFriendlySidePlayer().GetHero().GetRealTimePlayerLeaderboardPlace())
{
case 1: finalResult = "第一名"; break;
case 2: finalResult = "第二名"; break;
case 3: finalResult = "第三名"; break;
case 4: finalResult = "第四名"; break;
case 5: finalResult = "第五名"; break;
case 6: finalResult = "第六名"; break;
case 7: finalResult = "第七名"; break;
case 8: finalResult = "第八名"; break;
default: break;
}
}

string gameType = (GameMgr.Get().GetGameType() == PegasusShared.GameType.GT_RANKED) ? GameMgr.Get().GetFormatType().ToString() : GameMgr.Get().GetGameType().ToString();

Expand Down Expand Up @@ -1947,7 +1965,7 @@ public class PatchLogArchive
[HarmonyTargetMethod]
private static MethodInfo PublicLogArchiveLogPath()
{
return AccessTools.TypeByName("Log").GetMethod("get_LogsPath"); ;
return AccessTools.TypeByName("LogSessionConfig").GetMethod("get_LogSessionDirectory"); ;
}

[HarmonyPostfix]
Expand Down
8 changes: 8 additions & 0 deletions HsMod/WebPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,14 @@ public static StringBuilder MatchLogPage()
if (lineSplit[i] == "胜利") temp += $"<td style=\"color:#01FF70\">胜利</td>";
else if (lineSplit[i] == "失败") temp += $"<td style=\"color:#FF4136\">失败</td>";
else if (lineSplit[i] == "未知" || lineSplit[i] == "平局") temp += $"<td>{lineSplit[i]}</td>";
else if (lineSplit[i] == "第一名") temp += $"<td style=\"color:#01FF70\">第一名</td>";
else if (lineSplit[i] == "第二名") temp += $"<td style=\"color:#01FF70\">第二名</td>";
else if (lineSplit[i] == "第三名") temp += $"<td style=\"color:#01FF70\">第三名</td>";
else if (lineSplit[i] == "第四名") temp += $"<td style=\"color:#01FF70\">第四名</td>";
else if (lineSplit[i] == "第五名") temp += $"<td style=\"color:#FF4136\">第五名</td>";
else if (lineSplit[i] == "第六名") temp += $"<td style=\"color:#FF4136\">第六名</td>";
else if (lineSplit[i] == "第七名") temp += $"<td style=\"color:#FF4136\">第七名</td>";
else if (lineSplit[i] == "第八名") temp += $"<td style=\"color:#FF4136\">第八名</td>";
else if (int.Parse(lineSplit[i]) > 0) temp += $"<td style=\"color:#01FF70\">+{int.Parse(lineSplit[i])}</td>";
else if (int.Parse(lineSplit[i]) < 0) temp += $"<td style=\"color:#FF4136\">{lineSplit[i]}</td>";
else temp += $"<td>{lineSplit[i]}</td>";
Expand Down