Resized DJUI menu panels so that other languages will fit

This commit is contained in:
MysterD 2023-03-31 22:05:37 -07:00
parent cf465418f9
commit 307981eab8
9 changed files with 20 additions and 20 deletions

View File

@ -71,7 +71,7 @@ struct DjuiBind* djui_bind_create(struct DjuiBase* parent, const char* message,
struct DjuiRect* rect = djui_rect_create(&bind->base);
djui_base_set_alignment(&rect->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_CENTER);
djui_base_set_size_type(&rect->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
djui_base_set_size(&rect->base, 0.8f, 1.0f);
djui_base_set_size(&rect->base, 0.7f, 1.0f);
djui_base_set_color(&rect->base, 0, 0, 0, 0);
bind->rect = rect;

View File

@ -1,8 +1,8 @@
#pragma once
#include "djui.h"
#define DJUI_DEFAULT_PANEL_WIDTH (410.0f + (16 * 2.0f))
#define DJUI_PANEL_HEADER_OFFSET (-8)
#define DJUI_DEFAULT_PANEL_WIDTH (500.0f + (16 * 2.0f))
#define DJUI_PANEL_HEADER_OFFSET (-16)
struct DjuiPanel {
struct DjuiBase* base;

View File

@ -9,7 +9,7 @@ void djui_panel_confirm_create(struct DjuiBase* caller, char* title, char* messa
djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&text->base, 1.0f, 64);
djui_base_set_color(&text->base, 200, 200, 200, 255);
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER);
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);
struct DjuiRect* rect1 = djui_rect_container_create(body, 64);
{

View File

@ -47,12 +47,12 @@ void djui_panel_display_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(DISPLAY, FRAME_LIMIT));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 32);
djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&inputbox1->base, 0.5f, 32);
djui_base_set_size(&inputbox1->base, 0.4f, 32);
djui_base_set_alignment(&inputbox1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
char frameLimitString[32] = { 0 };
snprintf(frameLimitString, 32, "%d", configFrameLimit);

View File

@ -85,7 +85,7 @@ void djui_panel_host_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(HOST, PORT));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
if (gNetworkType == NT_SERVER) {
djui_base_set_enabled(&text1->base, false);
@ -93,7 +93,7 @@ void djui_panel_host_create(struct DjuiBase* caller) {
struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 32);
djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&inputbox1->base, 0.5f, 32);
djui_base_set_size(&inputbox1->base, 0.4f, 32);
djui_base_set_alignment(&inputbox1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
char portString[32] = { 0 };
snprintf(portString, 32, "%d", configHostPort);
@ -114,13 +114,13 @@ void djui_panel_host_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect2->base, DLANG(HOST, SAVE_SLOT));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
char starString[32] = { 0 };
snprintf(starString, 32, "%c x%d", '~' + 1, save_file_get_total_star_count(configHostSaveSlot - 1, 0, 24));
struct DjuiButton* button1 = djui_button_create(&rect2->base, starString, DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_save_create);
djui_base_set_size(&button1->base, 0.5f, 32);
djui_base_set_size(&button1->base, 0.4f, 32);
djui_base_set_alignment(&button1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
}

View File

@ -68,12 +68,12 @@ void djui_panel_host_settings_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(HOST_SETTINGS, AMOUNT_OF_PLAYERS));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 32);
djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&inputbox1->base, 0.5f, 32);
djui_base_set_size(&inputbox1->base, 0.4f, 32);
djui_base_set_alignment(&inputbox1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
char limitString[32] = { 0 };
snprintf(limitString, 32, "%d", configAmountofPlayers);

View File

@ -139,12 +139,12 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(PLAYER, HEX_CODE));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
sHexColorTextBox = djui_inputbox_create(&rect1->base, 7);
djui_base_set_size_type(&sHexColorTextBox->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&sHexColorTextBox->base, 0.5f, 32);
djui_base_set_size(&sHexColorTextBox->base, 0.4f, 32);
djui_base_set_alignment(&sHexColorTextBox->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
djui_panel_player_edit_palette_update_hex_code_box();
djui_interactable_hook_value_change(&sHexColorTextBox->base, djui_panel_player_edit_palette_hex_code_changed);
@ -240,12 +240,12 @@ void djui_panel_player_create(struct DjuiBase* caller) {
struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(PLAYER, NAME));
djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_color(&text1->base, 200, 200, 200, 255);
djui_base_set_size(&text1->base, 0.485f, 64);
djui_base_set_size(&text1->base, 0.585f, 64);
djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 20);
djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&inputbox1->base, 0.5f, 32);
djui_base_set_size(&inputbox1->base, 0.4f, 32);
djui_base_set_alignment(&inputbox1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP);
if (djui_panel_player_name_valid(configPlayerName)) {
djui_inputbox_set_text(inputbox1, configPlayerName);

View File

@ -92,7 +92,7 @@ struct DjuiSelectionbox* djui_selectionbox_create(struct DjuiBase* parent, const
struct DjuiText* text = djui_text_create(&selectionbox->base, message);
djui_base_set_alignment(&text->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_CENTER);
djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
djui_base_set_size(&text->base, 0.5f, 1.0f);
djui_base_set_size(&text->base, 0.6f, 1.0f);
djui_text_set_alignment(text, DJUI_HALIGN_LEFT, DJUI_VALIGN_BOTTOM);
djui_text_set_drop_shadow(text, 120, 120, 120, 64);
selectionbox->text = text;
@ -100,7 +100,7 @@ struct DjuiSelectionbox* djui_selectionbox_create(struct DjuiBase* parent, const
struct DjuiRect* rect = djui_rect_create(&selectionbox->base);
djui_base_set_alignment(&rect->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_CENTER);
djui_base_set_size_type(&rect->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
djui_base_set_size(&rect->base, 0.5f, 1.0f);
djui_base_set_size(&rect->base, 0.4f, 1.0f);
djui_base_set_color(&rect->base, 0, 0, 0, 0);
djui_base_set_border_width(&rect->base, 2);
djui_base_set_padding(&rect->base, 2, 2, 0, 4);

View File

@ -114,7 +114,7 @@ struct DjuiSlider* djui_slider_create(struct DjuiBase* parent, const char* messa
struct DjuiText* text = djui_text_create(&slider->base, message);
djui_base_set_alignment(&text->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_CENTER);
djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
djui_base_set_size(&text->base, 0.5f, 1.0f);
djui_base_set_size(&text->base, 0.6f, 1.0f);
djui_text_set_alignment(text, DJUI_HALIGN_LEFT, DJUI_VALIGN_BOTTOM);
djui_text_set_drop_shadow(text, 120, 120, 120, 64);
slider->text = text;
@ -122,7 +122,7 @@ struct DjuiSlider* djui_slider_create(struct DjuiBase* parent, const char* messa
struct DjuiRect* rect = djui_rect_create(&slider->base);
djui_base_set_alignment(&rect->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_CENTER);
djui_base_set_size_type(&rect->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
djui_base_set_size(&rect->base, 0.5f, 1.0f);
djui_base_set_size(&rect->base, 0.4f, 1.0f);
djui_base_set_color(&rect->base, 0, 0, 0, 0);
djui_base_set_border_width(&rect->base, 2);
slider->rect = rect;