mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-05 20:40:29 -08:00
Final tweaks
This commit is contained in:
@@ -66,7 +66,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gangs.WardenIconPerk", "mod
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gangs.SpecialIconPerk", "mod\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj", "{7F4BCD17-658C-4928-9AC1-61EFDEABDF5C}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gangs.SpecialIconPerk", "mod\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj", "{7F4BCD17-658C-4928-9AC1-61EFDEABDF5C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WardenPaintColorPerk", "mod\WardenPaintColorPerk\WardenPaintColorPerk.csproj", "{71D8A1A7-EB94-485A-82CC-D2D5124FE690}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gangs.WardenPaintColorPerk", "mod\Gangs.WardenPaintColorPerk\Gangs.WardenPaintColorPerk.csproj", "{71D8A1A7-EB94-485A-82CC-D2D5124FE690}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public abstract class AbstractEnumCommand<T>(IServiceProvider provider,
|
|||||||
|
|
||||||
await playerStats.SetForPlayer(executor, statId, val);
|
await playerStats.SetForPlayer(executor, statId, val);
|
||||||
executor.PrintToChat(
|
executor.PrintToChat(
|
||||||
$"{localizer.Get(MSG.PREFIX)}Set your {ChatColors.BlueGrey + title}{ChatColors.Grey} to {formatItem(val)}.");
|
$"{localizer.Get(MSG.PREFIX)}Set your {title} to {formatItem(val)}.");
|
||||||
return CommandResult.SUCCESS;
|
return CommandResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ProjectReference Include="..\Gangs.SpecialDayColorPerk\Gangs.SpecialDayColorPerk.csproj"/>
|
<ProjectReference Include="..\Gangs.SpecialDayColorPerk\Gangs.SpecialDayColorPerk.csproj"/>
|
||||||
<ProjectReference Include="..\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj"/>
|
<ProjectReference Include="..\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj"/>
|
||||||
<ProjectReference Include="..\Gangs.WardenIconPerk\Gangs.WardenIconPerk.csproj"/>
|
<ProjectReference Include="..\Gangs.WardenIconPerk\Gangs.WardenIconPerk.csproj"/>
|
||||||
<ProjectReference Include="..\WardenPaintColorPerk\WardenPaintColorPerk.csproj" />
|
<ProjectReference Include="..\Gangs.WardenPaintColorPerk\Gangs.WardenPaintColorPerk.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Gangs.BombIconPerk;
|
using CounterStrikeSharp.API.Modules.Utils;
|
||||||
|
using Gangs.BaseImpl.Extensions;
|
||||||
|
using Gangs.BombIconPerk;
|
||||||
using GangsAPI;
|
using GangsAPI;
|
||||||
using GangsAPI.Data;
|
using GangsAPI.Data;
|
||||||
using GangsAPI.Data.Command;
|
using GangsAPI.Data.Command;
|
||||||
@@ -124,7 +126,8 @@ public class SDColorCommand(IServiceProvider provider) : ICommand {
|
|||||||
|
|
||||||
await gangChat.SendGangChat(player, gang,
|
await gangChat.SendGangChat(player, gang,
|
||||||
localizer.Get(MSG.GANG_THING_SET, "SD Color",
|
localizer.Get(MSG.GANG_THING_SET, "SD Color",
|
||||||
color.ToString().ToTitleCase()));
|
color.GetColor().GetChatColor() + color.ToString().ToTitleCase()
|
||||||
|
+ ChatColors.Grey));
|
||||||
return CommandResult.SUCCESS;
|
return CommandResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ public class SDColorMenu(IServiceProvider provider, SDColorData data)
|
|||||||
|
|
||||||
override protected string formatItem(SDColor item) {
|
override protected string formatItem(SDColor item) {
|
||||||
if (item == SDColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
if (item == SDColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
||||||
return $"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}";
|
return
|
||||||
|
$"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}{ChatColors.Grey}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<RootNamespace>WardenPaintColorPerk</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Gangs.BaseImpl;
|
using CounterStrikeSharp.API.Modules.Utils;
|
||||||
|
using Gangs.BaseImpl;
|
||||||
using Gangs.BaseImpl.Extensions;
|
using Gangs.BaseImpl.Extensions;
|
||||||
using GangsAPI.Data;
|
using GangsAPI.Data;
|
||||||
using Jailbreak.Public.Extensions;
|
using Jailbreak.Public.Extensions;
|
||||||
@@ -23,6 +24,7 @@ public class WardenColorCommand(IServiceProvider provider)
|
|||||||
|
|
||||||
override protected string formatItem(WardenPaintColor item) {
|
override protected string formatItem(WardenPaintColor item) {
|
||||||
if (item == WardenPaintColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
if (item == WardenPaintColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
||||||
return $"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}";
|
return
|
||||||
|
$"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}{ChatColors.Grey}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Gangs.BaseImpl;
|
using CounterStrikeSharp.API.Modules.Utils;
|
||||||
|
using Gangs.BaseImpl;
|
||||||
using Gangs.BaseImpl.Extensions;
|
using Gangs.BaseImpl.Extensions;
|
||||||
using Jailbreak.Public.Extensions;
|
using Jailbreak.Public.Extensions;
|
||||||
using Jailbreak.Public.Mod.Rainbow;
|
using Jailbreak.Public.Mod.Rainbow;
|
||||||
@@ -19,6 +20,7 @@ public class WardenPaintColorMenu(IServiceProvider provider,
|
|||||||
|
|
||||||
override protected string formatItem(WardenPaintColor item) {
|
override protected string formatItem(WardenPaintColor item) {
|
||||||
if (item == WardenPaintColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
if (item == WardenPaintColor.RAINBOW) return IRainbowColorizer.RAINBOW;
|
||||||
return $"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}";
|
return
|
||||||
|
$"{item.GetColor().GetChatColor()}{item.ToString().ToTitleCase()}{ChatColors.Grey}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<ProjectReference Include="..\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj"/>
|
<ProjectReference Include="..\Gangs.SpecialIconPerk\Gangs.SpecialIconPerk.csproj"/>
|
||||||
<ProjectReference Include="..\Gangs.WardenIconPerk\Gangs.WardenIconPerk.csproj"/>
|
<ProjectReference Include="..\Gangs.WardenIconPerk\Gangs.WardenIconPerk.csproj"/>
|
||||||
<ProjectReference Include="..\Jailbreak.Zones\Jailbreak.Zones.csproj"/>
|
<ProjectReference Include="..\Jailbreak.Zones\Jailbreak.Zones.csproj"/>
|
||||||
<ProjectReference Include="..\WardenPaintColorPerk\WardenPaintColorPerk.csproj" />
|
<ProjectReference Include="..\Gangs.WardenPaintColorPerk\Gangs.WardenPaintColorPerk.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class WardenPaintBehavior(IWardenService wardenService,
|
|||||||
provider.GetService<IRainbowColorizer>();
|
provider.GetService<IRainbowColorizer>();
|
||||||
|
|
||||||
private WardenPaintColor?[] colors = new WardenPaintColor?[65];
|
private WardenPaintColor?[] colors = new WardenPaintColor?[65];
|
||||||
|
private bool[] fetched = new bool[65];
|
||||||
|
|
||||||
public void Start(BasePlugin basePlugin) {
|
public void Start(BasePlugin basePlugin) {
|
||||||
parent = basePlugin;
|
parent = basePlugin;
|
||||||
@@ -34,7 +35,8 @@ public class WardenPaintBehavior(IWardenService wardenService,
|
|||||||
|
|
||||||
[GameEventHandler]
|
[GameEventHandler]
|
||||||
public HookResult OnRoundStart(EventRoundStart ev, GameEventInfo info) {
|
public HookResult OnRoundStart(EventRoundStart ev, GameEventInfo info) {
|
||||||
colors = new WardenPaintColor?[65];
|
colors = new WardenPaintColor?[65];
|
||||||
|
fetched = new bool[65];
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +85,8 @@ public class WardenPaintBehavior(IWardenService wardenService,
|
|||||||
return color.Value.GetColor() ?? Color.White;
|
return color.Value.GetColor() ?? Color.White;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fetched[player.Index]) return Color.White;
|
||||||
|
fetched[player.Index] = true;
|
||||||
var wrapper = new PlayerWrapper(player);
|
var wrapper = new PlayerWrapper(player);
|
||||||
Task.Run(async () => {
|
Task.Run(async () => {
|
||||||
color = await fetchColor(wrapper);
|
color = await fetchColor(wrapper);
|
||||||
@@ -118,6 +122,9 @@ public class WardenPaintBehavior(IWardenService wardenService,
|
|||||||
var (_, available) = await gangStats.GetForGang<WardenPaintColor>(gang,
|
var (_, available) = await gangStats.GetForGang<WardenPaintColor>(gang,
|
||||||
WardenPaintColorPerk.WardenPaintColorPerk.STAT_ID);
|
WardenPaintColorPerk.WardenPaintColorPerk.STAT_ID);
|
||||||
|
|
||||||
|
if (playerColors == WardenPaintColor.RANDOM)
|
||||||
|
return playerColors | available;
|
||||||
|
|
||||||
return playerColors & available;
|
return playerColors & available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user