Skip to content

Commit

Permalink
Update v1.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Jan 23, 2025
1 parent 10f059e commit cd559fd
Show file tree
Hide file tree
Showing 56 changed files with 1,440 additions and 1,577 deletions.
6 changes: 2 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[*.cs]
charset = utf-8
dotnet_diagnostic.IDE0007.severity = silent
dotnet_diagnostic.IDE0022.severity = silent
dotnet_diagnostic.IDE0023.severity = silent
dotnet_diagnostic.IDE0028.severity = none
dotnet_diagnostic.IDE0031.severity = silent
dotnet_diagnostic.IDE0046.severity = silent
dotnet_diagnostic.IDE0058.severity = silent
dotnet_diagnostic.IDE0061.severity = silent
dotnet_diagnostic.IDE0305.severity = silent
dotnet_diagnostic.IDE1006.severity = silent
Expand All @@ -16,10 +18,6 @@ dotnet_analyzer_diagnostic.severity = suggestion

[*.cs]
#### 命名样式 ####

# IDE0058:
dotnet_diagnostic.IDE0058.severity = silent

# 命名规则

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Download and Unzip BepInEx
run: |
wget https://builds.bepinex.dev/projects/bepinex_be/697/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.697%2B5362580.zip -O BepInEx.zip
wget https://builds.bepinex.dev/projects/bepinex_be/725/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.725%2Be1974e2.zip -O BepInEx.zip
unzip BepInEx.zip -d ./Release/
sudo chmod -R 777 ./Release
Expand All @@ -47,7 +47,7 @@ jobs:
unzip ExtraData.zip -d ./Release/
- name: Download Reactor
run: wget https://github.com/NuclearPowered/Reactor/releases/download/2.2.0/Reactor.dll -P ./Release/BepInEx/plugins
run: wget https://github.com/NuclearPowered/Reactor/releases/download/2.3.1/Reactor.dll -P ./Release/BepInEx/plugins

- name: Set Build Configuration
id: set-config
Expand Down
12 changes: 5 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
v1.1.1.1更新日志
v1.2.0.0 - Beta更新日志

* 新增伪装者职业:狼之主
* 新增附加能力:迷乱旋涡
* 修复巨人的体型在其他玩家不可见的问题
* 修复分散者的坐标问题

注:本次仅更新Lite分支
* 适配Among Us最新版本(2024.8.13~2024.11.26)
* 新增模组选项:游戏内显示聊天气泡
* 新增模组选项:静音大厅BGM
* 新增模组选项:强制使用+25协议(目前启用该选项后,无法进入房间)
Binary file modified Strings.xlsx
Binary file not shown.
3 changes: 0 additions & 3 deletions TheOtherRoles.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Beta|Any CPU = Beta|Any CPU
Debug|Any CPU = Debug|Any CPU
mxyx-club|Any CPU = mxyx-club|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Beta|Any CPU.ActiveCfg = Beta|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Beta|Any CPU.Build.0 = Beta|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.Build.0 = Release|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.mxyx-club|Any CPU.ActiveCfg = mxyx-club|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.mxyx-club|Any CPU.Build.0 = mxyx-club|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
34 changes: 2 additions & 32 deletions TheOtherRoles/Buttons/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ internal static class HudManagerStartPatch
public static CustomButton terroristButton;
public static CustomButton defuseButton;
public static CustomButton zoomOutButton;
public static CustomButton roleSummaryButton;

public static Dictionary<byte, List<CustomButton>> deputyHandcuffedButtons;
public static PoolablePlayer targetDisplay;
Expand Down Expand Up @@ -390,47 +389,18 @@ public static void createButtonsPostfix(HudManager __instance)
// get map id, or raise error to wait...
var mapId = GameOptionsManager.Instance.currentNormalGameOptions.MapId;

roleSummaryButton = new CustomButton(
() =>
{
if (LobbyRoleInfo.RolesSummaryUI == null)
LobbyRoleInfo.RoleSummaryOnClick();
else
{
Object.Destroy(LobbyRoleInfo.RolesSummaryUI);
LobbyRoleInfo.RolesSummaryUI = null;
}
},
() => { return PlayerControl.LocalPlayer != null && LobbyBehaviour.Instance; },
() =>
{
if (PlayerCustomizationMenu.Instance || GameSettingMenu.Instance)
{
if (LobbyRoleInfo.RolesSummaryUI != null)
Object.Destroy(LobbyRoleInfo.RolesSummaryUI);
}
return true;
},
() => { },
new ResourceSprite("TheOtherRoles.Resources.HelpButton.png", 85f),
new Vector3(0.4f, 3f, 0),
__instance,
null
);

zoomOutButton = new CustomButton(
() => { toggleZoom(); },
() =>
{
if (!CanSeeRoleInfo) return false;
if (PlayerControl.LocalPlayer.IsAlive()) return false;
if (!shouldShowGhostInfo() || InMeeting) return false;
var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data);
var numberOfLeftTasks = playerTotal - playerCompleted;
return numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.GetBool();
},
() => { return true; },
() => { },
UnityHelper.loadSpriteFromResources("TheOtherRoles.Resources.ZoomOut.png", 85f), // Invisible button!
null,
new Vector3(0.4f, 2.35f, 0f),
__instance,
KeyCode.KeypadPlus
Expand Down
44 changes: 40 additions & 4 deletions TheOtherRoles/CustomCosmetics/CustomColors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static void Load()
var colorlist = Palette.PlayerColors.ToList();
var shadowlist = Palette.ShadowColors.ToList();

var id = 50000;
var id = 60000;
foreach (var entry in CustomColorData.OrderBy(entry => (int)entry.Key))
{
var colorType = entry.Key;
Expand Down Expand Up @@ -133,20 +133,56 @@ private class ColorStringPatch
[HarmonyPriority(Priority.Last)]
public static bool Prefix(ref string __result, [HarmonyArgument(0)] StringNames name)
{
if ((int)name >= 50000)
if ((int)name >= 60000)
{
var text = ColorStrings[(int)name];
if (text != null)
if (ColorStrings.TryGetValue((int)name, out var text))
{
__result = $"color{text}".Translate();
return false;
}
else
{
Error($"Key '{(int)name}' not found in ColorStrings.");
}
}

return true;
}
}

[HarmonyPatch(typeof(ChatNotification), nameof(ChatNotification.SetUp))]
private class ChatNotificationColorsPatch
{
public static bool Prefix(ChatNotification __instance, PlayerControl sender, string text)
{
if (ShipStatus.Instance && !ModOption.ShowChatNotifications)
{
return false;
}
__instance.timeOnScreen = 5f;
__instance.gameObject.SetActive(true);
__instance.SetCosmetics(sender.Data);
string str;
Color color;
try
{
str = ColorUtility.ToHtmlStringRGB(Palette.TextColors[__instance.player.ColorId]);
color = Palette.TextOutlineColors[__instance.player.ColorId];
}
catch
{
Color32 c = Palette.PlayerColors[__instance.player.ColorId];
str = ColorUtility.ToHtmlStringRGB(c);
color = c.r + c.g + c.b > 180 ? Palette.Black : Palette.White;
//Message($"{c.r}, {c.g}, {c.b}");
}
__instance.playerColorText.text = __instance.player.ColorBlindName;
__instance.playerNameText.text = "<color=#" + str + ">" + (string.IsNullOrEmpty(sender.Data.PlayerName) ? "..." : sender.Data.PlayerName);
__instance.playerNameText.outlineColor = color;
__instance.chatText.text = text;
return false;
}
}
[HarmonyPatch(typeof(PlayerTab), nameof(PlayerTab.OnEnable))]
private static class PlayerTabEnablePatch
{
Expand Down
9 changes: 3 additions & 6 deletions TheOtherRoles/CustomCosmetics/CustomHats/CustomHatManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
Expand Down Expand Up @@ -78,15 +78,12 @@ internal static HatData CreateHatBehaviour(CustomHatConfig ch, bool testOnly = f

hat.name = ch.Name;
hat.displayOrder = 99;
hat.ProductId = "hat_" + ch.Name.Replace(' ', '_');
hat.ProductId = "Mod_" + ch.Name.Replace(' ', '_');
hat.InFront = !ch.Behind;
hat.NoBounce = !ch.Bounce;
hat.ChipOffset = new Vector2(0f, 0.2f);
hat.Free = true;
#if MXYX_CLUB
if (ch.Adaptive && cachedShader != null)
viewData.AltShader = cachedShader;
#endif

var extend = new HatExtension
{
Author = ch.Author ?? "Unknown",
Expand Down
12 changes: 9 additions & 3 deletions TheOtherRoles/CustomCosmetics/CustomHats/HatsLoader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using BepInEx.Unity.IL2CPP.Utils;
Expand Down Expand Up @@ -124,9 +125,14 @@ private void ProcessHatsData(HatsConfigFile response)

Message($"准备下载 {toDownload.Count} 项帽子文件");

this.StartCoroutine(CoDownloadHats(toDownload));
}

private static IEnumerator CoDownloadHats(List<string> toDownload)
{
foreach (var fileName in toDownload)
{
this.StartCoroutine(CoDownloadHatAsset(fileName));
yield return CoDownloadHatAsset(fileName);
}
}

Expand All @@ -146,7 +152,7 @@ private static IEnumerator CoDownloadHatAsset(string fileName)

if (www.isNetworkError || www.isHttpError)
{
Error(www.error);
Error($"{www.error} {fileName}");
yield break;
}

Expand Down
Loading

0 comments on commit cd559fd

Please sign in to comment.