Added Chat Width Config Setting

This commit is contained in:
iZePlayzYT 2025-09-28 06:03:54 +02:00
parent 6c48a5c115
commit b2f029bea7
15 changed files with 37 additions and 1 deletions

View file

@ -323,6 +323,7 @@ MISC_TITLE = "JINE"
PAUSE_IN_SINGLEPLAYER = "Pauza v hře s jedním hráčem"
DISABLE_POPUPS = "Vypnout vyskakovací okna"
USE_STANDARD_KEY_BINDINGS_CHAT = "Použít ovládání chatu Terminal/CMD"
CHAT_WIDTH = "Šířka chatu"
MENU_OPTIONS = "Nastavení hlavního menu"
INFORMATION = "Informace"
DEBUG = "Debug"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Pauzeer in een speler"
DISABLE_POPUPS = "Popups uitzetten"
USE_STANDARD_KEY_BINDINGS_CHAT = "Terminal/CMD Chatbox besturingen gebruiken"
CHAT_WIDTH = "Chatbreedte"
MENU_OPTIONS = "Menu Instellingen"
INFORMATION = "Informatie"
DEBUG = "Debug"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Pause In Singleplayer"
DISABLE_POPUPS = "Disable Popups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Use Terminal/CMD Chatbox Controls"
CHAT_WIDTH = "Chat Width"
MENU_OPTIONS = "Menu Options"
INFORMATION = "Info"
DEBUG = "Debug"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "AUTRES"
PAUSE_IN_SINGLEPLAYER = "Pause en Solo"
DISABLE_POPUPS = "Désactiver les Pop-ups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Utiliser les contrôles de chat Terminal/CMD"
CHAT_WIDTH = "Largeur du chat"
MENU_OPTIONS = "Options du menu"
INFORMATION = "Information"
DEBUG = "Débogage"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "SONSTIGES"
PAUSE_IN_SINGLEPLAYER = "Pause im Einzelspieler"
DISABLE_POPUPS = "Pop-ups deaktivieren"
USE_STANDARD_KEY_BINDINGS_CHAT = "Terminal/CMD Chatbox-Steuerung verwenden"
CHAT_WIDTH = "Chatbreite"
MENU_OPTIONS = "Menüoptionen"
INFORMATION = "Info"
DEBUG = "Debug"

View file

@ -321,6 +321,7 @@ MISC_TITLE = "VARIE"
PAUSE_IN_SINGLEPLAYER = "Pausa in Giocatore Singolo"
DISABLE_POPUPS = "Disabilita Popup"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usa controlli chat Terminale/CMD"
CHAT_WIDTH = "Larghezza chat"
MENU_OPTIONS = "Opzioni Menù"
INFORMATION = "Informazione"
DEBUG = "Debug"

View file

@ -324,6 +324,7 @@ MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "ソロプレイでの一時停止"
DISABLE_POPUPS = "ポップアップを無効にする"
USE_STANDARD_KEY_BINDINGS_CHAT = "ターミナル/CMDチャットボックスコントロールを使用"
CHAT_WIDTH = "チャット幅"
MENU_OPTIONS = "メニューの設定"
INFORMATION = "情報"
DEBUG = "デバッグ"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "POZOSTAŁE OPCJE"
PAUSE_IN_SINGLEPLAYER = "Pauza w Trybie Pojedynczego Gracza"
DISABLE_POPUPS = "Wyłącz Dymki Powiadomień"
USE_STANDARD_KEY_BINDINGS_CHAT = "Użyj sterowania czatu Terminal/CMD"
CHAT_WIDTH = "Szerokość czatu"
MENU_OPTIONS = "Opcje Menu"
INFORMATION = "Informacja"
DEBUG = "Debugowanie"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "OUTROS"
PAUSE_IN_SINGLEPLAYER = "Pausar com apenas um jogador"
DISABLE_POPUPS = "Desativar pop-ups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usar controles de chat Terminal/CMD"
CHAT_WIDTH = "Largura do chat"
MENU_OPTIONS = "Opções de menu"
INFORMATION = "Informações"
DEBUG = "Debug"

View file

@ -322,6 +322,7 @@ MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Пауза в одиночной игре"
DISABLE_POPUPS = "Отключить всплывающие окна"
USE_STANDARD_KEY_BINDINGS_CHAT = "Использовать управление чатом Terminal/CMD"
CHAT_WIDTH = "Ширина чата"
MENU_OPTIONS = "Параметры меню"
INFORMATION = "Информация"
DEBUG = "Отладка"

View file

@ -323,6 +323,7 @@ MISC_TITLE = "OTROS"
PAUSE_IN_SINGLEPLAYER = "Pausa en modo de un jugador"
DISABLE_POPUPS = "Deshabilitar mensajes emergentes"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usar controles de chat Terminal/CMD"
CHAT_WIDTH = "Ancho del chat"
MENU_OPTIONS = "Opciones del menú"
INFORMATION = "Información"
DEBUG = "Depuración"

View file

@ -133,6 +133,7 @@ unsigned int configGamepadNumber = 0;
bool configBackgroundGamepad = true;
bool configDisableGamepads = false;
bool configUseStandardKeyBindingsChat = true;
unsigned int configChatWidth = 800;
bool configSmoothScrolling = false;
// free camera settings
bool configEnableFreeCamera = false;
@ -279,6 +280,7 @@ static const struct ConfigOption options[] = {
{.name = "disable_gamepads", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisableGamepads},
#endif
{.name = "use_standard_key_bindings_chat", .type = CONFIG_TYPE_BOOL, .boolValue = &configUseStandardKeyBindingsChat},
{.name = "chat_width", .type = CONFIG_TYPE_UINT, .uintValue = &configChatWidth},
{.name = "smooth_scrolling", .type = CONFIG_TYPE_BOOL, .boolValue = &configSmoothScrolling},
{.name = "stick_rotate_left", .type = CONFIG_TYPE_BOOL, .boolValue = &configStick.rotateLeft},
{.name = "stick_invert_left_x", .type = CONFIG_TYPE_BOOL, .boolValue = &configStick.invertLeftX},

View file

@ -96,6 +96,7 @@ extern unsigned int configGamepadNumber;
extern bool configBackgroundGamepad;
extern bool configDisableGamepads;
extern bool configUseStandardKeyBindingsChat;
extern unsigned int configChatWidth;
extern bool configSmoothScrolling;
// free camera settings
extern bool configEnableFreeCamera;

View file

@ -645,7 +645,7 @@ struct DjuiChatBox* djui_chat_box_create(void) {
djui_base_init(&gDjuiRoot->base, base, djui_chat_box_render, djui_chat_box_destroy);
djui_base_set_size_type(base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(base, 800, 400);
djui_base_set_size(base, configChatWidth, 400);
djui_base_set_alignment(base, DJUI_HALIGN_LEFT, DJUI_VALIGN_BOTTOM);
djui_base_set_color(base, 0, 0, 0, 0);
djui_base_set_padding(base, 0, 8, 8, 8);

View file

@ -42,6 +42,28 @@ void djui_panel_controls_create(struct DjuiBase* caller) {
#endif
djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL);
static unsigned int sChatWidthIndex = 3;
switch (configChatWidth) {
case 500: sChatWidthIndex = 0; break;
case 600: sChatWidthIndex = 1; break;
case 700: sChatWidthIndex = 2; break;
case 800: sChatWidthIndex = 3; break;
case 900: sChatWidthIndex = 4; break;
case 1000: sChatWidthIndex = 5; break;
default: sChatWidthIndex = 3; break;
}
char* chatWidthChoices[] = { "500", "600", "700", "800", "900", "1000" };
void on_chat_width_change(struct DjuiBase* b) {
unsigned int idx = sChatWidthIndex;
unsigned int widths[] = {500,600,700,800,900,1000};
configChatWidth = widths[idx];
if (gDjuiChatBox != NULL) {
djui_base_set_size(&gDjuiChatBox->base, configChatWidth, gDjuiChatBox->base.height.value);
}
}
djui_selectionbox_create(body, DLANG(MISC, CHAT_WIDTH), chatWidthChoices, 6, &sChatWidthIndex, on_chat_width_change);
#ifdef HAVE_SDL2
int numJoys = SDL_NumJoysticks();
if (numJoys == 0) { numJoys = 1; }