legacy color support

This commit is contained in:
BruceChen 2022-12-14 14:45:51 +08:00
parent 7900108763
commit 7ee08092d4
14 changed files with 116 additions and 97 deletions

View file

@ -163,7 +163,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogDebugToConsole(e);
}
@ -233,7 +233,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -249,7 +249,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -265,7 +265,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -291,7 +291,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -420,12 +420,12 @@ namespace MinecraftClient.ChatBots
});
IsConnected = true;
LogToConsole(y§l§f" + Translations.bot_DiscordBridge_connected);
LogToConsole(§2§l§f" + Translations.bot_DiscordBridge_connected);
await Task.Delay(-1);
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_DiscordBridge_unknown_error);
LogToConsole(§4§l§f" + Translations.bot_DiscordBridge_unknown_error);
LogToConsole(e);
return;
}

View file

@ -160,7 +160,7 @@ namespace MinecraftClient.ChatBots
{
if (!currentArg.Contains(':'))
{
LogToConsole(x§1§0" + string.Format(Translations.bot_farmer_warining_invalid_parameter, currentArg));
LogToConsole(§6§1§0" + string.Format(Translations.bot_farmer_warining_invalid_parameter, currentArg));
continue;
}
@ -168,7 +168,7 @@ namespace MinecraftClient.ChatBots
if (parts.Length != 2)
{
LogToConsole(x§1§0" + string.Format(Translations.bot_farmer_warining_invalid_parameter, currentArg));
LogToConsole(§6§1§0" + string.Format(Translations.bot_farmer_warining_invalid_parameter, currentArg));
continue;
}
@ -177,11 +177,11 @@ namespace MinecraftClient.ChatBots
case "r":
case "radius":
if (!int.TryParse(parts[1], NumberStyles.Any, CultureInfo.CurrentCulture, out radius))
LogToConsole(x§1§0" + Translations.bot_farmer_invalid_radius);
LogToConsole(§6§1§0" + Translations.bot_farmer_invalid_radius);
if (radius <= 0)
{
LogToConsole(x§1§0" + Translations.bot_farmer_invalid_radius);
LogToConsole(§6§1§0" + Translations.bot_farmer_invalid_radius);
radius = 30;
}
@ -194,7 +194,7 @@ namespace MinecraftClient.ChatBots
if (parts[1].Equals("true") || parts[1].Equals("1"))
{
LogToConsole(x§1§0" + Translations.bot_farmer_warining_force_unsafe);
LogToConsole(§6§1§0" + Translations.bot_farmer_warining_force_unsafe);
allowUnsafe = true;
}
else allowUnsafe = false;
@ -208,7 +208,7 @@ namespace MinecraftClient.ChatBots
if (parts[1].Equals("true") || parts[1].Equals("1"))
{
LogToConsole(w§1§f" + Translations.bot_farmer_warining_allow_teleport);
LogToConsole(§4§1§f" + Translations.bot_farmer_warining_allow_teleport);
allowTeleport = true;
}
else allowTeleport = false;
@ -252,9 +252,9 @@ namespace MinecraftClient.ChatBots
private void MainPorcess()
{
LogToConsole(y§1§f" + Translations.bot_farmer_started);
LogToConsole(y§1§f " + Translations.bot_farmer_crop_type + ": " + cropType);
LogToConsole(y§1§f " + Translations.bot_farmer_radius + ": " + farmingRadius);
LogToConsole(§2§1§f" + Translations.bot_farmer_started);
LogToConsole(§2§1§f " + Translations.bot_farmer_crop_type + ": " + cropType);
LogToConsole(§2§1§f " + Translations.bot_farmer_radius + ": " + farmingRadius);
while (running)
{

View file

@ -159,7 +159,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogDebugToConsole(e);
}
@ -209,7 +209,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -232,7 +232,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole(w§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogToConsole(§4§l§f" + Translations.bot_TelegramBridge_canceled_sending);
LogDebugToConsole(e);
}
}
@ -254,7 +254,7 @@ namespace MinecraftClient.ChatBots
}
if (string.IsNullOrEmpty(Config.ChannelId.Trim()))
LogToConsole(w§l§f" + Translations.bot_TelegramBridge_missing_channel_id);
LogToConsole(§4§l§f" + Translations.bot_TelegramBridge_missing_channel_id);
botClient = new TelegramBotClient(Config.Token.Trim());
cancellationToken = new CancellationTokenSource();
@ -273,12 +273,12 @@ namespace MinecraftClient.ChatBots
IsConnected = true;
SendMessage($"✅ {Translations.bot_TelegramBridge_connected}");
LogToConsole($"§y§l§f{Translations.bot_TelegramBridge_connected}");
LogToConsole($"§§2§l§f{Translations.bot_TelegramBridge_connected}");
if (Config.Authorized_Chat_Ids.Length == 0)
{
SendMessage($"⚠️ *{Translations.bot_TelegramBridge_missing_authorized_channels}* ⚠️");
LogToConsole($"§w§l§f{Translations.bot_TelegramBridge_missing_authorized_channels}");
LogToConsole($"§§4§l§f{Translations.bot_TelegramBridge_missing_authorized_channels}");
return;
}
@ -286,7 +286,7 @@ namespace MinecraftClient.ChatBots
}
catch (Exception e)
{
LogToConsole($"§w§l§f{Translations.bot_TelegramBridge_unknown_error}");
LogToConsole($"§§4§l§f{Translations.bot_TelegramBridge_unknown_error}");
LogToConsole(e);
return;
}
@ -368,7 +368,7 @@ namespace MinecraftClient.ChatBots
_ => exception.ToString()
};
LogToConsole(w§l§f" + ErrorMessage);
LogToConsole(§4§l§f" + ErrorMessage);
return Task.CompletedTask;
}
}