Fixed color display for kasino game status and added plinko

This commit is contained in:
barelyprofessional
2026-01-07 20:28:30 -06:00
parent 6f6359b6da
commit 2a77e760a1
3 changed files with 21 additions and 4 deletions

View File

@@ -92,7 +92,8 @@ internal static class KasinoGameSettingMap
new(WagerGame.LambChop, BuiltIn.Keys.KasinoLambchopEnabled, "lambchop"), new(WagerGame.LambChop, BuiltIn.Keys.KasinoLambchopEnabled, "lambchop"),
new(WagerGame.Keno, BuiltIn.Keys.KasinoKenoEnabled, "keno"), new(WagerGame.Keno, BuiltIn.Keys.KasinoKenoEnabled, "keno"),
new(WagerGame.CoinFlip, BuiltIn.Keys.KasinoCoinflipEnabled, "coinflip"), new(WagerGame.CoinFlip, BuiltIn.Keys.KasinoCoinflipEnabled, "coinflip"),
new(WagerGame.Slots, BuiltIn.Keys.KasinoSlotsEnabled, "slots") new(WagerGame.Slots, BuiltIn.Keys.KasinoSlotsEnabled, "slots"),
new(WagerGame.Plinko, BuiltIn.Keys.KasinoPlinkoEnabled, "plinko")
}; };
internal static KasinoGameSetting? FindByAlias(string alias) => internal static KasinoGameSetting? FindByAlias(string alias) =>
@@ -174,6 +175,10 @@ public class KasinoGameListCommand : ICommand
CancellationToken ctx) CancellationToken ctx)
{ {
var response = $"{user.FormatUsername()}, Kasino games:[br]"; var response = $"{user.FormatUsername()}, Kasino games:[br]";
var colors =
await SettingsProvider.GetMultipleValuesAsync([
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor
]);
foreach (var game in KasinoGameSettingMap.All foreach (var game in KasinoGameSettingMap.All
.OrderBy(g => g.Game.ToString())) .OrderBy(g => g.Game.ToString()))
@@ -183,8 +188,8 @@ public class KasinoGameListCommand : ICommand
.ToBoolean(); .ToBoolean();
var status = isEnabled var status = isEnabled
? $"[B][COLOR={BuiltIn.Keys.KiwiFarmsGreenColor}]ENABLED[/COLOR][/B]" ? $"[B][COLOR={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]ENABLED[/COLOR][/B]"
: $"[B][COLOR={BuiltIn.Keys.KiwiFarmsRedColor}]DISABLED[/COLOR][/B]"; : $"[B][COLOR={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]DISABLED[/COLOR][/B]";
response += $"{game.Game.Humanize()}: {status}[br]"; response += $"{game.Game.Humanize()}: {status}[br]";
} }

View File

@@ -50,8 +50,18 @@ public class PlinkoCommand : ICommand
decimal payout = 0; decimal payout = 0;
decimal currentPayout = 0; decimal currentPayout = 0;
var settings = await SettingsProvider.GetMultipleValuesAsync([ var settings = await SettingsProvider.GetMultipleValuesAsync([
BuiltIn.Keys.KasinoPlinkoCleanupDelay, BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor BuiltIn.Keys.KasinoPlinkoCleanupDelay, BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor,
BuiltIn.Keys.KasinoPlinkoEnabled, BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay
]); ]);
if (!settings[BuiltIn.Keys.KasinoPlinkoEnabled].ToBoolean())
{
var gameDisabledCleanupDelay= TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay].ToType<int>());
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, plinko is currently disabled.",
true, autoDeleteAfter: gameDisabledCleanupDelay);
return;
}
var cleanupDelay = TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoPlinkoCleanupDelay].ToType<int>()); var cleanupDelay = TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoPlinkoCleanupDelay].ToType<int>());
if (!arguments.TryGetValue("amount", out var amount)) if (!arguments.TryGetValue("amount", out var amount))
{ {

View File

@@ -498,6 +498,8 @@ public static class BuiltIn
public static string KasinoCoinflipEnabled = "Kasino.Coinflip.Enabled"; public static string KasinoCoinflipEnabled = "Kasino.Coinflip.Enabled";
[BuiltInSetting("Whether slots is enabled", SettingValueType.Boolean, "true", BooleanRegex)] [BuiltInSetting("Whether slots is enabled", SettingValueType.Boolean, "true", BooleanRegex)]
public static string KasinoSlotsEnabled = "Kasino.Slots.Enabled"; public static string KasinoSlotsEnabled = "Kasino.Slots.Enabled";
[BuiltInSetting("Whether plinko is enabled", SettingValueType.Boolean, "true", BooleanRegex)]
public static string KasinoPlinkoEnabled = "Kasino.Plinko.Enabled";
} }
} }