Fix localization being applied

This commit is contained in:
Atony committed 2026-08-26 00:24:02 -05:00
1 parent 276ab0ac79
commit 4206b74d12
26 files changed
+163 -145

No files matched your search

@@ -13,7 +13,7 @@ namespace MiraAPI.Example.Buttons.Freezer;
public class FreezeButton : CustomActionButton<PlayerControl> public class FreezeButton : CustomActionButton<PlayerControl>
{ {
public override string Name => "button.freeze.name"; public override string Name => "button.freeze";
public override float Cooldown => OptionGroupSingleton<FreezerRoleSettings>.Instance.FreezeDuration; public override float Cooldown => OptionGroupSingleton<FreezerRoleSettings>.Instance.FreezeDuration;
public override bool PauseTimerInVent => true; public override bool PauseTimerInVent => true;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace MiraAPI.Example.Buttons;
public class MeetingButton : CustomActionButton public class MeetingButton : CustomActionButton
{ {
public override string Name => "button.callMeeting.name"; public override string Name => "button.callMeeting";
public override float Cooldown => 15; public override float Cooldown => 15;
@@ -10,7 +10,7 @@ namespace MiraAPI.Example.Buttons;
public class NeutralKillerButton : CustomActionButton public class NeutralKillerButton : CustomActionButton
{ {
public override string Name => "button.winGame.name"; public override string Name => "button.winGame";
public override float Cooldown => 0f; public override float Cooldown => 0f;
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton; public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
public override MiraKeybind Keybind => ExampleKeybinds.NeutralWinKeybind; public override MiraKeybind Keybind => ExampleKeybinds.NeutralWinKeybind;
@@ -12,7 +12,7 @@ namespace MiraAPI.Example.Buttons.Teleporter;
public class TeleportButton : CustomActionButton public class TeleportButton : CustomActionButton
{ {
public override string Name => "button.teleport.name"; public override string Name => "button.teleport";
public override float Cooldown => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportCooldown.Value; public override float Cooldown => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportCooldown.Value;
+2 -2
View File
@@ -7,7 +7,7 @@ namespace MiraAPI.Example.Buttons;
public class ThinkButton : CustomActionButton public class ThinkButton : CustomActionButton
{ {
public override string Name => "button.think.name"; public override string Name => "button.think";
public override float Cooldown => 15f; public override float Cooldown => 15f;
public override float EffectDuration => 10f; public override float EffectDuration => 10f;
public override int MaxUses => 1; public override int MaxUses => 1;
@@ -20,7 +20,7 @@ public class ThinkButton : CustomActionButton
public override void OnEffectEnd() public override void OnEffectEnd()
{ {
Button!.OverrideText("button.think.name".Translate()); Button!.OverrideText("button.think".Translate());
} }
public override bool IsEffectCancellable() public override bool IsEffectCancellable()
+1 -1
View File
@@ -8,7 +8,7 @@ namespace MiraAPI.Example;
public class ExampleLocalSettings(ConfigFile config) : LocalSettingsTab(config) public class ExampleLocalSettings(ConfigFile config) : LocalSettingsTab(config)
{ {
public override string TabName => "settings.miraExample.name"; public override string TabName => "settings.miraExample";
protected override bool ShouldCreateLabels => false; protected override bool ShouldCreateLabels => false;
public override LocalSettingTabAppearance TabAppearance => new() public override LocalSettingTabAppearance TabAppearance => new()
+1 -1
View File
@@ -10,7 +10,7 @@ namespace MiraAPI.Example.Modifiers;
public class CaptainModifier : GameModifier public class CaptainModifier : GameModifier
{ {
public override string ModifierName => "modifier.captain.name"; public override string ModifierName => "modifier.captain";
public override LoadableAsset<Sprite>? ModifierIcon => ExampleAssets.CallMeetingButton; public override LoadableAsset<Sprite>? ModifierIcon => ExampleAssets.CallMeetingButton;
public override void OnDeath(DeathReason reason) public override void OnDeath(DeathReason reason)
@@ -7,7 +7,7 @@ namespace MiraAPI.Example.Modifiers.Freezer;
public class FreezeModifier : TimedModifier public class FreezeModifier : TimedModifier
{ {
public override string ModifierName => "modifier.freezed.name"; public override string ModifierName => "modifier.freezed";
public override bool HideOnUi => false; public override bool HideOnUi => false;
public override float Duration => 15f; public override float Duration => 15f;
public override bool AutoStart => true; public override bool AutoStart => true;
@@ -4,7 +4,7 @@ namespace MiraAPI.Example.Modifiers;
public class HighPriorityModifier : GameModifier public class HighPriorityModifier : GameModifier
{ {
public override string ModifierName => "modifier.highPriority.name"; public override string ModifierName => "modifier.highPriority";
public override string GetDescription() public override string GetDescription()
{ {
+1 -1
View File
@@ -7,7 +7,7 @@ namespace MiraAPI.Example.Options;
public class ExampleOptions : AbstractOptionGroup public class ExampleOptions : AbstractOptionGroup
{ {
public override string GroupName => "options.exampleOptions1.name"; public override string GroupName => "options.exampleOptions1";
public override Color GroupColor => Color.green; public override Color GroupColor => Color.green;
[ModdedToggleOption("options.exampleOptions1.toggleOpt1")] [ModdedToggleOption("options.exampleOptions1.toggleOpt1")]
+1 -1
View File
@@ -6,7 +6,7 @@ namespace MiraAPI.Example.Options;
public class ExampleOptions2 : AbstractOptionGroup public class ExampleOptions2 : AbstractOptionGroup
{ {
public override string GroupName => "options.exampleOptions2.name"; public override string GroupName => "options.exampleOptions2";
public override uint GroupPriority => 0; // This group will be displayed first. The default value is uint.MaxValue. public override uint GroupPriority => 0; // This group will be displayed first. The default value is uint.MaxValue.
@@ -6,7 +6,7 @@ namespace MiraAPI.Example.Options.Modifiers;
public class CaptainModifierSettings : AbstractOptionGroup<CaptainModifier> public class CaptainModifierSettings : AbstractOptionGroup<CaptainModifier>
{ {
public override string GroupName => "options.captainSettings.name"; public override string GroupName => "options.captainSettings";
[ModdedNumberOption("options.captainSettings.amount", 0, 5)] [ModdedNumberOption("options.captainSettings.amount", 0, 5)]
public float Amount { get; set; } = 1; public float Amount { get; set; } = 1;
@@ -6,7 +6,7 @@ namespace MiraAPI.Example.Options.Modifiers;
public class FreezeModifierSettings : AbstractOptionGroup<FreezeModifier> public class FreezeModifierSettings : AbstractOptionGroup<FreezeModifier>
{ {
public override string GroupName => "options.freezeModifierSettings.name"; public override string GroupName => "options.freezeModifierSettings";
[ModdedToggleOption("options.freezeModifierSettings.useColor")] [ModdedToggleOption("options.freezeModifierSettings.useColor")]
public bool UseColor { get; set; } = true; public bool UseColor { get; set; } = true;
@@ -5,7 +5,7 @@ namespace MiraAPI.Example.Options.Modifiers;
public class GeneralModifierOptions : AbstractOptionGroup public class GeneralModifierOptions : AbstractOptionGroup
{ {
public override string GroupName => "options.generalModifier.name"; public override string GroupName => "options.generalModifier";
public override uint GroupPriority => 0; public override uint GroupPriority => 0;
@@ -13,11 +13,11 @@ public class FreezerRoleSettings : AbstractOptionGroup<FreezerRole>
TmpSpriteUtils.CreateSpriteAsset( TmpSpriteUtils.CreateSpriteAsset(
MiraAssets.ImpostorFile.LoadAsset(), MiraAssets.ImpostorFile.LoadAsset(),
"ApiExample.Role.Impostor.FreezerRole")); "ApiExample.Role.Impostor.FreezerRole"));
public override string GroupName => "options.freezerRoleSettings.name"; public override string GroupName => "ApiExample.Role.Freezer";
[ModdedNumberOption("options.freezerRoleSettings.freezeDuration", 1, 15, 1, MiraNumberSuffixes.Seconds)] [ModdedNumberOption("ApiExample.Role.Freezer.Settings.FreezeDuration", 1, 15, 1, MiraNumberSuffixes.Seconds)]
public float FreezeDuration { get; set; } = 5; public float FreezeDuration { get; set; } = 5;
[ModdedNumberOption("options.freezerRoleSettings.freezeUses", 1, 5)] [ModdedNumberOption("ApiExample.Role.Freezer.Settings.FreezeUses", 1, 5)]
public float FreezeUses { get; set; } = 1; public float FreezeUses { get; set; } = 1;
} }
@@ -8,13 +8,13 @@ namespace MiraAPI.Example.Options.Roles;
public class TeleporterOptions : AbstractRoleOptionGroup<TeleporterRole> public class TeleporterOptions : AbstractRoleOptionGroup<TeleporterRole>
{ {
public override string GroupName => "options.teleporterOptions.name"; public override string GroupName => "ApiExample.Role.Teleporter";
public ModdedNumberOption TeleportCooldown { get; set; } = new("options.teleporterOptions.teleportCooldown", 10, 5, 60, 2.5f, MiraNumberSuffixes.Seconds); public ModdedNumberOption TeleportCooldown { get; set; } = new("ApiExample.Role.Teleporter.Settings.TeleportCooldown", 10, 5, 60, 2.5f, MiraNumberSuffixes.Seconds);
[ModdedNumberOption("options.teleporterOptions.teleportDuration", 5, 25, 1, MiraNumberSuffixes.Seconds)] [ModdedNumberOption("ApiExample.Role.Teleporter.Settings.TeleportDuration", 5, 25, 1, MiraNumberSuffixes.Seconds)]
public float TeleportDuration { get; set; } = 10; public float TeleportDuration { get; set; } = 10;
[ModdedNumberOption("options.teleporterOptions.zoomDistance", 4, 15)] [ModdedNumberOption("ApiExample.Role.Teleporter.Settings.ZoomDistance", 4, 15)]
public float ZoomDistance { get; set; } = 6; public float ZoomDistance { get; set; } = 6;
} }
+76 -63
View File
@@ -1,69 +1,82 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<resources> <resources>
<string name="ApiExample.Role.Teleporter">Teleporter</string> <string name="ApiExample.Role.Teleporter">Teleporter</string>
<string name="ApiExample.Role.Teleporter.IntroBlurb">Zoom out and teleport across the map!</string> <string name="ApiExample.Role.Teleporter.IntroBlurb">Zoom out and teleport across the map!</string>
<string name="ApiExample.Role.Teleporter.MedDescription">Zoom out and teleport across the map!</string> <string name="ApiExample.Role.Teleporter.MedDescription">Zoom out and teleport across the map!</string>
<string name="ApiExample.Role.Teleporter.TabDescription">Zoom out and teleport across the map!</string> <string name="ApiExample.Role.Teleporter.TabDescription">Zoom out and teleport across the map!</string>
<string name="ApiExample.Role.Teleporter.WikiDescription">The Teleporter is a Crewmate role that can move around the map using their dope-ass ability.</string> <string name="ApiExample.Role.Teleporter.WikiDescription">The Teleporter is a Crewmate role that can move around the map using their dope-ass ability.</string>
<string name="ApiExample.Role.Freezer">Freezer</string> <string name="ApiExample.Role.Freezer">Freezer</string>
<string name="ApiExample.Role.Freezer.TabDescription">Freeze another player for a duration of time.</string> <string name="ApiExample.Role.Freezer.IntroBlurb">Get iced, nerd.</string>
<string name="ApiExample.Role.Mayor">Mayor</string> <string name="ApiExample.Role.Freezer.MedDescription">Freeze others for a duration of time.</string>
<string name="ApiExample.Role.Mayor.TabDescription">You get extra votes!</string> <string name="ApiExample.Role.Freezer.TabDescription">Freeze another player for a duration of time.</string>
<string name="ApiExample.Role.Chamelon">Chamelon</string> <string name="ApiExample.Role.Freezer.WikiDescription">The Freezer is an Impostor role that can freeze players. Or something along those lines.</string>
<string name="ApiExample.Role.Chamelon.TabDescription">Stay invisible while not moving.</string> <string name="ApiExample.Role.Mayor">Mayor</string>
<string name="ApiExample.Role.OutcastKiller">Outcast Killer</string> <string name="ApiExample.Role.Mayor.IntroBlurb">Democracy is the best policy.</string>
<string name="ApiExample.Role.OutcastKiller.TabDescription">Outcast who can kill.</string> <string name="ApiExample.Role.Mayor.MedDescription">Vote out the Impostors with more votes.
<string name="outcast">Outcast</string> Your votes have double the power.</string>
<string name="outcast.roleTitle">OUTCAST</string> <string name="ApiExample.Role.Mayor.TabDescription">You get one extra vote in the meeting!</string>
<string name="outcast.teamIntroDescription">You are an Outcast. You do not have a team.</string> <string name="ApiExample.Role.Mayor.WikiDescription">The Mayor is a Crewmate role that gets two votes in the meeting, instead of the singular vote other Crewmates get.</string>
<string name="button.think">Think</string> <string name="ApiExample.Role.Chamelon">Chamelon</string>
<string name="button.think.thinking">Thinking...</string> <string name="ApiExample.Role.Chamelon.IntroBlurb">Become one with the environment.</string>
<string name="button.freeze">Freeze</string> <string name="ApiExample.Role.Chamelon.MedDescription">Fade out of everyone's vision by not moving.</string>
<string name="button.teleport">Teleport</string> <string name="ApiExample.Role.Chamelon.TabDescription">Stay invisible while not moving.</string>
<string name="button.callMeeting">Call Meeting</string> <string name="ApiExample.Role.Chamelon.WikiDescription">The Chamelon is a Crewmate role that slowly becomes invisible while standing still.</string>
<string name="button.winGame">Win Game</string> <string name="ApiExample.Role.OutcastKiller">Outcast Killer</string>
<string name="modifier.captain">Captain</string> <string name="ApiExample.Role.OutcastKiller.IntroBlurb">Kill everyone else.</string>
<string name="modifier.captain.TabDescription">You can call a meeting from anywhere on the map.</string> <string name="ApiExample.Role.OutcastKiller.MedDescription">Be the last outcast standing.
<string name="modifier.freezed">Freezed</string> Eliminate every other faction.</string>
<string name="modifier.highPriority">High Priority</string> <string name="ApiExample.Role.OutcastKiller.TabDescription">Outcast who can kill.</string>
<string name="modifier.highPriority.TabDescription">You are high priority! Idrk what this means either tbh...</string> <string name="ApiExample.Role.OutcastKiller.WikiDescription">The Outcast Killer is an Outcast role that can kill, like some sort of neutral killer...</string>
<string name="options.exampleOptions1">Example Options 1</string> <string name="outcast">Outcast</string>
<string name="options.exampleOptions1.toggleOpt1">Toggle Opt 1</string> <string name="outcast.roleTitle">OUTCAST</string>
<string name="options.exampleOptions1.toggleOpt2">Toggle Opt 2</string> <string name="outcast.teamIntroDescription">You are an Outcast. You do not have a team.</string>
<string name="options.exampleOptions1.numberOpt">Number Opt</string> <string name="button.think">Think</string>
<string name="options.exampleOptions1.bestApi">Best API</string> <string name="button.think.thinking">Thinking...</string>
<string name="options.exampleOptions2">Example Options 2</string> <string name="button.freeze">Freeze</string>
<string name="options.exampleOptions2.youMustChoseAPlayer">YOU MUST CHOSE A PLAYER</string> <string name="button.teleport">Teleport</string>
<string name="options.exampleOptions2.ehWhatever">Eh whatever</string> <string name="button.callMeeting">Call Meeting</string>
<string name="options.exampleOptions2.toggleOption1">Toggle Option 1</string> <string name="button.winGame">Win Game</string>
<string name="options.exampleOptions2.toggleOption2">Toggle Option 2</string> <string name="modifier.captain">Captain</string>
<string name="options.exampleOptions2.enumOpt">Enum Opt</string> <string name="modifier.captain.TabDescription">You can call a meeting from anywhere on the map.</string>
<string name="options.captainSettings">Captain Settings</string> <string name="modifier.freezed">Freezed</string>
<string name="options.captainSettings.amount">Amount</string> <string name="modifier.highPriority">High Priority</string>
<string name="options.captainSettings.chance">Chance</string> <string name="modifier.highPriority.TabDescription">You are high priority! Idrk what this means either tbh...</string>
<string name="options.captainSettings.uses">Uses</string> <string name="options.exampleOptions1">Example Options 1</string>
<string name="options.freezeModifierSettings">Freeze</string> <string name="options.exampleOptions1.toggleOpt1">Toggle Opt 1</string>
<string name="options.freezeModifierSettings.useColor">Use Color</string> <string name="options.exampleOptions1.toggleOpt2">Toggle Opt 2</string>
<string name="options.generalModifier">General</string> <string name="options.exampleOptions1.numberOpt">Number Opt</string>
<string name="options.generalModifier.someBooleanOption">Some Boolean Option</string> <string name="options.exampleOptions1.bestApi">Best API</string>
<string name="options.generalModifier.numberOption">Number Option</string> <string name="options.exampleOptions2">Example Options 2</string>
<string name="options.freezerRoleSettings">Custom Role</string> <string name="options.exampleOptions2.youMustChoseAPlayer">YOU MUST CHOSE A PLAYER</string>
<string name="options.freezerRoleSettings.freezeDuration">Freeze Duration</string> <string name="options.exampleOptions2.ehWhatever">Eh whatever</string>
<string name="options.freezerRoleSettings.freezeUses">Freeze Uses</string> <string name="options.exampleOptions2.toggleOption1">Toggle Option 1</string>
<string name="options.teleporterOptions">Teleporter</string> <string name="options.exampleOptions2.toggleOption2">Toggle Option 2</string>
<string name="options.teleporterOptions.teleportCooldown">Teleport Cooldown</string> <string name="options.exampleOptions2.enumOpt">Enum Opt</string>
<string name="options.teleporterOptions.teleportDuration">Teleport Duration</string> <string name="options.captainSettings">Captain Settings</string>
<string name="options.teleporterOptions.zoomDistance">Zoom Distance</string> <string name="options.captainSettings.amount">Amount</string>
<string name="settings.miraExample">Mira Example</string> <string name="options.captainSettings.chance">Chance</string>
<string name="settings.miraExample.exampleBool">Example Bool</string> <string name="options.captainSettings.uses">Uses</string>
<string name="settings.miraExample.exampleBool2">Example Bool 2</string> <string name="options.freezeModifierSettings">Freeze</string>
<string name="settings.miraExample.slider">Slider</string> <string name="options.freezeModifierSettings.useColor">Use Color</string>
<string name="settings.miraExample.exampleNumber">Example Number</string> <string name="options.generalModifier">General</string>
<string name="settings.miraExample.exampleMultiplier">Example Multplier</string> <string name="options.generalModifier.someBooleanOption">Some Boolean Option</string>
<string name="settings.miraExample.exampleEnum">Example Enum</string> <string name="options.generalModifier.numberOption">Number Option</string>
<string name="settings.miraExample.button.exampleButton">Example Button</string> <string name="options.freezerRoleSettings">Custom Role</string>
<string name="gameover.outcastKiller.win">Outcast Killer Wins!</string> <string name="ApiExample.Role.Freezer.Settings.FreezeDuration">Freeze Duration</string>
<string name="color.cerulean">Cerulean</string> <string name="ApiExample.Role.Freezer.Settings.FreezeUses">Freeze Uses</string>
<string name="color.rose">Rose</string> <string name="ApiExample.Role.Teleporter.Settings.TeleportCooldown">Teleport Cooldown</string>
<string name="color.gold">Gold</string> <string name="ApiExample.Role.Teleporter.Settings.TeleportDuration">Teleport Duration</string>
<string name="ApiExample.Role.Teleporter.Settings.ZoomDistance">Zoom Distance</string>
<string name="settings.miraExample">Mira Example</string>
<string name="settings.miraExample.exampleBool">Example Bool</string>
<string name="settings.miraExample.exampleBool2">Example Bool 2</string>
<string name="settings.miraExample.slider">Slider</string>
<string name="settings.miraExample.exampleNumber">Example Number</string>
<string name="settings.miraExample.exampleMultiplier">Example Multplier</string>
<string name="settings.miraExample.exampleEnum">Example Enum</string>
<string name="settings.miraExample.button.exampleButton">Example Button</string>
<string name="gameover.outcastKiller.win">Outcast Killer Wins!</string>
<string name="color.cerulean">Cerulean</string>
<string name="color.rose">Rose</string>
<string name="color.gold">Gold</string>
</resources> </resources>
+31 -29
View File
@@ -1,57 +1,59 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<resources> <resources>
<string name="teleporterrole.name">传送者</string> <string name="ApiExample.Role.Teleporter">传送者</string>
<string name="teleporterrole.description">缩小视野并在地图上传送!</string> <string name="ApiExample.Role.Teleporter.IntroBlurb">缩小视野并在地图上传送!</string>
<string name="freezerrole.name">冰冻者</string> <string name="ApiExample.Role.Teleporter.MedDescription">缩小视野并在地图上传送!</string>
<string name="freezerrole.description">将其他玩家冰冻一段时间。</string> <string name="ApiExample.Role.Teleporter.TabDescription">缩小视野并在地图上传送!</string>
<string name="mayorrole.name">市长</string> <string name="ApiExample.Role.Freezer">冰冻者</string>
<string name="ApiExample.Role.Freezer.TabDescription">将其他玩家冰冻一段时间。</string>
<string name="mayorrole">市长</string>
<string name="mayorrole.description">你拥有额外投票权!</string> <string name="mayorrole.description">你拥有额外投票权!</string>
<string name="chamelonrole.name">变色龙</string> <string name="chamelonrole">变色龙</string>
<string name="chamelonrole.description">静止不动时保持隐身。</string> <string name="chamelonrole.description">静止不动时保持隐身。</string>
<string name="outcastKillerrole.name">流放杀手</string> <string name="outcastKillerrole">流放杀手</string>
<string name="outcastKillerrole.description">可以击杀的流放者。</string> <string name="outcastKillerrole.description">可以击杀的流放者。</string>
<string name="outcast.name">流放者</string> <string name="outcast">流放者</string>
<string name="outcast.roleTitle">流放者</string> <string name="outcast.roleTitle">流放者</string>
<string name="outcast.teamIntroDescription">你是流放者,你没有队伍。</string> <string name="outcast.teamIntroDescription">你是流放者,你没有队伍。</string>
<string name="button.think.name">思考</string> <string name="button.think">思考</string>
<string name="button.think.thinking">思考中...</string> <string name="button.think.thinking">思考中...</string>
<string name="button.freeze.name">冰冻</string> <string name="button.freeze">冰冻</string>
<string name="button.teleport.name">传送</string> <string name="button.teleport">传送</string>
<string name="button.callMeeting.name">召集会议</string> <string name="button.callMeeting">召集会议</string>
<string name="button.winGame.name">赢得游戏</string> <string name="button.winGame">赢得游戏</string>
<string name="modifier.captain.name">队长</string> <string name="modifier.captain">队长</string>
<string name="modifier.captain.description">你可以在地图上任意位置召集会议。</string> <string name="modifier.captain.description">你可以在地图上任意位置召集会议。</string>
<string name="modifier.freezed.name">已被冰冻</string> <string name="modifier.freezed">已被冰冻</string>
<string name="modifier.highPriority.name">高优先级</string> <string name="modifier.highPriority">高优先级</string>
<string name="modifier.highPriority.description">你是高优先级!老实说我也不太清楚这是什么意思……</string> <string name="modifier.highPriority.description">你是高优先级!老实说我也不太清楚这是什么意思……</string>
<string name="options.exampleOptions1.name">示例选项组 1</string> <string name="options.exampleOptions1">示例选项组 1</string>
<string name="options.exampleOptions1.toggleOpt1">开关选项 1</string> <string name="options.exampleOptions1.toggleOpt1">开关选项 1</string>
<string name="options.exampleOptions1.toggleOpt2">开关选项 2</string> <string name="options.exampleOptions1.toggleOpt2">开关选项 2</string>
<string name="options.exampleOptions1.numberOpt">数字选项</string> <string name="options.exampleOptions1.numberOpt">数字选项</string>
<string name="options.exampleOptions1.bestApi">谁是最好的API</string> <string name="options.exampleOptions1.bestApi">谁是最好的API</string>
<string name="options.exampleOptions2.name">示例选项组 2</string> <string name="options.exampleOptions2">示例选项组 2</string>
<string name="options.exampleOptions2.youMustChoseAPlayer">你必须选择一个玩家</string> <string name="options.exampleOptions2.youMustChoseAPlayer">你必须选择一个玩家</string>
<string name="options.exampleOptions2.ehWhatever">咕咕嘎嘎</string> <string name="options.exampleOptions2.ehWhatever">咕咕嘎嘎</string>
<string name="options.exampleOptions2.toggleOption1">开关选项 1</string> <string name="options.exampleOptions2.toggleOption1">开关选项 1</string>
<string name="options.exampleOptions2.toggleOption2">开关选项 2</string> <string name="options.exampleOptions2.toggleOption2">开关选项 2</string>
<string name="options.exampleOptions2.enumOpt">枚举选项</string> <string name="options.exampleOptions2.enumOpt">枚举选项</string>
<string name="options.captainSettings.name">队长设置</string> <string name="options.captainSettings">队长设置</string>
<string name="options.captainSettings.amount">数量</string> <string name="options.captainSettings.amount">数量</string>
<string name="options.captainSettings.chance">概率</string> <string name="options.captainSettings.chance">概率</string>
<string name="options.captainSettings.uses">使用次数</string> <string name="options.captainSettings.uses">使用次数</string>
<string name="options.freezeModifierSettings.name">冰冻</string> <string name="options.freezeModifierSettings">冰冻</string>
<string name="options.freezeModifierSettings.useColor">使用颜色</string> <string name="options.freezeModifierSettings.useColor">使用颜色</string>
<string name="options.generalModifier.name">通用</string> <string name="options.generalModifier">通用</string>
<string name="options.generalModifier.someBooleanOption">某个布尔选项</string> <string name="options.generalModifier.someBooleanOption">某个布尔选项</string>
<string name="options.generalModifier.numberOption">数字选项</string> <string name="options.generalModifier.numberOption">数字选项</string>
<string name="options.freezerRoleSettings.name">自定义职业</string> <string name="options.freezerRoleSettings">自定义职业</string>
<string name="options.freezerRoleSettings.freezeDuration">冰冻时长</string> <string name="ApiExample.Role.Freezer.Settings.FreezeDuration">冰冻时长</string>
<string name="options.freezerRoleSettings.freezeUses">冰冻次数</string> <string name="ApiExample.Role.Freezer.Settings.FreezeUses">冰冻次数</string>
<string name="options.teleporterOptions.name">传送者</string> <string name="ApiExample.Role.Teleporter.Settings">传送者</string>
<string name="options.teleporterOptions.teleportCooldown">传送冷却</string> <string name="ApiExample.Role.Teleporter.Settings.TeleportCooldown">传送冷却</string>
<string name="options.teleporterOptions.teleportDuration">传送持续时间</string> <string name="ApiExample.Role.Teleporter.Settings.TeleportDuration">传送持续时间</string>
<string name="options.teleporterOptions.zoomDistance">缩放距离</string> <string name="ApiExample.Role.Teleporter.Settings.ZoomDistance">缩放距离</string>
<string name="settings.miraExample.name">Mira 示例插件</string> <string name="settings.miraExample">Mira 示例插件</string>
<string name="settings.miraExample.exampleBool">示例布尔</string> <string name="settings.miraExample.exampleBool">示例布尔</string>
<string name="settings.miraExample.exampleBool2">示例布尔 2</string> <string name="settings.miraExample.exampleBool2">示例布尔 2</string>
<string name="settings.miraExample.slider">滑块</string> <string name="settings.miraExample.slider">滑块</string>
+1 -1
View File
@@ -19,7 +19,7 @@ public class NeutralKillerRole : ImpostorRole, ICustomRole
CanUseVent = true, CanUseVent = true,
}; };
public RoleOptionsGroup RoleOptionsGroup { get; } = new("outcast.name", Color.gray); public RoleOptionsGroup RoleOptionsGroup { get; } = new("outcast", Color.gray);
[HideFromIl2Cpp] [HideFromIl2Cpp]
public TeamIntroConfiguration? IntroConfiguration { get; } = new( public TeamIntroConfiguration? IntroConfiguration { get; } = new(
+3 -3
View File
@@ -33,7 +33,7 @@ public abstract class AbstractGameMode : IOptionable
public abstract string Description { get; } public abstract string Description { get; }
/// <summary> /// <summary>
/// Gets the game mode description. /// Gets the game mode color to display on the lobby pane.
/// </summary> /// </summary>
public virtual Color Color { get; } = Color.white; public virtual Color Color { get; } = Color.white;
@@ -43,14 +43,14 @@ public abstract class AbstractGameMode : IOptionable
public virtual LoadableAsset<Sprite>? Icon => null; public virtual LoadableAsset<Sprite>? Icon => null;
/// <summary> /// <summary>
/// Gets the icon of the gamemode for use on the options pop-up. /// Gets or sets the icon of the gamemode for use on the options pop-up.
/// </summary> /// </summary>
public TMP_SpriteAsset TmpIcon { get; set; } = null!; public TMP_SpriteAsset TmpIcon { get; set; } = null!;
/// <summary> /// <summary>
/// Gets the colored game mode name, using the color and name properties. /// Gets the colored game mode name, using the color and name properties.
/// </summary> /// </summary>
public string ColoredName => $"<color=#{this.Color.ToHtmlStringRGBA()}>{MiraLocaleManager.Get(Name)}</color>"; public string ColoredName => $"<color=#{Color.ToHtmlStringRGBA()}>{MiraLocaleManager.Get(Name)}</color>";
/// <summary> /// <summary>
/// Gets the game mode id. /// Gets the game mode id.
+2 -2
View File
@@ -53,13 +53,13 @@ public static class GameModeOption
internal static readonly StringNames CustomName = MiraLocaleManager.GetOrCreateLocaleString("Custom"); internal static readonly StringNames CustomName = MiraLocaleManager.GetOrCreateLocaleString("Custom");
internal static readonly Dictionary<uint, StringNames> Values = new() internal static readonly Dictionary<uint, StringNames> Values = new()
{ {
[0] = MiraLocaleManager.GetOrCreateLocaleString("Classic"), [0] = MiraLocaleManager.GetOrCreateLocaleString("gamemode.classic"),
}; };
internal static void AddOption(AbstractGameMode mode) internal static void AddOption(AbstractGameMode mode)
{ {
if (!Values.ContainsKey(mode.ID)) if (!Values.ContainsKey(mode.ID))
Values.Add(mode.ID, MiraLocaleManager.GetOrCreateLocaleString(mode + ".colored")); Values.Add(mode.ID, MiraLocaleManager.GetOrCreateLocaleString(mode.Name));
} }
/*[HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.CreateSettings))] /*[HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.CreateSettings))]
[HarmonyPostfix] [HarmonyPostfix]
+20 -20
View File
@@ -17,7 +17,7 @@ namespace MiraAPI;
public class MiraApiSettings(ConfigFile config) : LocalSettingsTab(config) public class MiraApiSettings(ConfigFile config) : LocalSettingsTab(config)
{ {
/// <inheritdoc /> /// <inheritdoc />
public override string TabName => "miraApi.name".Translate(); public override string TabName => "miraApi";
/// <inheritdoc /> /// <inheritdoc />
public override LocalSettingTabAppearance TabAppearance => new() public override LocalSettingTabAppearance TabAppearance => new()
@@ -205,58 +205,58 @@ public class MiraApiSettings(ConfigFile config) : LocalSettingsTab(config)
} }
} }
/// <summary>
/// Gets whether the modifiers hud should be on the left side of the screen (under roles/task tab). Recommended for streamers.
/// </summary>
[LocalToggleSetting]
public ConfigEntry<bool> ModifiersHudLeftSide { get; private set; } = config.Bind("Visuals/UI", "Show Modifiers HUD on Left Side", false);
/// <summary>
/// Gets whether to show keybinds on buttons.
/// </summary>
[LocalToggleSetting]
public ConfigEntry<bool> ShowKeybinds { get; private set; } = config.Bind("Visuals/UI", "Show Keybinds on Buttons", true);
/// <summary> /// <summary>
/// Gets the scale of the ability buttons. /// Gets the scale of the ability buttons.
/// </summary> /// </summary>
[LocalSliderSetting(min: 0.5f, max: 1.5f, suffixType: MiraNumberSuffixes.Multiplier, formatString: "0.00", displayValue: true)] [LocalSliderSetting(min: 0.5f, max: 1.5f, suffixType: MiraNumberSuffixes.Multiplier, formatString: "0.00", displayValue: true)]
public ConfigEntry<float> ButtonUIFactorSlider { get; private set; } = public ConfigEntry<float> ButtonUIFactorSlider { get; private set; } =
config.Bind("Visuals/UI", "Button Scale Factor", 0.75f); config.Bind("miraApi.visualsUi", "miraApi.buttonScaleFactor", 0.75f);
/// <summary> /// <summary>
/// Gets the scale of the UI buttons. /// Gets the scale of the UI buttons.
/// </summary> /// </summary>
[LocalSliderSetting(min: 0.3f, max: 2f, suffixType: MiraNumberSuffixes.Multiplier, formatString: "0.00", displayValue: true)] [LocalSliderSetting(min: 0.3f, max: 2f, suffixType: MiraNumberSuffixes.Multiplier, formatString: "0.00", displayValue: true)]
public ConfigEntry<float> TopRightButtonsFactorSlider { get; private set; } = public ConfigEntry<float> TopRightButtonsFactorSlider { get; private set; } =
config.Bind("Visuals/UI", "Top-Right UI Scale Factor", 1f); config.Bind("miraApi.visualsUi", "miraApi.topRightButtonScaleFactor", 1f);
/// <summary> /// <summary>
/// Gets the fps specified by the player. /// Gets the fps specified by the player.
/// </summary> /// </summary>
[LocalSliderSetting(min: 60f, max: 240f, suffixType: MiraNumberSuffixes.None, formatString: "0", displayValue: true, roundValue: true)] [LocalSliderSetting(min: 60f, max: 240f, suffixType: MiraNumberSuffixes.None, formatString: "0", displayValue: true, roundValue: true)]
public ConfigEntry<float> SetFpsSlider { get; private set; } = public ConfigEntry<float> SetFpsSlider { get; private set; } =
config.Bind("Visuals/UI", "Max FPS", 120f); config.Bind("miraApi.visualsUi", "Max FPS", 120f);
/// <summary>
/// Gets whether the modifiers hud should be on the left side of the screen (under roles/task tab). Recommended for streamers.
/// </summary>
[LocalToggleSetting]
public ConfigEntry<bool> ModifiersHudLeftSide { get; private set; } = config.Bind("miraApi.visualsUi", "miraApi.showModifiersHudOnLeftSide", false);
/// <summary>
/// Gets whether to show keybinds on buttons.
/// </summary>
[LocalToggleSetting]
public ConfigEntry<bool> ShowKeybinds { get; private set; } = config.Bind("miraApi.visualsUi", "miraApi.showKeybindsOnButtons", true);
[LocalToggleSetting] [LocalToggleSetting]
public ConfigEntry<bool> WikiOnBottomRow { get; private set; } = public ConfigEntry<bool> WikiOnBottomRow { get; private set; } =
config.Bind("Visuals/UI", "Display Wiki on Bottom Row", true); config.Bind("miraApi.visualsUi", "miraApi.wikiOnBottomRow", true);
/// <summary> /// <summary>
/// Gets whether to apply cosmetic changes to the TaskAdder. /// Gets whether to apply cosmetic changes to the TaskAdder.
/// </summary> /// </summary>
[LocalToggleSetting] [LocalToggleSetting]
public ConfigEntry<bool> PrettyTaskAdder { get; private set; } = config.Bind("Freeplay", "Pretty Task Laptop", true); public ConfigEntry<bool> PrettyTaskAdder { get; private set; } = config.Bind("miraApi.freeplay", "miraApi.prettyTaskLaptop", true);
/// <summary> /// <summary>
/// Gets whether to show the red flash from sabotages. /// Gets whether to show the red flash from sabotages.
/// </summary> /// </summary>
[LocalToggleSetting] [LocalToggleSetting]
public ConfigEntry<bool> EnableSabotageFlashes { get; private set; } = config.Bind("Accessibility", "Enable Sabotage Flashes", true); public ConfigEntry<bool> EnableSabotageFlashes { get; private set; } = config.Bind("miraApi.accessibility", "miraApi.enableSabotageFlashes", true);
/// <summary> /// <summary>
/// Gets whether to enable the sabotage sound effects or not. /// Gets whether to enable the sabotage sound effects or not.
/// </summary> /// </summary>
[LocalToggleSetting] [LocalToggleSetting]
public ConfigEntry<bool> EnableSabotageBlares { get; private set; } = config.Bind("Accessibility", "Enable Sabotage Blare", true); public ConfigEntry<bool> EnableSabotageBlares { get; private set; } = config.Bind("miraApi.accessibility", "miraApi.enableSabotageBlare", true);
} }
+2 -1
View File
@@ -2,6 +2,7 @@ using System.Collections;
using HarmonyLib; using HarmonyLib;
using Il2CppSystem; using Il2CppSystem;
using MiraAPI.GameModes; using MiraAPI.GameModes;
using MiraAPI.Translation;
using Reactor.Utilities; using Reactor.Utilities;
using Reactor.Utilities.Extensions; using Reactor.Utilities.Extensions;
using TMPro; using TMPro;
@@ -49,7 +50,7 @@ internal static class HudPatches
gmText.SetActive(false); gmText.SetActive(false);
modelText.SetActive(false); modelText.SetActive(false);
_text = gmTextClone.GetComponent<TextMeshPro>(); _text = gmTextClone.GetComponent<TextMeshPro>();
_text.text = CustomGameModeManager.ActiveMode != null ? $"<color=#{CustomGameModeManager.ActiveMode.Color.ToHtmlStringRGBA()}>{CustomGameModeManager.ActiveMode.Name}</color>" : "Classic"; _text.text = CustomGameModeManager.ActiveMode != null ? CustomGameModeManager.ActiveMode.ColoredName : MiraLocaleManager.Get("gamemode.classic");
CustomGameModeManager.ActiveMode?.HudStart(instance); CustomGameModeManager.ActiveMode?.HudStart(instance);
} }
@@ -151,7 +151,7 @@ public static class LobbyViewPanePatches
var cgm = GetCustomGamemode(); var cgm = GetCustomGamemode();
ModifiersTabButton?.gameObject.SetActive(false); ModifiersTabButton?.gameObject.SetActive(false);
menu.rolesTabButton.gameObject.SetActive(cgm is null or { ShowNormalRoleSettings: true }); menu.rolesTabButton.gameObject.SetActive(cgm is null or { ShowNormalRoleSettings: true });
menu.gameModeText.text = cgm is null ? "Main" : cgm.ColoredName; menu.gameModeText.text = cgm is null ? MiraLocaleManager.Get("gamemode.classic") : cgm.ColoredName;
} }
else else
{ {
+3 -1
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<resources> <resources>
<string name="miraApi.name">Mira API</string> <string name="miraApi">Mira API</string>
<string name="miraApi.visualsUi">Visuals/UI</string> <string name="miraApi.visualsUi">Visuals/UI</string>
<string name="miraApi.freeplay">Freeplay</string> <string name="miraApi.freeplay">Freeplay</string>
<string name="miraApi.accessibility">Accessibility</string> <string name="miraApi.accessibility">Accessibility</string>
@@ -8,7 +8,9 @@
<string name="miraApi.showModifiersHudOnLeftSide">Show Modifiers HUD on Left Side</string> <string name="miraApi.showModifiersHudOnLeftSide">Show Modifiers HUD on Left Side</string>
<string name="miraApi.showKeybindsOnButtons">Show Keybinds on Buttons</string> <string name="miraApi.showKeybindsOnButtons">Show Keybinds on Buttons</string>
<string name="miraApi.buttonScaleFactor">Button Scale Factor</string> <string name="miraApi.buttonScaleFactor">Button Scale Factor</string>
<string name="miraApi.topRightButtonScaleFactor">Top-Right UI Scale Factor</string>
<string name="miraApi.maxFps">Max FPS</string> <string name="miraApi.maxFps">Max FPS</string>
<string name="miraApi.wikiOnBottomRow">Display Wiki on Bottom Row</string>
<string name="miraApi.prettyTaskLaptop">Pretty Task Laptop</string> <string name="miraApi.prettyTaskLaptop">Pretty Task Laptop</string>
<string name="miraApi.enableSabotageFlashes">Enable Sabotage Flashes</string> <string name="miraApi.enableSabotageFlashes">Enable Sabotage Flashes</string>
<string name="miraApi.enableSabotageBlare">Enable Sabotage Blare</string> <string name="miraApi.enableSabotageBlare">Enable Sabotage Blare</string>
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<resources> <resources>
<string name="miraApi.name">Mira API</string> <string name="miraApi">Mira API</string>
<string name="miraApi.visualsUi">界面/视觉</string> <string name="miraApi.visualsUi">界面/视觉</string>
<string name="miraApi.freeplay">自由模式</string> <string name="miraApi.freeplay">自由模式</string>
<string name="miraApi.accessibility">无障碍</string> <string name="miraApi.accessibility">无障碍</string>
@@ -17,7 +17,7 @@
<string name="miraApi.customCategory2">自定义类别 2</string> <string name="miraApi.customCategory2">自定义类别 2</string>
<string name="miraApi.modifierMenuDescription">在此配置附加职业及其设置!</string> <string name="miraApi.modifierMenuDescription">在此配置附加职业及其设置!</string>
<string name="miraApi.customOptionMenuDescription">为此模组应用游戏设置!</string> <string name="miraApi.customOptionMenuDescription">为此模组应用游戏设置!</string>
<string name="gamemode.default.name">默认</string> <string name="gamemode.default">默认</string>
<string name="gamemode.default.description">默认原版游戏模式</string> <string name="gamemode.default.description">默认原版游戏模式</string>
<string name="gamesetting.global.clicktoclose">点击关闭</string> <string name="gamesetting.global.clicktoclose">点击关闭</string>
<string name="gamesetting.preset.hint">为本游戏选择或创建一个预设</string> <string name="gamesetting.preset.hint">为本游戏选择或创建一个预设</string>