mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Rename Mod & Fix Ghost Roles
This commit is contained in:
1 parent
e60b5bc99f
commit
6bb55c02cc
466 files changed
+1438
-1479
No files matched your search
+30
-30
@@ -1,30 +1,30 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33403.182
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TOHE", "TOHE.csproj", "{807AD310-21DA-4160-9D72-926745B02A85}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBDFE762-E378-4B3D-8BB3-3F4F13C92ADB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E968AE10-42DB-42A3-AF64-6753110729A2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33403.182
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TOHE", "TOHE.csproj", "{807AD310-21DA-4160-9D72-926745B02A85}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBDFE762-E378-4B3D-8BB3-3F4F13C92ADB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{807AD310-21DA-4160-9D72-926745B02A85}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E968AE10-42DB-42A3-AF64-6753110729A2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,4 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DLL/@EntryIndexedValue">DLL</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String></wpf:ResourceDictionary>
|
||||
@@ -1,14 +1,14 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.GameMode.HideAndSeekRoles;
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using TOHE.GameMode.HideAndSeekRoles;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE
|
||||
namespace EHR
|
||||
{
|
||||
internal static class CustomHideAndSeekManager
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using HarmonyLib;
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
internal static class FFAManager
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE.GameMode.HideAndSeekRoles
|
||||
namespace EHR.GameMode.HideAndSeekRoles
|
||||
{
|
||||
internal class Fox : RoleBase, IHideAndSeekRole
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE.GameMode.HideAndSeekRoles
|
||||
namespace EHR.GameMode.HideAndSeekRoles
|
||||
{
|
||||
internal class Hider : RoleBase, IHideAndSeekRole
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE.GameMode.HideAndSeekRoles
|
||||
namespace EHR.GameMode.HideAndSeekRoles
|
||||
{
|
||||
internal interface IHideAndSeekRole
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE.GameMode.HideAndSeekRoles
|
||||
namespace EHR.GameMode.HideAndSeekRoles
|
||||
{
|
||||
internal class Seeker : RoleBase, IHideAndSeekRole
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE.GameMode.HideAndSeekRoles
|
||||
namespace EHR.GameMode.HideAndSeekRoles
|
||||
{
|
||||
internal class Troll : RoleBase, IHideAndSeekRole
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE
|
||||
namespace EHR
|
||||
{
|
||||
internal class HotPotatoManager
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using HarmonyLib;
|
||||
using EHR.Roles.AddOns.Common;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Roles.AddOns.Common;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class Counter(int totalGreenTime, int totalRedTime, long startTimeStamp, char symbol, bool isRed, bool isYellow = false, bool moveAndStop = true)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using HarmonyLib;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.RandomSpawn;
|
||||
using static EHR.RandomSpawn;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
internal static class SoloKombatManager
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class AURoleOptions
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class AddSteamID
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Modules;
|
||||
using Hazel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TOHE.Modules;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class AntiBlackout
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public static class AntiBlackout
|
||||
|
||||
public static bool IsCached { get; private set; }
|
||||
private static Dictionary<byte, (bool isDead, bool Disconnected)> isDeadCache = [];
|
||||
private static readonly LogHandler Logger = TOHE.Logger.Handler("AntiBlackout");
|
||||
private static readonly LogHandler Logger = EHR.Logger.Handler("AntiBlackout");
|
||||
|
||||
public static void SetIsDead(bool doSend = true, [CallerMemberName] string callerMethodName = "")
|
||||
{
|
||||
|
||||
+11
-11
@@ -8,16 +8,16 @@ using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class BanManager
|
||||
{
|
||||
private static readonly string DENY_NAME_LIST_PATH = @"./TOHE_DATA/DenyName.txt";
|
||||
private static readonly string BAN_LIST_PATH = @"./TOHE_DATA/BanList.txt";
|
||||
private static readonly string MODERATOR_LIST_PATH = @"./TOHE_DATA/Moderators.txt";
|
||||
private static readonly string WHITE_LIST_LIST_PATH = @"./TOHE_DATA/WhiteList.txt";
|
||||
private static readonly string DENY_NAME_LIST_PATH = @"./EHR_DATA/DenyName.txt";
|
||||
private static readonly string BAN_LIST_PATH = @"./EHR_DATA/BanList.txt";
|
||||
private static readonly string MODERATOR_LIST_PATH = @"./EHR_DATA/Moderators.txt";
|
||||
private static readonly string WHITE_LIST_LIST_PATH = @"./EHR_DATA/WhiteList.txt";
|
||||
#pragma warning disable IDE0044 // Add readonly modifier
|
||||
private static List<string> EACList = []; // Don't make it read-only
|
||||
#pragma warning restore IDE0044 // Add readonly modifier
|
||||
@@ -27,7 +27,7 @@ public static class BanManager
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory("TOHE_DATA");
|
||||
Directory.CreateDirectory("EHR_DATA");
|
||||
|
||||
if (!File.Exists(BAN_LIST_PATH))
|
||||
{
|
||||
@@ -39,7 +39,7 @@ public static class BanManager
|
||||
{
|
||||
Logger.Warn("Create a new DenyName.txt file", "BanManager");
|
||||
File.Create(DENY_NAME_LIST_PATH).Close();
|
||||
File.WriteAllText(DENY_NAME_LIST_PATH, GetResourcesTxt("TOHE.Resources.Config.DenyName.txt"));
|
||||
File.WriteAllText(DENY_NAME_LIST_PATH, GetResourcesTxt("EHR.Resources.Config.DenyName.txt"));
|
||||
}
|
||||
|
||||
if (!File.Exists(MODERATOR_LIST_PATH))
|
||||
@@ -55,7 +55,7 @@ public static class BanManager
|
||||
}
|
||||
|
||||
// Read EAC List
|
||||
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TOHE.Resources.Config.EACList.txt");
|
||||
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EHR.Resources.Config.EACList.txt");
|
||||
stream.Position = 0;
|
||||
using StreamReader sr = new(stream, Encoding.UTF8);
|
||||
string line;
|
||||
@@ -111,7 +111,7 @@ public static class BanManager
|
||||
if (!AmongUsClient.Instance.AmHost || !Options.ApplyDenyNameList.GetBool()) return;
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory("TOHE_DATA");
|
||||
Directory.CreateDirectory("EHR_DATA");
|
||||
if (!File.Exists(DENY_NAME_LIST_PATH)) File.Create(DENY_NAME_LIST_PATH).Close();
|
||||
using StreamReader sr = new(DENY_NAME_LIST_PATH);
|
||||
string line;
|
||||
@@ -183,7 +183,7 @@ public static class BanManager
|
||||
else if (code == "") return false;
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory("TOHE_DATA");
|
||||
Directory.CreateDirectory("EHR_DATA");
|
||||
if (!File.Exists(BAN_LIST_PATH)) File.Create(BAN_LIST_PATH).Close();
|
||||
using StreamReader sr = new(BAN_LIST_PATH);
|
||||
string line;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using AmongUs.Data;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using System.Collections.Generic;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
static class PlayerOutfitExtension
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
// https://github.com/tukasa0001/TownOfHost/blob/main/Modules/VersionChecker.cs
|
||||
public static class VersionChecker
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
//来源:https://github.com/tukasa0001/TownOfHost/pull/1265
|
||||
public class ClientOptionItem
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@ using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
internal class Cloud
|
||||
{
|
||||
@@ -22,7 +22,7 @@ internal class Cloud
|
||||
{
|
||||
try
|
||||
{
|
||||
var content = GetResourcesTxt("TOHE.Resources.Config.Port.txt");
|
||||
var content = GetResourcesTxt("EHR.Resources.Config.Port.txt");
|
||||
string[] ar = content.Split('|');
|
||||
IP = ar[0];
|
||||
//LOBBY_PORT = int.Parse(ar[1]);
|
||||
@@ -95,7 +95,7 @@ internal class Cloud
|
||||
LastRepotTimeStamp = Utils.TimeStamp;
|
||||
EacClientSocket = new(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
EacClientSocket.Connect(IP, EAC_PORT);
|
||||
Logger.Warn("已连接至TOHE服务器", "EAC Cloud");
|
||||
Logger.Warn("已连接至EHR服务器", "EAC Cloud");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ internal class Cloud
|
||||
StartConnect();
|
||||
if (EacClientSocket == null || !EacClientSocket.Connected)
|
||||
{
|
||||
Logger.Warn("未连接至TOHE服务器,报告被取消", "EAC Cloud");
|
||||
Logger.Warn("未连接至EHR服务器,报告被取消", "EAC Cloud");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ internal class Cloud
|
||||
{
|
||||
LastRepotTimeStamp = 0;
|
||||
StopConnect();
|
||||
Logger.Warn("超时自动断开与TOHE服务器的连接", "EAC Cloud");
|
||||
Logger.Warn("超时自动断开与EHR服务器的连接", "EAC Cloud");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.Impostor;
|
||||
using HarmonyLib;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Roles.Impostor;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public static class ShuffleListExtension
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
/*
|
||||
* Roles that use the same code as another role:
|
||||
|
||||
@@ -5,7 +5,7 @@ using InnerNet;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class CustomRpcSender
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public static class CustomSoundsManager
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public static class CustomSoundsManager
|
||||
folder.Attributes = FileAttributes.Hidden;
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TOHE.Resources.Sounds." + sound + ".wav");
|
||||
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EHR.Resources.Sounds." + sound + ".wav");
|
||||
if (stream == null)
|
||||
{
|
||||
Logger.Warn($"声音文件缺失:{sound}", "CustomSounds");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Hazel;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class CustomWinnerHolder
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class DebugModeManager
|
||||
{
|
||||
|
||||
+3
-3
@@ -1,3 +1,4 @@
|
||||
using EHR.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -5,10 +6,9 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TOHE.Modules;
|
||||
using LogLevel = BepInEx.Logging.LogLevel;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
class Webhook
|
||||
{
|
||||
@@ -19,7 +19,7 @@ class Webhook
|
||||
Dictionary<string, string> strs = new()
|
||||
{
|
||||
{ "content", text },
|
||||
{ "username", "TOHE-Debugger" },
|
||||
{ "username", "EHR-Debugger" },
|
||||
{ "avatar_url", "https://npm.elemecdn.com/hexo-static@1.0.1/img/avatar.webp" }
|
||||
};
|
||||
TaskAwaiter<HttpResponseMessage> awaiter = httpClient.PostAsync(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class DevUser(string code = "", string color = "null", string tag = "null", bool isUp = false, bool isDev = false, bool deBug = false, bool colorCmd = false, string upName = "未认证用户")
|
||||
{
|
||||
@@ -25,7 +25,7 @@ public static class DevManager
|
||||
public static void Init()
|
||||
{
|
||||
// Dev
|
||||
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "TOHE/TONX Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
|
||||
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "EHR/TONX Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
|
||||
DevUserList.Add(new(code: "pinklaze#1776", color: "#30548e", tag: "#Dev", isUp: true, isDev: true, deBug: true, colorCmd: false, upName: "NCSIMON"));
|
||||
DevUserList.Add(new(code: "keepchirpy#6354", color: "#1FF3C6", tag: "Переводчик", isUp: true, isDev: false, deBug: false, colorCmd: true, upName: "TommyXL")); //Tommy-XL
|
||||
DevUserList.Add(new(code: "taskunsold#2701", color: "null", tag: "<color=#426798>Tem</color><color=#f6e509>mie</color>", isUp: false, isDev: true, deBug: false, colorCmd: false, upName: null)); //Tem
|
||||
@@ -68,7 +68,7 @@ public static class DevManager
|
||||
|
||||
DevUserList.Add(new(code: "radarright#2509", color: "null", tag: "null", isUp: false, isDev: false, deBug: true, colorCmd: false, upName: null));
|
||||
|
||||
// TOHE+ players
|
||||
// EHR players
|
||||
DevUserList.Add(new(code: "crustzonal#9589", color: "#00FFFF", tag: "Translator PT-BR", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "artyleague01"));
|
||||
DevUserList.Add(new(code: "tinedpun#6584", color: "#0000ff", tag: "Translator PT-BR", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "Dechis"));
|
||||
DevUserList.Add(new(code: "swiftlord#8072", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "But What About"));
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
//参考元 : https://github.com/ykundesu/SuperNewRoles/blob/master/SuperNewRoles/Mode/SuperHostRoles/BlockTool.cs
|
||||
class DisableDevice
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public static class DoorsReset
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
static class DoubleTrigger
|
||||
{
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Modules;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
internal class EAC
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class EnumHelper
|
||||
{
|
||||
|
||||
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class ErrorText : MonoBehaviour
|
||||
{
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Modules;
|
||||
using EHR.Patches;
|
||||
using EHR.Roles.AddOns.Crewmate;
|
||||
using EHR.Roles.AddOns.Impostor;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
@@ -7,18 +14,11 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Patches;
|
||||
using TOHE.Roles.AddOns.Crewmate;
|
||||
using TOHE.Roles.AddOns.Impostor;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static TOHE.Utils;
|
||||
using static EHR.Translator;
|
||||
using static EHR.Utils;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
static class ExtendedPlayerControl
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE.Modules.Extensions;
|
||||
namespace EHR.Modules.Extensions;
|
||||
|
||||
public static class IGameManagerEx
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Collections.Generic;
|
||||
using Array = Il2CppSystem.Array;
|
||||
using Buffer = Il2CppSystem.Buffer;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public abstract class GameOptionsSender
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using AmongUs.GameOptions;
|
||||
using System;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public class NormalGameOptionsSender : GameOptionsSender
|
||||
{
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using Hazel;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using InnerNet;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using Mathf = UnityEngine.Mathf;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
|
||||
{
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.AddOns.Crewmate;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using InnerNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.AddOns.Crewmate;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class PlayerState(byte playerId)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ public class PlayerState(byte playerId)
|
||||
Disconnected,
|
||||
Fall,
|
||||
|
||||
// TOHE
|
||||
// EHR
|
||||
Gambled,
|
||||
Eaten,
|
||||
Sacrifice,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using HarmonyLib;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace TOHE.Modules
|
||||
namespace EHR.Modules
|
||||
{
|
||||
internal static class GhostRolesManager
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace TOHE.Modules
|
||||
if (GhostRoles.Count > 0) return;
|
||||
GhostRoles = EnumHelper.GetAllValues<CustomRoles>().Where(x => x != CustomRoles.EvilSpirit && x.IsGhostRole() && x.IsEnable()).ToList();
|
||||
|
||||
Logger.Warn($"Ghost roles: {GhostRoles.Join()}", "GhostRoles");
|
||||
Logger.Msg($"Ghost roles: {GhostRoles.Join()}", "GhostRoles");
|
||||
Haunter.AllHauntedPlayers = [];
|
||||
}
|
||||
|
||||
@@ -49,9 +49,18 @@ namespace TOHE.Modules
|
||||
|
||||
public static bool ShouldHaveGhostRole(PlayerControl pc)
|
||||
{
|
||||
if (pc.GetCountTypes() is CountTypes.None or CountTypes.OutOfGame) return false;
|
||||
var suitableRole = GetSuitableGhostRole(pc);
|
||||
return !AssignedGhostRoles.Any(x => x.Key == pc.PlayerId || x.Value.Role == suitableRole);
|
||||
try
|
||||
{
|
||||
if (AssignedGhostRoles.Count >= GhostRoles.Count) return false;
|
||||
if (pc.IsAlive() || pc.GetCountTypes() is CountTypes.None or CountTypes.OutOfGame) return false;
|
||||
var suitableRole = GetSuitableGhostRole(pc);
|
||||
return !AssignedGhostRoles.Any(x => x.Key == pc.PlayerId || x.Value.Role == suitableRole);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Utils.ThrowException(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static CustomRoles GetSuitableGhostRole(PlayerControl pc)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
using HarmonyLib;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.AddOns.Common;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using TMPro;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.AddOns.Common;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class GuessManager
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class HashAuth(string hashValue, string salt = null, HashAlgorithm algorithm = null)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
class LateTask
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Rewired.Utils;
|
||||
using EHR.Patches;
|
||||
using Rewired.Utils;
|
||||
using System;
|
||||
using TOHE.Patches;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE.Modules
|
||||
namespace EHR.Modules
|
||||
{
|
||||
internal class LoadingScreen
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace TOHE.Modules
|
||||
if (!LoadingAnimation.IsNullOrDestroyed()) Object.Destroy(LoadingAnimation);
|
||||
|
||||
LoadingAnimation = Object.Instantiate(ModManager.Instance.ModStamp);
|
||||
LoadingAnimation.sprite = Utils.LoadSprite("TOHE.Resources.Loading.png", 300f);
|
||||
LoadingAnimation.sprite = Utils.LoadSprite("EHR.Resources.Loading.png", 300f);
|
||||
|
||||
var basePos = LoadingAnimation.transform.position;
|
||||
var x = basePos.x - 9.5f;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
static class LocateArrow
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public interface ILogHandler
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
class LogHandler(string tag) : ILogHandler
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using System;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public class MeetingTimeManager
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using InnerNet;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public interface ICustomWriter
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Hazel;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using InnerNet;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class WriterProxy(MessageWriter writer) : ICustomWriter
|
||||
{
|
||||
|
||||
+46
-73
@@ -8,15 +8,15 @@ using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Twitch;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch]
|
||||
public class ModUpdater
|
||||
{
|
||||
private static readonly string URL_Github = "https://api.github.com/repos/Gurge44/TOHE_PLUS";
|
||||
private const string URLGithub = "https://api.github.com/repos/Gurge44/EndlessHostRoles";
|
||||
public static bool hasUpdate;
|
||||
public static bool hasOutdate;
|
||||
public static bool forceUpdate = false;
|
||||
@@ -50,7 +50,7 @@ public class ModUpdater
|
||||
|
||||
public static string Get(string url)
|
||||
{
|
||||
string result = "";
|
||||
string result;
|
||||
HttpClient req = new();
|
||||
var res = req.GetAsync(url).Result;
|
||||
Stream stream = res.Content.ReadAsStreamAsync().Result;
|
||||
@@ -70,15 +70,15 @@ public class ModUpdater
|
||||
public static async Task<bool> CheckReleaseFromGithub(bool beta = false)
|
||||
{
|
||||
Logger.Warn("Checking GitHub Release", "CheckRelease");
|
||||
string url = URL_Github + "/releases/latest";
|
||||
const string url = URLGithub + "/releases/latest";
|
||||
try
|
||||
{
|
||||
string result;
|
||||
using (HttpClient client = new())
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("User-Agent", "TOHE+ Updater");
|
||||
client.DefaultRequestHeaders.Add("User-Agent", "EHR Updater");
|
||||
using var response = await client.GetAsync(new Uri(url), HttpCompletionOption.ResponseContentRead);
|
||||
if (!response.IsSuccessStatusCode || response.Content == null)
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
Logger.Error($"Response Status Code: {response.StatusCode}", "CheckRelease");
|
||||
return false;
|
||||
@@ -96,13 +96,12 @@ public class ModUpdater
|
||||
}
|
||||
else
|
||||
{
|
||||
latestVersion = new(data["tag_name"]?.ToString().TrimStart('v'));
|
||||
latestVersion = new(data["tag_name"]?.ToString().TrimStart('v') ?? string.Empty);
|
||||
latestTitle = $"Ver. {latestVersion}";
|
||||
JArray assets = data["assets"].Cast<JArray>();
|
||||
//Logger.Info(assets.ToString(), "ModUpdater");
|
||||
for (int i = 0; i < assets.Count; i++)
|
||||
{
|
||||
if (assets[i]["name"].ToString() == $"TOHE-PLUS.v{latestVersion}.zip")
|
||||
if (assets[i]["name"].ToString() == $"EHR.v{latestVersion}.zip")
|
||||
{
|
||||
downloadUrl = assets[i]["browser_download_url"].ToString();
|
||||
break;
|
||||
@@ -120,7 +119,7 @@ public class ModUpdater
|
||||
Logger.Info("latestVersionl: " + latestVersion, "GitHub");
|
||||
Logger.Info("latestTitle: " + latestTitle, "GitHub");
|
||||
|
||||
if (downloadUrl == null || downloadUrl == "")
|
||||
if (string.IsNullOrEmpty(downloadUrl))
|
||||
{
|
||||
Logger.Error("No Download URL", "CheckRelease");
|
||||
return false;
|
||||
@@ -142,22 +141,14 @@ public class ModUpdater
|
||||
public static void StartUpdate(string url, bool github)
|
||||
{
|
||||
ShowPopup(GetString("updatePleaseWait"), StringNames.Cancel, true, false);
|
||||
if (!github)
|
||||
{
|
||||
_ = DownloadDLL(url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = DownloadDLLGithub(url);
|
||||
}
|
||||
_ = !github ? DownloadDLL(url) : DownloadDLLGithub(url);
|
||||
}
|
||||
|
||||
public static bool NewVersionCheck()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fileName = Assembly.GetExecutingAssembly().Location;
|
||||
if (Directory.Exists("TOH_DATA") && File.Exists(@"./TOHE_DATA/BanWords.txt"))
|
||||
if (Directory.Exists("TOH_DATA") && File.Exists("./EHR_DATA/BanWords.txt"))
|
||||
{
|
||||
DirectoryInfo di = new("TOH_DATA");
|
||||
di.Delete(true);
|
||||
@@ -176,32 +167,33 @@ public class ModUpdater
|
||||
public static void DeleteOldFiles()
|
||||
{
|
||||
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
string searchPattern = "TOHE+.dll*";
|
||||
string[] files = Directory.GetFiles(path, searchPattern);
|
||||
try
|
||||
const string searchPattern = "EHR.dll*";
|
||||
if (path != null)
|
||||
{
|
||||
foreach (string filePath in files)
|
||||
string[] files = Directory.GetFiles(path, searchPattern);
|
||||
try
|
||||
{
|
||||
if (Path.GetFileName(filePath).EndsWith(".bak") || Path.GetFileName(filePath).EndsWith(".temp"))
|
||||
foreach (string filePath in files)
|
||||
{
|
||||
Logger.Info($"{filePath} will be deleted", "DeleteOldFiles");
|
||||
File.Delete(filePath);
|
||||
if (Path.GetFileName(filePath).EndsWith(".bak") || Path.GetFileName(filePath).EndsWith(".temp"))
|
||||
{
|
||||
Logger.Info($"{filePath} will be deleted", "DeleteOldFiles");
|
||||
File.Delete(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error($"Failed to clear update residue\n{e}", "DeleteOldFiles");
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error($"Failed to clear update residue\n{e}", "DeleteOldFiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly object downloadLock = new();
|
||||
|
||||
public static async Task<bool> DownloadDLL(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
var savePath = "BepInEx/plugins/TOHE+.dll.temp";
|
||||
const string savePath = "BepInEx/plugins/EHR.dll.temp";
|
||||
|
||||
// Delete the temporary file if it exists
|
||||
if (File.Exists(savePath))
|
||||
@@ -210,39 +202,26 @@ public class ModUpdater
|
||||
}
|
||||
|
||||
HttpResponseMessage response;
|
||||
var downloadCallBack = DownloadCallBack;
|
||||
|
||||
using (HttpClient client = new())
|
||||
{
|
||||
response = await client.GetAsync(url);
|
||||
}
|
||||
|
||||
if (response == null || !response.IsSuccessStatusCode)
|
||||
if (response is not { IsSuccessStatusCode: true })
|
||||
{
|
||||
throw new($"File retrieval failed with status code: {response?.StatusCode}");
|
||||
throw new($"File retrieval failed with status code: {response.StatusCode}");
|
||||
}
|
||||
|
||||
var total = response.Content.Headers.ContentLength ?? 0;
|
||||
using (var stream = await response.Content.ReadAsStreamAsync())
|
||||
using (var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true))
|
||||
await using (var stream = await response.Content.ReadAsStreamAsync())
|
||||
await using (var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true))
|
||||
{
|
||||
if (downloadCallBack == null)
|
||||
{
|
||||
await stream.CopyToAsync(fileStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] buffer = new byte[1024];
|
||||
long readLength = 0;
|
||||
int length;
|
||||
byte[] buffer = new byte[1024];
|
||||
int length;
|
||||
|
||||
while ((length = await stream.ReadAsync(buffer)) != 0)
|
||||
{
|
||||
await fileStream.WriteAsync(buffer.AsMemory(0, length));
|
||||
|
||||
readLength += length;
|
||||
double? progress = Math.Round((double)readLength / total * 100, 2, MidpointRounding.ToZero);
|
||||
}
|
||||
while ((length = await stream.ReadAsync(buffer)) != 0)
|
||||
{
|
||||
await fileStream.WriteAsync(buffer.AsMemory(0, length));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +244,7 @@ public class ModUpdater
|
||||
{
|
||||
try
|
||||
{
|
||||
var savePath = "BepInEx/plugins/TOHE+.dll.temp";
|
||||
const string savePath = "BepInEx/plugins/EHR.dll.temp";
|
||||
|
||||
// Delete the temporary file if it exists
|
||||
if (File.Exists(savePath))
|
||||
@@ -274,29 +253,27 @@ public class ModUpdater
|
||||
}
|
||||
|
||||
HttpResponseMessage response;
|
||||
var downloadCallBack = DownloadCallBack;
|
||||
|
||||
using (HttpClient client = new())
|
||||
{
|
||||
response = await client.GetAsync(url);
|
||||
}
|
||||
|
||||
if (response == null || !response.IsSuccessStatusCode)
|
||||
if (response is not { IsSuccessStatusCode: true })
|
||||
{
|
||||
throw new($"File retrieval failed with status code: {response?.StatusCode}");
|
||||
throw new($"File retrieval failed with status code: {response.StatusCode}");
|
||||
}
|
||||
|
||||
var total = response.Content.Headers.ContentLength ?? 0;
|
||||
using (var stream = await response.Content.ReadAsStreamAsync())
|
||||
await using (var stream = await response.Content.ReadAsStreamAsync())
|
||||
using (var archive = new ZipArchive(stream, ZipArchiveMode.Read))
|
||||
{
|
||||
// Specify the relative path within the ZIP archive where "TOHE+.dll" is located
|
||||
var entryPath = "BepInEx/plugins/TOHE+.dll";
|
||||
// Specify the relative path within the ZIP archive where "EHR.dll" is located
|
||||
const string entryPath = "BepInEx/plugins/EHR.dll";
|
||||
var entry = archive.GetEntry(entryPath) ?? throw new($"'{entryPath}' not found in the ZIP archive");
|
||||
|
||||
// Extract "TOHE+.dll" to the temporary file
|
||||
using var entryStream = entry.Open();
|
||||
using var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true);
|
||||
// Extract "EHR.dll" to the temporary file
|
||||
await using var entryStream = entry.Open();
|
||||
await using var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true);
|
||||
await entryStream.CopyToAsync(fileStream);
|
||||
}
|
||||
|
||||
@@ -315,10 +292,6 @@ public class ModUpdater
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void DownloadCallBack(long total, long downloaded, double progress)
|
||||
{
|
||||
}
|
||||
|
||||
public static void ShowPopup(string message, StringNames buttonText, bool showButton = false, bool buttonIsExit = true)
|
||||
{
|
||||
if (InfoPopup == null) return;
|
||||
@@ -331,7 +304,7 @@ public class ModUpdater
|
||||
button.GetChild(0).GetComponent<TextTranslatorTMP>().TargetText = buttonText;
|
||||
button.GetChild(0).GetComponent<TextTranslatorTMP>().ResetText();
|
||||
button.GetComponent<PassiveButton>().OnClick = new();
|
||||
if (buttonIsExit) button.GetComponent<PassiveButton>().OnClick.AddListener((Action)(() => Application.Quit()));
|
||||
if (buttonIsExit) button.GetComponent<PassiveButton>().OnClick.AddListener((Action)Application.Quit);
|
||||
else button.GetComponent<PassiveButton>().OnClick.AddListener((Action)(() => InfoPopup.Close()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
using System;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.AddOns.Common;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using Hazel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.AddOns.Common;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class NameColorManager
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Hazel;
|
||||
using EHR.Modules;
|
||||
using Hazel;
|
||||
using System.Collections.Generic;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class NameNotifyManager
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class OptionBackupData
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using AmongUs.GameOptions;
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public abstract class OptionBackupValue
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.AddOns;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -5,11 +7,9 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.AddOns;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[Flags]
|
||||
public enum CustomGameMode
|
||||
@@ -1237,7 +1237,7 @@ public static class Options
|
||||
|
||||
#region TOHESettings
|
||||
|
||||
MainLoadingText = "Building TOHE settings";
|
||||
MainLoadingText = "Building EHR settings";
|
||||
|
||||
KickLowLevelPlayer = IntegerOptionItem.Create(19300, "KickLowLevelPlayer", new(0, 100, 1), 0, TabGroup.SystemSettings, false)
|
||||
.SetValueFormat(OptionFormat.Level)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class BooleanOptionItem(int id, string name, bool defaultValue, TabGroup tab, bool isSingleValue) : OptionItem(id, name, defaultValue ? 1 : 0, tab, isSingleValue)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class FloatOptionItem(int id, string name, float defaultValue, TabGroup tab, bool isSingleValue, FloatValueRule rule) : OptionItem(id, name, rule.GetNearestIndex(defaultValue), tab, isSingleValue)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class IntegerOptionItem(int id, string name, int defaultValue, TabGroup tab, bool isSingleValue, IntegerValueRule rule) : OptionItem(id, name, rule.GetNearestIndex(defaultValue), tab, isSingleValue)
|
||||
{
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
using EHR.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public abstract class OptionItem
|
||||
{
|
||||
#region static
|
||||
|
||||
public static IReadOnlyList<OptionItem> AllOptions => _allOptions;
|
||||
private static readonly List<OptionItem> _allOptions = new(1024);
|
||||
public static IReadOnlyDictionary<int, OptionItem> FastOptions => _fastOptions;
|
||||
private static readonly Dictionary<int, OptionItem> _fastOptions = new(1024);
|
||||
public static int CurrentPreset { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// 必須情報 (コンストラクタで必ず設定させる必要がある値)
|
||||
@@ -30,6 +32,7 @@ public abstract class OptionItem
|
||||
public bool IsHeader { get; protected set; }
|
||||
public bool IsHidden { get; protected set; }
|
||||
public bool IsText { get; protected set; }
|
||||
|
||||
public Dictionary<string, string> ReplacementDictionary
|
||||
{
|
||||
get => _replacementDictionary;
|
||||
@@ -39,14 +42,17 @@ public abstract class OptionItem
|
||||
else _replacementDictionary = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _replacementDictionary;
|
||||
|
||||
public int[] AllValues { get; private set; } = new int[NumPresets];
|
||||
|
||||
public int CurrentValue
|
||||
{
|
||||
get => GetValue();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
public int SingleValue { get; private set; }
|
||||
|
||||
// 親子情報
|
||||
@@ -133,10 +139,13 @@ public abstract class OptionItem
|
||||
ReplacementDictionary.TryAdd(roleName, Utils.ColorString(Utils.GetRoleColor(role.Key), roleName));
|
||||
break;
|
||||
}
|
||||
|
||||
i.Parent = parent;
|
||||
parent.SetChild(i);
|
||||
});
|
||||
|
||||
public OptionItem SetChild(OptionItem child) => Do(i => i.Children.Add(child));
|
||||
|
||||
public OptionItem RegisterUpdateValueEvent(EventHandler<UpdateValueEventArgs> handler)
|
||||
=> Do(i => UpdateValueEvent += handler);
|
||||
|
||||
@@ -147,23 +156,25 @@ public abstract class OptionItem
|
||||
ReplacementDictionary ??= [];
|
||||
ReplacementDictionary.Add(kvp.key, kvp.value);
|
||||
});
|
||||
|
||||
public OptionItem RemoveReplacement(string key)
|
||||
=> Do(i => ReplacementDictionary?.Remove(key));
|
||||
|
||||
// Getter
|
||||
public virtual string GetName(bool disableColor = false, bool console = false)
|
||||
{
|
||||
return disableColor ?
|
||||
Translator.GetString(Name, ReplacementDictionary, console) :
|
||||
Utils.ColorString(NameColor, Translator.GetString(Name, ReplacementDictionary));
|
||||
return disableColor ? Translator.GetString(Name, ReplacementDictionary, console) : Utils.ColorString(NameColor, Translator.GetString(Name, ReplacementDictionary));
|
||||
}
|
||||
|
||||
public virtual bool GetBool() => CurrentValue != 0 && (Parent == null || Parent.GetBool());
|
||||
public virtual int GetInt() => CurrentValue;
|
||||
public virtual float GetFloat() => CurrentValue;
|
||||
|
||||
public virtual string GetString()
|
||||
{
|
||||
return ApplyFormat(CurrentValue.ToString());
|
||||
}
|
||||
|
||||
public virtual int GetValue() => IsSingleValue ? SingleValue : AllValues[CurrentPreset];
|
||||
|
||||
// 旧IsHidden関数
|
||||
@@ -188,6 +199,7 @@ public abstract class OptionItem
|
||||
opt.oldValue = opt.Value = CurrentValue;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetValue(int afterValue, bool doSave, bool doSync = true)
|
||||
{
|
||||
int beforeValue = CurrentValue;
|
||||
@@ -206,15 +218,18 @@ public abstract class OptionItem
|
||||
{
|
||||
SyncAllOptions();
|
||||
}
|
||||
|
||||
if (doSave)
|
||||
{
|
||||
OptionSaver.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetValue(int afterValue, bool doSync = true)
|
||||
{
|
||||
SetValue(afterValue, true, doSync);
|
||||
}
|
||||
|
||||
public void SetAllValues(int[] values)
|
||||
{
|
||||
AllValues = values;
|
||||
@@ -223,6 +238,7 @@ public abstract class OptionItem
|
||||
// 演算子オーバーロード
|
||||
public static OptionItem operator ++(OptionItem item)
|
||||
=> item.Do(item => item.SetValue(item.CurrentValue + 1));
|
||||
|
||||
public static OptionItem operator --(OptionItem item)
|
||||
=> item.Do(item => item.SetValue(item.CurrentValue - 1));
|
||||
|
||||
@@ -238,6 +254,7 @@ public abstract class OptionItem
|
||||
|
||||
SyncAllOptions();
|
||||
}
|
||||
|
||||
public static void SyncAllOptions(int targetId = -1)
|
||||
{
|
||||
if (
|
||||
@@ -286,6 +303,7 @@ public enum TabGroup
|
||||
Addons,
|
||||
OtherRoles
|
||||
}
|
||||
|
||||
public enum OptionFormat
|
||||
{
|
||||
None,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class PresetOptionItem(int defaultValue, TabGroup tab) : OptionItem(0, "Preset", defaultValue, tab, true)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class StringOptionItem(int id, string name, int defaultValue, TabGroup tab, bool isSingleValue, string[] selections) : OptionItem(id, name, defaultValue, tab, isSingleValue)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ public class StringOptionItem(int id, string name, int defaultValue, TabGroup ta
|
||||
//For 0% or 100%
|
||||
if (Selections.Length == 2) return CurrentValue * 100;
|
||||
|
||||
//TOHE’s career generation mode
|
||||
//EHR’s career generation mode
|
||||
if (Selections.Length == 3) return CurrentValue;
|
||||
|
||||
//For 0% to 100% or 5% to 100%
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class TextOptionItem : OptionItem
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public abstract class ValueRule<T>(T minValue, T maxValue, T step)
|
||||
{
|
||||
|
||||
@@ -3,12 +3,12 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
// https://github.com/tukasa0001/TownOfHost/blob/main/Modules/OptionSaver.cs
|
||||
public static class OptionSaver
|
||||
{
|
||||
private static readonly DirectoryInfo SaveDataDirectoryInfo = new("./TOHE_DATA/SaveData/");
|
||||
private static readonly DirectoryInfo SaveDataDirectoryInfo = new("./EHR_DATA/SaveData/");
|
||||
private static readonly FileInfo OptionSaverFileInfo = new($"{SaveDataDirectoryInfo.FullName}/Options.json");
|
||||
private static readonly LogHandler logger = Logger.Handler(nameof(OptionSaver));
|
||||
private static readonly FileInfo DefaultPresetFileInfo = new($"{SaveDataDirectoryInfo.FullName}/DefaultPreset.txt");
|
||||
|
||||
@@ -2,9 +2,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class OptionShower
|
||||
{
|
||||
|
||||
+8
-8
@@ -1,4 +1,9 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.AddOns.Crewmate;
|
||||
using EHR.Roles.AddOns.Impostor;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
@@ -6,14 +11,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TOHE.Roles.AddOns.Crewmate;
|
||||
using TOHE.Roles.AddOns.Impostor;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE.Modules;
|
||||
namespace EHR.Modules;
|
||||
|
||||
public enum CustomRPC
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public enum CustomRPC
|
||||
SetEvilTrackerTarget,
|
||||
SetRealKiller,
|
||||
|
||||
// TOHE
|
||||
// EHR
|
||||
AntiBlackout,
|
||||
PlayCustomSound,
|
||||
SetKillTimer,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma warning disable CA1822
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class HashRandomWrapper : IRandom
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public interface IRandom
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class MersenneTwister : IRandom
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class NetRandomWrapper(Random instance) : IRandom
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class Xorshift(uint seed) : IRandom
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE.Modules
|
||||
namespace EHR.Modules
|
||||
{
|
||||
// https://github.com/Rabek009/MoreGamemodes
|
||||
internal static class RoleBasisChanger
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class ServerAddManager
|
||||
{
|
||||
|
||||
@@ -5,13 +5,13 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class SpamManager
|
||||
{
|
||||
private static readonly string BANEDWORDS_FILE_PATH = "./TOHE_DATA/BanWords.txt";
|
||||
private static readonly string BANEDWORDS_FILE_PATH = "./EHR_DATA/BanWords.txt";
|
||||
public static List<string> BanWords = [];
|
||||
public static void Init()
|
||||
{
|
||||
@@ -24,7 +24,7 @@ public static class SpamManager
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(@"TOHE_DATA")) Directory.CreateDirectory(@"TOHE_DATA");
|
||||
if (!Directory.Exists(@"EHR_DATA")) Directory.CreateDirectory(@"EHR_DATA");
|
||||
if (File.Exists(@"./BanWords.txt")) File.Move(@"./BanWords.txt", BANEDWORDS_FILE_PATH);
|
||||
else
|
||||
{
|
||||
@@ -39,7 +39,7 @@ public static class SpamManager
|
||||
};
|
||||
else fileName = "English";
|
||||
Logger.Warn($"创建新的 BanWords 文件:{fileName}", "SpamManager");
|
||||
File.WriteAllText(BANEDWORDS_FILE_PATH, GetResourcesTxt($"TOHE.Resources.Config.BanWords.{fileName}.txt"));
|
||||
File.WriteAllText(BANEDWORDS_FILE_PATH, GetResourcesTxt($"EHR.Resources.Config.BanWords.{fileName}.txt"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
static class TargetArrow
|
||||
{
|
||||
|
||||
@@ -10,13 +10,13 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class TemplateManager
|
||||
{
|
||||
private static readonly string TEMPLATE_FILE_PATH = "./TOHE_DATA/template.txt";
|
||||
private static readonly string TEMPLATE_FILE_PATH = "./EHR_DATA/template.txt";
|
||||
|
||||
private static readonly Dictionary<string, Func<string>> _replaceDictionary = new()
|
||||
{
|
||||
@@ -52,7 +52,7 @@ public static class TemplateManager
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(@"TOHE_DATA")) Directory.CreateDirectory(@"TOHE_DATA");
|
||||
if (!Directory.Exists(@"EHR_DATA")) Directory.CreateDirectory(@"EHR_DATA");
|
||||
if (File.Exists(@"./template.txt")) File.Move(@"./template.txt", TEMPLATE_FILE_PATH);
|
||||
else
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public static class TemplateManager
|
||||
};
|
||||
else fileName = "English";
|
||||
Logger.Warn($"创建新的 Template 文件:{fileName}", "TemplateManager");
|
||||
File.WriteAllText(TEMPLATE_FILE_PATH, GetResourcesTxt($"TOHE.Resources.Config.template.{fileName}.txt"));
|
||||
File.WriteAllText(TEMPLATE_FILE_PATH, GetResourcesTxt($"EHR.Resources.Config.template.{fileName}.txt"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using Object = Il2CppSystem.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public static class Translator
|
||||
{
|
||||
@@ -29,8 +29,8 @@ public static class Translator
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get the directory containing the JSON files (e.g., TOHE.Resources.Lang)
|
||||
string jsonDirectory = "TOHE.Resources.Lang";
|
||||
// Get the directory containing the JSON files (e.g., EHR.Resources.Lang)
|
||||
string jsonDirectory = "EHR.Resources.Lang";
|
||||
// Get the assembly containing the resources
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
string[] jsonFileNames = GetJsonFileNames(assembly, jsonDirectory);
|
||||
|
||||
+28
-46
@@ -1,5 +1,15 @@
|
||||
using AmongUs.Data;
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Modules;
|
||||
using EHR.Patches;
|
||||
using EHR.Roles.AddOns.Common;
|
||||
using EHR.Roles.AddOns.Crewmate;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using EHR.Roles.AddOns.Impostor;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using Il2CppInterop.Runtime.InteropTypes;
|
||||
using InnerNet;
|
||||
@@ -12,21 +22,11 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Patches;
|
||||
using TOHE.Roles.AddOns.Common;
|
||||
using TOHE.Roles.AddOns.Crewmate;
|
||||
using TOHE.Roles.AddOns.Impostor;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
using Object = UnityEngine.Object;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
/*
|
||||
List of symbols that work in game
|
||||
@@ -100,30 +100,13 @@ public static class Utils
|
||||
return false;
|
||||
}
|
||||
|
||||
var newSidForHost = (ushort)(nt.lastSequenceId + 20);
|
||||
var newSidForLocal = (ushort)(nt.lastSequenceId + 18);
|
||||
var newSidForGlobal = (ushort)(nt.lastSequenceId + 26);
|
||||
if (AmongUsClient.Instance.AmClient) nt.SnapTo(location, (ushort)(nt.lastSequenceId + 128));
|
||||
|
||||
// Host side
|
||||
if (AmongUsClient.Instance.AmHost)
|
||||
{
|
||||
nt.SnapTo(location, newSidForHost);
|
||||
}
|
||||
|
||||
if (PlayerControl.LocalPlayer.PlayerId != pc.PlayerId)
|
||||
{
|
||||
// Local Teleport For Client
|
||||
MessageWriter localMessageWriter = AmongUsClient.Instance.StartRpcImmediately(nt.NetId, (byte)RpcCalls.SnapTo, SendOption.Reliable, pc.GetClientId());
|
||||
NetHelpers.WriteVector2(location, localMessageWriter);
|
||||
localMessageWriter.Write(newSidForLocal);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(localMessageWriter);
|
||||
}
|
||||
|
||||
// Global Teleport
|
||||
MessageWriter globalMessageWriter = AmongUsClient.Instance.StartRpcImmediately(nt.NetId, (byte)RpcCalls.SnapTo, SendOption.Reliable);
|
||||
NetHelpers.WriteVector2(location, globalMessageWriter);
|
||||
globalMessageWriter.Write(newSidForGlobal);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(globalMessageWriter);
|
||||
ushort newSid = (ushort)(nt.lastSequenceId + 2);
|
||||
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(nt.NetId, (byte)RpcCalls.SnapTo, SendOption.Reliable);
|
||||
NetHelpers.WriteVector2(location, messageWriter);
|
||||
messageWriter.Write(newSid);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
|
||||
|
||||
if (log) Logger.Info($"{pc.GetNameWithRole().RemoveHtmlTags()} => {location}", "TP");
|
||||
return true;
|
||||
@@ -670,12 +653,6 @@ public static class Utils
|
||||
|
||||
foreach (CustomRoles subRole in States.SubRoles)
|
||||
{
|
||||
if (subRole.IsGhostRole() && subRole != CustomRoles.EvilSpirit)
|
||||
{
|
||||
hasTasks = true;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (subRole)
|
||||
{
|
||||
case CustomRoles.Madmate:
|
||||
@@ -690,16 +667,21 @@ public static class Utils
|
||||
case CustomRoles.Bloodlust:
|
||||
hasTasks = false;
|
||||
break;
|
||||
default:
|
||||
if (subRole.IsGhostRole()) hasTasks = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (CopyCat.playerIdList.Contains(p.PlayerId) && ForRecompute && (!Options.UsePets.GetBool() || CopyCat.UsePet.GetBool())) hasTasks = false;
|
||||
|
||||
if (!hasTasks && role.UsesPetInsteadOfKill()) hasTasks = true;
|
||||
hasTasks |= role.UsesPetInsteadOfKill();
|
||||
|
||||
return hasTasks;
|
||||
}
|
||||
|
||||
public static int TotalTaskCount => Main.RealOptionsData.GetInt(Int32OptionNames.NumCommonTasks) + Main.RealOptionsData.GetInt(Int32OptionNames.NumLongTasks) + Main.RealOptionsData.GetInt(Int32OptionNames.NumShortTasks);
|
||||
|
||||
public static IGhostRole CreateGhostRoleInstance(CustomRoles ghostRole)
|
||||
{
|
||||
var ghostRoleClass = Assembly.GetExecutingAssembly().GetTypes().First(x => typeof(IGhostRole).IsAssignableFrom(x) && !x.IsInterface && x.Name == $"{ghostRole}");
|
||||
@@ -1667,7 +1649,7 @@ public static class Utils
|
||||
{
|
||||
name = Options.GetSuffixMode() switch
|
||||
{
|
||||
SuffixModes.TOHE => name + $"\r\n<color={Main.ModColor}>TOHE+ v{Main.PluginDisplayVersion}</color>",
|
||||
SuffixModes.EHR => name + $"\r\n<color={Main.ModColor}>EHR v{Main.PluginDisplayVersion}</color>",
|
||||
SuffixModes.Streaming => name + $"\r\n<size=1.7><color={Main.ModColor}>{GetString("SuffixMode.Streaming")}</color></size>",
|
||||
SuffixModes.Recording => name + $"\r\n<size=1.7><color={Main.ModColor}>{GetString("SuffixMode.Recording")}</color></size>",
|
||||
SuffixModes.RoomHost => name + $"\r\n<size=1.7><color={Main.ModColor}>{GetString("SuffixMode.RoomHost")}</color></size>",
|
||||
@@ -2611,15 +2593,15 @@ public static class Utils
|
||||
|
||||
public static void DumpLog(bool open = true)
|
||||
{
|
||||
string f = $"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}/TOHE+_Logs/";
|
||||
string f = $"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}/EHR_Logs/";
|
||||
string t = DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss");
|
||||
string filename = $"{f}TOHE-v{Main.PluginVersion}-{t}.log";
|
||||
string filename = $"{f}EHR-v{Main.PluginVersion}-{t}.log";
|
||||
if (!Directory.Exists(f)) Directory.CreateDirectory(f);
|
||||
FileInfo file = new($"{Environment.CurrentDirectory}/BepInEx/LogOutput.log");
|
||||
file.CopyTo(filename);
|
||||
if (!open) return;
|
||||
if (PlayerControl.LocalPlayer != null)
|
||||
HudManager.Instance?.Chat?.AddChat(PlayerControl.LocalPlayer, string.Format(GetString("Message.DumpfileSaved"), $"TOHE+ v{Main.PluginVersion} {t}.log"));
|
||||
HudManager.Instance?.Chat?.AddChat(PlayerControl.LocalPlayer, string.Format(GetString("Message.DumpfileSaved"), $"EHR v{Main.PluginVersion} {t}.log"));
|
||||
ProcessStartInfo psi = new("Explorer.exe")
|
||||
{ Arguments = "/e,/select," + filename.Replace("/", "\\") };
|
||||
Process.Start(psi);
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
// 来源:https://github.com/tugaru1975/TownOfPlus/TOPmods/Zoom.cs
|
||||
// 参考:https://github.com/Yumenopai/TownOfHost_Y
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
public class AirshipElectricalDoors
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
//参考元:https://github.com/yukieiji/ExtremeRoles/blob/master/ExtremeRoles/Patches/AirshipStatusPatch.cs
|
||||
[HarmonyPatch(typeof(AirshipStatus), nameof(AirshipStatus.PrespawnStep))]
|
||||
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
// ##https://github.com/Yumenopai/TownOfHost_Y
|
||||
public class ModNews
|
||||
@@ -46,14 +46,14 @@ public class ModNewsHistory
|
||||
{
|
||||
// When creating new news, you can not delete old news
|
||||
{
|
||||
// TOHE v2.4.3
|
||||
// EHR v2.4.3
|
||||
var news = new ModNews
|
||||
{
|
||||
Number = 100001,
|
||||
Title = "TownOfHostEdited v2.5.0",
|
||||
SubTitle = "★★★★Another big update, maybe bigger?★★★★",
|
||||
ShortTitle = "★TOHE v2.5.0",
|
||||
Text = "<size=150%>Welcome to TOHE v2.5.0.</size>\n\n<size=125%>Support for Among Us v2023.7.11 and v2023.7.12</size>\n"
|
||||
ShortTitle = "★EHR v2.5.0",
|
||||
Text = "<size=150%>Welcome to EHR v2.5.0.</size>\n\n<size=125%>Support for Among Us v2023.7.11 and v2023.7.12</size>\n"
|
||||
+ "\n【Base】\n - Base on TOH v4.1.2\r\n"
|
||||
+ "\n【Fixes】\n - Various bug fixes\n\r"
|
||||
+ "\n【Changes】\n - Hex Master hex icon changed to separate it from Spellcaster\n - Fortune Teller moved to Experimentals due to a planned and unfinished rework\n\r"
|
||||
@@ -66,13 +66,13 @@ public class ModNewsHistory
|
||||
}
|
||||
|
||||
{
|
||||
// TOHE v2.4.2
|
||||
// EHR v2.4.2
|
||||
var news = new ModNews
|
||||
{
|
||||
Number = 100000,
|
||||
Title = "TownOfHostEdited v2.4.2",
|
||||
SubTitle = "★★★★Ooooh bigger update★★★★",
|
||||
ShortTitle = "★TOHE v2.4.2",
|
||||
ShortTitle = "★EHR v2.4.2",
|
||||
Text = "Added in some new stuff, along with some bug fixes.\r\nAmong Us v2023.3.28 is recommended so the roles work correctly.\n"
|
||||
+ "\n【Base】\n - Base on TOH v4.1.2\r\n"
|
||||
+ "\n【Fixes】\n - Fixed various black screen bugs (some still exist but should be less common)\r\n - Other various bug fixes (they're hard to keep track of)\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE.Patches;
|
||||
namespace EHR.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(ChatBubble), nameof(ChatBubble.SetRight))]
|
||||
class ChatBubbleSetRightPatch
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Assets.CoreScripts;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using System;
|
||||
@@ -7,14 +10,11 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))]
|
||||
internal class ChatCommands
|
||||
@@ -23,7 +23,7 @@ internal class ChatCommands
|
||||
public static bool IsPlayerModerator(string friendCode)
|
||||
{
|
||||
if (friendCode == "" || friendCode == string.Empty || !Options.ApplyModeratorList.GetBool()) return false;
|
||||
const string friendCodesFilePath = "./TOHE_DATA/Moderators.txt";
|
||||
const string friendCodesFilePath = "./EHR_DATA/Moderators.txt";
|
||||
var friendCodes = File.ReadAllLines(friendCodesFilePath);
|
||||
return friendCodes.Any(code => code.Contains(friendCode, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
@@ -1437,7 +1437,7 @@ internal class UpdateCharCountPatch
|
||||
public static void Postfix(FreeChatInputField __instance)
|
||||
{
|
||||
int length = __instance.textArea.text.Length;
|
||||
__instance.charCountText.SetText(length <= 0 ? "Thank you for using TOHE+!" : $"{length}/{__instance.textArea.characterLimit}");
|
||||
__instance.charCountText.SetText(length <= 0 ? "Thank you for using EHR!" : $"{length}/{__instance.textArea.characterLimit}");
|
||||
__instance.charCountText.enableWordWrapping = false;
|
||||
if (length < (AmongUsClient.Instance.AmHost ? 1700 : 250))
|
||||
__instance.charCountText.color = Color.black;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using AmongUs.Data;
|
||||
using EHR.Roles.Impostor;
|
||||
using HarmonyLib;
|
||||
using InnerNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using TOHE.Roles.Impostor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(ChatController), nameof(ChatController.Update))]
|
||||
class ChatControllerUpdatePatch
|
||||
@@ -34,13 +33,13 @@ class ChatControllerUpdatePatch
|
||||
__instance.freeChatField.textArea.outputText.color = Color.white;
|
||||
|
||||
if (quickChatIcon == null) quickChatIcon = GameObject.Find("QuickChatIcon")?.transform?.GetComponent<SpriteRenderer>();
|
||||
else quickChatIcon.sprite = Utils.LoadSprite("TOHE.Resources.Images.DarkQuickChat.png", 100f);
|
||||
else quickChatIcon.sprite = Utils.LoadSprite("EHR.Resources.Images.DarkQuickChat.png", 100f);
|
||||
|
||||
if (openBanMenuIcon == null) openBanMenuIcon = GameObject.Find("OpenBanMenuIcon")?.transform?.GetComponent<SpriteRenderer>();
|
||||
else openBanMenuIcon.sprite = Utils.LoadSprite("TOHE.Resources.Images.DarkReport.png", 100f);
|
||||
else openBanMenuIcon.sprite = Utils.LoadSprite("EHR.Resources.Images.DarkReport.png", 100f);
|
||||
|
||||
if (openKeyboardIcon == null) openKeyboardIcon = GameObject.Find("OpenKeyboardIcon")?.transform?.GetComponent<SpriteRenderer>();
|
||||
else openKeyboardIcon.sprite = Utils.LoadSprite("TOHE.Resources.Images.DarkKeyboard.png", 100f);
|
||||
else openKeyboardIcon.sprite = Utils.LoadSprite("EHR.Resources.Images.DarkKeyboard.png", 100f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BepInEx.Unity.IL2CPP.Utils.Collections;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles.AddOns.GhostRoles;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.AddOns.GhostRoles;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.CustomWinnerHolder;
|
||||
using static TOHE.Translator;
|
||||
using static TOHE.Utils;
|
||||
using static EHR.CustomWinnerHolder;
|
||||
using static EHR.Translator;
|
||||
using static EHR.Utils;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(LogicGameFlowNormal), nameof(LogicGameFlowNormal.CheckEndCriteria))]
|
||||
class GameEndChecker
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
//��Դ��https://github.com/tukasa0001/TownOfHost/pull/1265
|
||||
[HarmonyPatch(typeof(OptionsMenuBehaviour), nameof(OptionsMenuBehaviour.Start))]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using InnerNet;
|
||||
using TMPro;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.MakePublic))]
|
||||
internal class MakePublicPatch
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using Rewired;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(ControllerManager), nameof(ControllerManager.Update))]
|
||||
internal class ControllerManagerUpdatePatch
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using TMPro;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))]
|
||||
internal class PingTrackerUpdatePatch
|
||||
@@ -193,7 +193,7 @@ internal class TitleLogoPatch
|
||||
var CustomBG = new GameObject("CustomBG");
|
||||
CustomBG.transform.position = new(0f, 0f, 520f);
|
||||
var bgRenderer = CustomBG.AddComponent<SpriteRenderer>();
|
||||
bgRenderer.sprite = Utils.LoadSprite("TOHE.Resources.Images.WinterBG.jpg", 180f);
|
||||
bgRenderer.sprite = Utils.LoadSprite("EHR.Resources.Images.WinterBG.jpg", 180f);
|
||||
|
||||
if (__instance.screenTint != null)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TOHE.Patches;
|
||||
namespace EHR.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(DeconSystem), nameof(DeconSystem.UpdateSystem))]
|
||||
public static class DeconSystemUpdateSystemPatch
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnDisconnected))]
|
||||
internal class OnDisconnectedPatch
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TOHE.Patches
|
||||
namespace EHR.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(StatsManager), nameof(StatsManager.BanMinutesLeft), MethodType.Getter)]
|
||||
public static class DisconnectPenaltyPatch
|
||||
|
||||
@@ -3,7 +3,7 @@ using Discord;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
|
||||
namespace TOHE.Patches
|
||||
namespace EHR.Patches
|
||||
{
|
||||
// Originally from Town of Us Rewritten, by Det
|
||||
[HarmonyPatch(typeof(ActivityManager), nameof(ActivityManager.UpdateActivity))]
|
||||
@@ -16,7 +16,7 @@ namespace TOHE.Patches
|
||||
{
|
||||
if (activity == null) return;
|
||||
|
||||
var details = $"TOHE+ v{Main.PluginDisplayVersion}";
|
||||
var details = $"EHR v{Main.PluginDisplayVersion}";
|
||||
activity.Details = details;
|
||||
|
||||
try
|
||||
@@ -41,14 +41,14 @@ namespace TOHE.Patches
|
||||
|
||||
if (lobbycode != "" && region != "")
|
||||
{
|
||||
details = $"TOHE+ - {lobbycode} ({region})";
|
||||
details = $"EHR - {lobbycode} ({region})";
|
||||
}
|
||||
|
||||
activity.Details = details;
|
||||
}
|
||||
else
|
||||
{
|
||||
details = $"TOHE+ v{Main.PluginDisplayVersion}";
|
||||
details = $"EHR v{Main.PluginDisplayVersion}";
|
||||
|
||||
activity.Details = details;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace TOHE.Patches
|
||||
{
|
||||
Logger.Error("Error in updating discord rpc", "DiscordPatch");
|
||||
Logger.Exception(ex, "DiscordPatch");
|
||||
details = $"TOHE+ v{Main.PluginDisplayVersion}";
|
||||
details = $"EHR v{Main.PluginDisplayVersion}";
|
||||
activity.Details = details;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(AmongUsClient._CoStartGameHost_d__30), nameof(AmongUsClient._CoStartGameHost_d__30.MoveNext))]
|
||||
public static class DleksPatch
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using HarmonyLib;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using static TOHE.Translator;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace TOHE.Patches;
|
||||
namespace EHR.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.ShowButtons))]
|
||||
public class EndGameManagerPatch
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using AmongUs.Data;
|
||||
using AmongUs.GameOptions;
|
||||
using EHR.Roles.AddOns.Crewmate;
|
||||
using EHR.Roles.AddOns.Impostor;
|
||||
using EHR.Roles.Crewmate;
|
||||
using EHR.Roles.Impostor;
|
||||
using EHR.Roles.Neutral;
|
||||
using HarmonyLib;
|
||||
using System.Linq;
|
||||
using TOHE.Roles.AddOns.Crewmate;
|
||||
using TOHE.Roles.AddOns.Impostor;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Impostor;
|
||||
using TOHE.Roles.Neutral;
|
||||
|
||||
namespace TOHE.Patches;
|
||||
namespace EHR.Patches;
|
||||
|
||||
class ExileControllerWrapUpPatch
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
|
||||
namespace TOHE;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(GameManager), nameof(GameManager.Serialize))]
|
||||
class GameManagerSerializeFix
|
||||
|
||||
Loaded 100 of 466 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user