fix string & add animation

This commit is contained in:
Gurge44 committed 2025-10-05 13:39:10 +02:00
1 parent f0f8ed2619
commit 2a3add98f7
4 files changed
+26 -8

No files matched your search

+3 -1
View File
@@ -160,7 +160,7 @@ public static class Deathrace
.SetGameMode(gameMode)
.SetValueFormat(OptionFormat.Multiplier);
EnergyDrinkSpeedIncreasementOption = new FloatOptionItem(id++, "Deathrace.EnergyDrinkSpeedIncreasementOption", new(0.05f, 1f, 0.05f), 0.25f, tab)
EnergyDrinkSpeedIncreasementOption = new FloatOptionItem(id++, "Deathrace.EnergyDrinkSpeedIncreasementOption", new(0.05f, 3f, 0.05f), 0.5f, tab)
.SetParent(SpawnPowerUpsOption)
.SetColor(color)
.SetGameMode(gameMode)
@@ -470,6 +470,8 @@ public static class Deathrace
removeId = id;
continue;
}
if (data.Player.inMovingPlat) continue;
if (SpawnedPowerUps.FindFirst(x => Vector2.Distance(data.Player.Pos(), x.Position) <= PowerUpPickupRange, out var powerUp))
{
+3
View File
@@ -125,6 +125,9 @@ public static class Translator
if (SubmergedCompatibility.IsSubmerged() && int.TryParse(s, out int roomNumber) && roomNumber is >= 128 and <= 135)
s = $"SubmergedRoomName.{roomNumber}";
if (GameStates.InGame && Options.CurrentGameMode == CustomGameMode.Deathrace && int.TryParse(s, out roomNumber) && Deathrace.CoordinateChecks.ContainsKey(roomNumber))
s = "Deathrace.CoordinateCheck";
SupportedLangs langId = TranslationController.InstanceExists ? TranslationController.Instance.currentLanguage.languageID : SupportedLangs.English;
if (console) langId = SupportedLangs.English;
+18 -5
View File
@@ -955,6 +955,8 @@ internal static class TaskPanelBehaviourPatch
return newPanel;
}
private const float PosSmoothSpeed = 8f; // bigger = faster
internal static void UpdateRoleTab(TaskPanelBehaviour panel, CustomRoles role)
{
var tabText = panel.tab.gameObject.GetComponentInChildren<TextMeshPro>();
@@ -963,19 +965,24 @@ internal static class TaskPanelBehaviourPatch
if (tabText.text != panelName) tabText.text = panelName;
float y = ogPanel.taskText.textBounds.size.y + 1;
panel.closedPosition = new Vector3(ogPanel.closedPosition.x, ogPanel.open ? y : 2f, ogPanel.closedPosition.z);
panel.openPosition = new Vector3(ogPanel.openPosition.x, ogPanel.open ? y : 2f, ogPanel.openPosition.z);
Vector3 targetClosed = new Vector3(ogPanel.closedPosition.x, ogPanel.open ? y + 0.2f : 2f, ogPanel.closedPosition.z);
Vector3 targetOpen = new Vector3(ogPanel.openPosition.x, ogPanel.open ? y : 2f, ogPanel.openPosition.z);
float t = 1f - Mathf.Exp(-PosSmoothSpeed * Time.deltaTime);
panel.closedPosition = Vector3.Lerp(panel.closedPosition, targetClosed, t);
panel.openPosition = Vector3.Lerp(panel.openPosition, targetOpen, t);
PlayerControl player = PlayerControl.LocalPlayer;
string roleInfo = player.GetRoleInfo();
var roleWithInfo = $"{role.ToColoredString()}:\r\n{roleInfo}";
var roleWithInfo = $"<b>{role.ToColoredString()}</b>:\r\n{roleInfo}";
if (Options.CurrentGameMode != CustomGameMode.Standard)
{
string[] splitted = roleInfo.Split(' ');
roleWithInfo = $"{GetString($"{Options.CurrentGameMode}")}\r\n" + (splitted.Length <= 3
roleWithInfo = $"<b>{GetString($"{Options.CurrentGameMode}")}</b>:\r\n" + (splitted.Length <= 3
? $"{roleInfo}\r\n"
: $"{string.Join(' ', splitted[..3])}\r\n{string.Join(' ', splitted[3..])}\r\n");
}
@@ -983,7 +990,7 @@ internal static class TaskPanelBehaviourPatch
{
string[] split = roleInfo.Split(' ');
int half = split.Length / 2;
roleWithInfo = $"{role.ToColoredString()}:\r\n{string.Join(' ', split[..half])}\r\n{string.Join(' ', split[half..])}";
roleWithInfo = $"<b>{role.ToColoredString()}</b>:\r\n{string.Join(' ', split[..half])}\r\n{string.Join(' ', split[half..])}";
}
string finalText = Utils.ColorString(player.GetRoleColor(), roleWithInfo);
@@ -1147,6 +1154,12 @@ internal static class TaskPanelBehaviourPatch
var tabText = __instance.tab.transform.FindChild("TabText_TMP").GetComponent<TextMeshPro>();
tabText.SetText($"{TranslationController.Instance.GetString(StringNames.Tasks)}{Utils.GetTaskCount(PlayerControl.LocalPlayer.PlayerId, Utils.IsActive(SystemTypes.Comms))}");
}
else
{
__instance.transform.localPosition = new Vector3(10000f, 10000f, 0f);
return false;
}
return true;
}
+2 -2
View File
@@ -5341,10 +5341,10 @@
"Deathrace.PowerUpInfo.Taser": "<#ffffff>[<#00ffa5>KILL</color>]</color> {0} Taser: Stuns the selected player",
"Deathrace.PowerUpInfo.EnergyDrink": "<#ffffff>[<#00ffff>VANISH</color>]</color> {0} Energy Drink: Speeds you up",
"Deathrace.PowerUpInfo.Grenade": "<#ffffff>[<#00ffff>VANISH</color>]</color> {0} Grenade: Blinds everyone nearby (except you)",
"Deathrace.PowerUpInfo.Ice": "<#ffffff>[<#00ffff>VANISH</color>]</color> {0} Ice: Freezes everyone nearby (except you)",
"Deathrace.PowerUpInfo.Ice": "<#ffffff>[<#00ffff>VANISH</color>]</color> {0} Ice: Inverts controls for everyone nearby (except you)",
"Deathrace.PowerUpInfo.More": "+{0} More Power-Ups Stored",
"Deathrace.CoordinateCheck": "[Position Check]",
"Deathrace.CoordinateCheckInfo.100": "Exit on the left side of Cafeteria\\nTowards Splash Zone",
"Deathrace.CoordinateCheckInfo.100": "Exit this room on the left side",
"Racer": "DEATHRACE",
"RacerInfo": "COMPLETE ALL LAPS FIRST TO WIN",
"RacerInfoLong": "COMPLETE ALL LAPS FIRST TO WIN",