mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Add DJUI Gradients, fix version clipping and camera unlock
This commit is contained in:
parent
211ad82937
commit
bcfd4ace75
24 changed files with 77 additions and 28 deletions
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "Stupnice DJUI"
|
||||||
DJUI_FONT = "DJUI Font"
|
DJUI_FONT = "DJUI Font"
|
||||||
AUTO = "Automatický"
|
AUTO = "Automatický"
|
||||||
CENTER = "Střed"
|
CENTER = "Střed"
|
||||||
|
GRADIENTS = "Gradienty"
|
||||||
FONT_NORMAL = "Normální"
|
FONT_NORMAL = "Normální"
|
||||||
FONT_ALIASED = "Hladký"
|
FONT_ALIASED = "Hladký"
|
||||||
LIGHT_THEME = "Světlo"
|
LIGHT_THEME = "Světlo"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "DJUI Schaal"
|
||||||
DJUI_FONT = "DJUI-lettertype"
|
DJUI_FONT = "DJUI-lettertype"
|
||||||
AUTO = "Automatisch"
|
AUTO = "Automatisch"
|
||||||
CENTER = "Centreren"
|
CENTER = "Centreren"
|
||||||
|
GRADIENTS = "Kleurverlopen"
|
||||||
FONT_NORMAL = "Normaal"
|
FONT_NORMAL = "Normaal"
|
||||||
FONT_ALIASED = "Glad"
|
FONT_ALIASED = "Glad"
|
||||||
LIGHT_THEME = "Licht"
|
LIGHT_THEME = "Licht"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "DJUI Scale"
|
||||||
DJUI_FONT = "DJUI Font"
|
DJUI_FONT = "DJUI Font"
|
||||||
AUTO = "Auto"
|
AUTO = "Auto"
|
||||||
CENTER = "DJUI Center"
|
CENTER = "DJUI Center"
|
||||||
|
GRADIENTS = "DJUI Gradients"
|
||||||
FONT_NORMAL = "Normal"
|
FONT_NORMAL = "Normal"
|
||||||
FONT_ALIASED = "Aliased"
|
FONT_ALIASED = "Aliased"
|
||||||
LIGHT_THEME = "Light"
|
LIGHT_THEME = "Light"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "Échelle DJUI"
|
||||||
DJUI_FONT = "Police DJUI"
|
DJUI_FONT = "Police DJUI"
|
||||||
AUTO = "Automatique"
|
AUTO = "Automatique"
|
||||||
CENTER = "Centrer le menu"
|
CENTER = "Centrer le menu"
|
||||||
|
GRADIENTS = "Dégradés"
|
||||||
FONT_NORMAL = "Normal"
|
FONT_NORMAL = "Normal"
|
||||||
FONT_ALIASED = "Lisse"
|
FONT_ALIASED = "Lisse"
|
||||||
LIGHT_THEME = "Clair"
|
LIGHT_THEME = "Clair"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "DJUI-Skala"
|
||||||
DJUI_FONT = "DJUI-Schriftart"
|
DJUI_FONT = "DJUI-Schriftart"
|
||||||
AUTO = "Automatisch"
|
AUTO = "Automatisch"
|
||||||
CENTER = "Zentrieren"
|
CENTER = "Zentrieren"
|
||||||
|
GRADIENTS = "Farbverläufe"
|
||||||
FONT_NORMAL = "Normal"
|
FONT_NORMAL = "Normal"
|
||||||
FONT_ALIASED = "Glatt"
|
FONT_ALIASED = "Glatt"
|
||||||
LIGHT_THEME = "Litch"
|
LIGHT_THEME = "Litch"
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ DJUI_SCALE = "Scala DJUI"
|
||||||
DJUI_FONT = "Font DJUI"
|
DJUI_FONT = "Font DJUI"
|
||||||
AUTO = "Automatico"
|
AUTO = "Automatico"
|
||||||
CENTER = "Centrare"
|
CENTER = "Centrare"
|
||||||
|
GRADIENTS = "Gradienti"
|
||||||
FONT_NORMAL = "Normale"
|
FONT_NORMAL = "Normale"
|
||||||
FONT_ALIASED = "Liscio"
|
FONT_ALIASED = "Liscio"
|
||||||
LIGHT_THEME = "Luce"
|
LIGHT_THEME = "Luce"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "DJUIのサイズ"
|
||||||
DJUI_FONT = "DJUIのフォント"
|
DJUI_FONT = "DJUIのフォント"
|
||||||
AUTO = "自動"
|
AUTO = "自動"
|
||||||
CENTER = "中心にDJUIを表示"
|
CENTER = "中心にDJUIを表示"
|
||||||
|
GRADIENTS = "グラデーション"
|
||||||
FONT_NORMAL = "普通"
|
FONT_NORMAL = "普通"
|
||||||
FONT_ALIASED = "エイリアス"
|
FONT_ALIASED = "エイリアス"
|
||||||
LIGHT_THEME = "ライト"
|
LIGHT_THEME = "ライト"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "Skala DJUI"
|
||||||
DJUI_FONT = "Czcionka DJUI"
|
DJUI_FONT = "Czcionka DJUI"
|
||||||
AUTO = "Automatyczna"
|
AUTO = "Automatyczna"
|
||||||
CENTER = "Wyśrodkowane"
|
CENTER = "Wyśrodkowane"
|
||||||
|
GRADIENTS = "Gradienty"
|
||||||
FONT_NORMAL = "Normalna"
|
FONT_NORMAL = "Normalna"
|
||||||
FONT_ALIASED = "Wygładzona"
|
FONT_ALIASED = "Wygładzona"
|
||||||
LIGHT_THEME = "Jasny"
|
LIGHT_THEME = "Jasny"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "Tamanho da DJUI"
|
||||||
DJUI_FONT = "Fonte da DJUI"
|
DJUI_FONT = "Fonte da DJUI"
|
||||||
AUTO = "Automático"
|
AUTO = "Automático"
|
||||||
CENTER = "Centralizar"
|
CENTER = "Centralizar"
|
||||||
|
GRADIENTS = "Gradientes"
|
||||||
FONT_NORMAL = "Normal"
|
FONT_NORMAL = "Normal"
|
||||||
FONT_ALIASED = "Suave"
|
FONT_ALIASED = "Suave"
|
||||||
LIGHT_THEME = "Claro"
|
LIGHT_THEME = "Claro"
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ DJUI_SCALE = "Шкала DJUI"
|
||||||
DJUI_FONT = "Шрифт DJUI"
|
DJUI_FONT = "Шрифт DJUI"
|
||||||
AUTO = "Автоматический"
|
AUTO = "Автоматический"
|
||||||
CENTER = "Центр"
|
CENTER = "Центр"
|
||||||
|
GRADIENTS = "Градиенты"
|
||||||
FONT_NORMAL = "Обычный"
|
FONT_NORMAL = "Обычный"
|
||||||
FONT_ALIASED = "Гладкий"
|
FONT_ALIASED = "Гладкий"
|
||||||
LIGHT_THEME = "Свет"
|
LIGHT_THEME = "Свет"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ DJUI_SCALE = "Tamaño de DJUI"
|
||||||
DJUI_FONT = "Fuente DJUI"
|
DJUI_FONT = "Fuente DJUI"
|
||||||
AUTO = "Automático"
|
AUTO = "Automático"
|
||||||
CENTER = "Centrar"
|
CENTER = "Centrar"
|
||||||
|
GRADIENTS = "Gradientes"
|
||||||
FONT_NORMAL = "Normal"
|
FONT_NORMAL = "Normal"
|
||||||
FONT_ALIASED = "Alias"
|
FONT_ALIASED = "Alias"
|
||||||
LIGHT_THEME = "Claro"
|
LIGHT_THEME = "Claro"
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@ bool configDjuiThemeCenter = false;
|
||||||
#else
|
#else
|
||||||
bool configDjuiThemeCenter = true;
|
bool configDjuiThemeCenter = true;
|
||||||
#endif
|
#endif
|
||||||
|
bool configDjuiThemeGradients = true;
|
||||||
unsigned int configDjuiThemeFont = FONT_NORMAL;
|
unsigned int configDjuiThemeFont = FONT_NORMAL;
|
||||||
unsigned int configDjuiScale = 0;
|
unsigned int configDjuiScale = 0;
|
||||||
// other
|
// other
|
||||||
|
|
@ -344,6 +345,7 @@ static const struct ConfigOption options[] = {
|
||||||
// DJUI settings
|
// DJUI settings
|
||||||
{.name = "djui_theme", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiTheme},
|
{.name = "djui_theme", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiTheme},
|
||||||
{.name = "djui_theme_center", .type = CONFIG_TYPE_BOOL, .boolValue = &configDjuiThemeCenter},
|
{.name = "djui_theme_center", .type = CONFIG_TYPE_BOOL, .boolValue = &configDjuiThemeCenter},
|
||||||
|
{.name = "djui_theme_gradients", .type = CONFIG_TYPE_BOOL, .boolValue = &configDjuiThemeGradients},
|
||||||
{.name = "djui_theme_font", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiThemeFont},
|
{.name = "djui_theme_font", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiThemeFont},
|
||||||
{.name = "djui_scale", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiScale},
|
{.name = "djui_scale", .type = CONFIG_TYPE_UINT, .uintValue = &configDjuiScale},
|
||||||
// other
|
// other
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ extern char configDestId[MAX_CONFIG_STRING];
|
||||||
// DJUI settings
|
// DJUI settings
|
||||||
extern unsigned int configDjuiTheme;
|
extern unsigned int configDjuiTheme;
|
||||||
extern bool configDjuiThemeCenter;
|
extern bool configDjuiThemeCenter;
|
||||||
|
extern bool configDjuiThemeGradients;
|
||||||
extern unsigned int configDjuiThemeFont;
|
extern unsigned int configDjuiThemeFont;
|
||||||
extern unsigned int configDjuiScale;
|
extern unsigned int configDjuiScale;
|
||||||
// other
|
// other
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ bool gDjuiInMainMenu = true;
|
||||||
bool gDjuiInPlayerMenu = false;
|
bool gDjuiInPlayerMenu = false;
|
||||||
bool gDjuiDisabled = false;
|
bool gDjuiDisabled = false;
|
||||||
bool gDjuiShuttingDown = false;
|
bool gDjuiShuttingDown = false;
|
||||||
|
bool gDjuiChangingTheme = false;
|
||||||
static bool sDjuiInited = false;
|
static bool sDjuiInited = false;
|
||||||
static struct DjuiRoot* sDjuiRootBehind = NULL;
|
static struct DjuiRoot* sDjuiRootBehind = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,10 @@ void djui_base_set_alignment(struct DjuiBase* base, enum DjuiHAlign hAlign, enum
|
||||||
base->vAlign = vAlign;
|
base->vAlign = vAlign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void djui_base_set_gradient(struct DjuiBase* base, bool gradient) {
|
||||||
|
base->gradient = gradient;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
// utility //
|
// utility //
|
||||||
/////////////
|
/////////////
|
||||||
|
|
@ -441,6 +445,7 @@ void djui_base_init(struct DjuiBase* parent, struct DjuiBase* base, bool (*rende
|
||||||
djui_base_set_enabled(base, true);
|
djui_base_set_enabled(base, true);
|
||||||
djui_base_set_size(base, 64, 64);
|
djui_base_set_size(base, 64, 64);
|
||||||
djui_base_set_color(base, 255, 255, 255, 255);
|
djui_base_set_color(base, 255, 255, 255, 255);
|
||||||
|
djui_base_set_gradient(base, configDjuiThemeGradients);
|
||||||
base->get_cursor_hover_location = djui_base_get_cursor_hover_location;
|
base->get_cursor_hover_location = djui_base_get_cursor_hover_location;
|
||||||
base->render = render;
|
base->render = render;
|
||||||
base->destroy = destroy;
|
base->destroy = destroy;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ struct DjuiBase {
|
||||||
struct DjuiInteractable* interactable;
|
struct DjuiInteractable* interactable;
|
||||||
bool addChildrenToHead;
|
bool addChildrenToHead;
|
||||||
bool abandonAfterChildRenderFail;
|
bool abandonAfterChildRenderFail;
|
||||||
|
bool gradient;
|
||||||
s64 tag;
|
s64 tag;
|
||||||
bool bTag;
|
bool bTag;
|
||||||
void (*get_cursor_hover_location)(struct DjuiBase*, f32* x, f32* y);
|
void (*get_cursor_hover_location)(struct DjuiBase*, f32* x, f32* y);
|
||||||
|
|
@ -63,6 +64,7 @@ void djui_base_set_border_color(struct DjuiBase* base, u8 r, u8 g, u8 b, u8 a);
|
||||||
void djui_base_set_padding(struct DjuiBase* base, f32 top, f32 right, f32 bottom, f32 left);
|
void djui_base_set_padding(struct DjuiBase* base, f32 top, f32 right, f32 bottom, f32 left);
|
||||||
void djui_base_set_padding_type(struct DjuiBase* base, enum DjuiScreenValueType topType, enum DjuiScreenValueType rightType, enum DjuiScreenValueType bottomType, enum DjuiScreenValueType leftType);
|
void djui_base_set_padding_type(struct DjuiBase* base, enum DjuiScreenValueType topType, enum DjuiScreenValueType rightType, enum DjuiScreenValueType bottomType, enum DjuiScreenValueType leftType);
|
||||||
void djui_base_set_alignment(struct DjuiBase* base, enum DjuiHAlign hAlign, enum DjuiVAlign vAlign);
|
void djui_base_set_alignment(struct DjuiBase* base, enum DjuiHAlign hAlign, enum DjuiVAlign vAlign);
|
||||||
|
void djui_base_set_gradient(struct DjuiBase* base, bool gradient);
|
||||||
|
|
||||||
void djui_base_compute(struct DjuiBase* base);
|
void djui_base_compute(struct DjuiBase* base);
|
||||||
void djui_base_compute_tree(struct DjuiBase* base);
|
void djui_base_compute_tree(struct DjuiBase* base);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,13 @@ void djui_gfx_displaylist_end(void) {
|
||||||
gSPDisplayList(gDisplayListHead++, dl_djui_display_list_end);
|
gSPDisplayList(gDisplayListHead++, dl_djui_display_list_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const Vtx vertex_djui_menu_rect[] = {
|
||||||
|
{{{ 0, -1, 0 }, 0, { 0, 0 }, { 0x96, 0x96, 0x96, 0xff }}},
|
||||||
|
{{{ 1, -1, 0 }, 0, { 0, 0 }, { 0x96, 0x96, 0x96, 0xff }}},
|
||||||
|
{{{ 1, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
||||||
|
{{{ 0, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
||||||
|
};
|
||||||
|
|
||||||
static const Vtx vertex_djui_simple_rect[] = {
|
static const Vtx vertex_djui_simple_rect[] = {
|
||||||
{{{ 0, -1, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
{{{ 0, -1, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
||||||
{{{ 1, -1, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
{{{ 1, -1, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
||||||
|
|
@ -34,6 +41,16 @@ static const Vtx vertex_djui_simple_rect[] = {
|
||||||
{{{ 0, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
{{{ 0, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff }}},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const Gfx dl_djui_menu_rect[] = {
|
||||||
|
gsDPPipeSync(),
|
||||||
|
gsSPClearGeometryMode(G_LIGHTING),
|
||||||
|
gsDPSetCombineMode(G_CC_FADE, G_CC_FADE),
|
||||||
|
gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2),
|
||||||
|
gsSPVertexNonGlobal(vertex_djui_menu_rect, 4, 0),
|
||||||
|
gsSP2Triangles(0, 1, 2, 0x0, 0, 2, 3, 0x0),
|
||||||
|
gsSPEndDisplayList(),
|
||||||
|
};
|
||||||
|
|
||||||
const Gfx dl_djui_simple_rect[] = {
|
const Gfx dl_djui_simple_rect[] = {
|
||||||
gsDPPipeSync(),
|
gsDPPipeSync(),
|
||||||
gsSPClearGeometryMode(G_LIGHTING),
|
gsSPClearGeometryMode(G_LIGHTING),
|
||||||
|
|
@ -134,8 +151,8 @@ void djui_gfx_render_texture_tile(const u8* texture, u32 w, u32 h, u32 bitSize,
|
||||||
|
|
||||||
// I don't know why adding 1 to all of the UVs seems to fix rendering, but it does...
|
// I don't know why adding 1 to all of the UVs seems to fix rendering, but it does...
|
||||||
// this should be tested carefully. it definitely fixes some stuff, but what does it break?
|
// this should be tested carefully. it definitely fixes some stuff, but what does it break?
|
||||||
f32 offsetX = font ? -1024.0f / (f32)w : 1;
|
f32 offsetX = (font ? -1024.0f / (f32)w : 0) + 1;
|
||||||
f32 offsetY = font ? -1024.0f / (f32)h : 1;
|
f32 offsetY = (font ? -1024.0f / (f32)h : 0) + 1;
|
||||||
vtx[0] = (Vtx) {{{ 0, -1, 0 }, 0, { ( tileX * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
vtx[0] = (Vtx) {{{ 0, -1, 0 }, 0, { ( tileX * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
||||||
vtx[2] = (Vtx) {{{ 1 * aspect, 0, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ( tileY * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
vtx[2] = (Vtx) {{{ 1 * aspect, 0, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ( tileY * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
||||||
vtx[1] = (Vtx) {{{ 1 * aspect, -1, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
vtx[1] = (Vtx) {{{ 1 * aspect, -1, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#define DJUI_MTX_PUSH 1
|
#define DJUI_MTX_PUSH 1
|
||||||
#define DJUI_MTX_NOPUSH 2
|
#define DJUI_MTX_NOPUSH 2
|
||||||
|
|
||||||
|
extern const Gfx dl_djui_menu_rect[];
|
||||||
extern const Gfx dl_djui_simple_rect[];
|
extern const Gfx dl_djui_simple_rect[];
|
||||||
extern const Gfx dl_djui_img_begin[];
|
extern const Gfx dl_djui_img_begin[];
|
||||||
extern const Gfx dl_djui_img_end[];
|
extern const Gfx dl_djui_img_end[];
|
||||||
|
|
|
||||||
|
|
@ -638,6 +638,7 @@ struct DjuiInputbox* djui_inputbox_create(struct DjuiBase* parent, u16 bufferSiz
|
||||||
djui_base_init(parent, base, djui_inputbox_render, djui_inputbox_destroy);
|
djui_base_init(parent, base, djui_inputbox_render, djui_inputbox_destroy);
|
||||||
djui_base_set_size(base, 200, 32);
|
djui_base_set_size(base, 200, 32);
|
||||||
djui_base_set_border_width(base, 2);
|
djui_base_set_border_width(base, 2);
|
||||||
|
djui_base_set_gradient(base, false);
|
||||||
djui_inputbox_set_text_color(inputbox, 0, 0, 0, 255);
|
djui_inputbox_set_text_color(inputbox, 0, 0, 0, 255);
|
||||||
djui_interactable_create(base, djui_inputbox_update_style);
|
djui_interactable_create(base, djui_inputbox_update_style);
|
||||||
djui_interactable_hook_cursor_down(base, djui_inputbox_on_cursor_down_begin, djui_inputbox_on_cursor_down, NULL);
|
djui_interactable_hook_cursor_down(base, djui_inputbox_on_cursor_down_begin, djui_inputbox_on_cursor_down, NULL);
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ void djui_panel_update(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool gDjuiShuttingDown;
|
extern bool gDjuiShuttingDown;
|
||||||
|
extern bool gDjuiChangingTheme;
|
||||||
void djui_panel_shutdown(void) {
|
void djui_panel_shutdown(void) {
|
||||||
static bool sShuttingDown = false;
|
static bool sShuttingDown = false;
|
||||||
if (sShuttingDown) { return; }
|
if (sShuttingDown) { return; }
|
||||||
|
|
@ -224,7 +225,7 @@ void djui_panel_shutdown(void) {
|
||||||
gDjuiPanelMainCreated = false;
|
gDjuiPanelMainCreated = false;
|
||||||
gDjuiPanelPauseCreated = false;
|
gDjuiPanelPauseCreated = false;
|
||||||
djui_cursor_set_visible(false);
|
djui_cursor_set_visible(false);
|
||||||
if (!gDjuiShuttingDown) {
|
if (!gDjuiShuttingDown && !gDjuiChangingTheme) {
|
||||||
configfile_save(configfile_name());
|
configfile_save(configfile_name());
|
||||||
if (gDjuiInMainMenu) {
|
if (gDjuiInMainMenu) {
|
||||||
gDjuiInMainMenu = false;
|
gDjuiInMainMenu = false;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,27 @@ struct MainMenuSounds gMainMenuSounds[] = {
|
||||||
{ "Stage Music", STAGE_MUSIC },
|
{ "Stage Music", STAGE_MUSIC },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char* sLevelChoices[18] = {
|
||||||
|
"CG",
|
||||||
|
"BOB",
|
||||||
|
"WF",
|
||||||
|
"WMOTR",
|
||||||
|
"JRB",
|
||||||
|
"SSL",
|
||||||
|
"TTM",
|
||||||
|
"SL",
|
||||||
|
"BBH",
|
||||||
|
"LLL",
|
||||||
|
"THI",
|
||||||
|
"HMC",
|
||||||
|
"CCM",
|
||||||
|
"RR",
|
||||||
|
"BITDW",
|
||||||
|
"PSS",
|
||||||
|
"TTC",
|
||||||
|
"WDW"
|
||||||
|
};
|
||||||
|
|
||||||
void djui_panel_main_menu_create(struct DjuiBase* caller);
|
void djui_panel_main_menu_create(struct DjuiBase* caller);
|
||||||
|
|
||||||
static void djui_panel_level_menu(UNUSED struct DjuiBase* caller) {
|
static void djui_panel_level_menu(UNUSED struct DjuiBase* caller) {
|
||||||
|
|
@ -65,7 +86,9 @@ static void djui_panel_staff_roll(UNUSED struct DjuiBase* caller) {
|
||||||
djui_panel_main_menu_create(NULL);
|
djui_panel_main_menu_create(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool gDjuiChangingTheme;
|
||||||
static void djui_panel_menu_options_djui_setting_change(UNUSED struct DjuiBase* caller) {
|
static void djui_panel_menu_options_djui_setting_change(UNUSED struct DjuiBase* caller) {
|
||||||
|
gDjuiChangingTheme = true;
|
||||||
if (gDjuiInMainMenu) {
|
if (gDjuiInMainMenu) {
|
||||||
djui_panel_shutdown();
|
djui_panel_shutdown();
|
||||||
gDjuiInMainMenu = true;
|
gDjuiInMainMenu = true;
|
||||||
|
|
@ -87,6 +110,7 @@ static void djui_panel_menu_options_djui_setting_change(UNUSED struct DjuiBase*
|
||||||
djui_text_set_font(gDjuiPauseOptions, gDjuiFonts[configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED]);
|
djui_text_set_font(gDjuiPauseOptions, gDjuiFonts[configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED]);
|
||||||
djui_text_set_text(gDjuiPauseOptions, DLANG(MISC, R_BUTTON));
|
djui_text_set_text(gDjuiPauseOptions, DLANG(MISC, R_BUTTON));
|
||||||
}
|
}
|
||||||
|
gDjuiChangingTheme = false;
|
||||||
|
|
||||||
smlua_call_event_hooks(HOOK_ON_DJUI_THEME_CHANGED);
|
smlua_call_event_hooks(HOOK_ON_DJUI_THEME_CHANGED);
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +123,7 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
|
||||||
|
|
||||||
{
|
{
|
||||||
djui_checkbox_create(body, DLANG(DJUI_THEMES, CENTER), &configDjuiThemeCenter, djui_panel_menu_options_djui_setting_change);
|
djui_checkbox_create(body, DLANG(DJUI_THEMES, CENTER), &configDjuiThemeCenter, djui_panel_menu_options_djui_setting_change);
|
||||||
|
djui_checkbox_create(body, DLANG(DJUI_THEMES, GRADIENTS), &configDjuiThemeGradients, djui_panel_menu_options_djui_setting_change);
|
||||||
|
|
||||||
char* themeChoices[DJUI_THEME_MAX];
|
char* themeChoices[DJUI_THEME_MAX];
|
||||||
for (int i = 0; i < DJUI_THEME_MAX; i++) {
|
for (int i = 0; i < DJUI_THEME_MAX; i++) {
|
||||||
|
|
@ -113,28 +138,6 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
|
||||||
djui_selectionbox_create(body, DLANG(DJUI_THEMES, DJUI_FONT), djuiFontChoices, 2, &configDjuiThemeFont, djui_panel_menu_options_djui_setting_change);
|
djui_selectionbox_create(body, DLANG(DJUI_THEMES, DJUI_FONT), djuiFontChoices, 2, &configDjuiThemeFont, djui_panel_menu_options_djui_setting_change);
|
||||||
|
|
||||||
if (gDjuiInMainMenu) {
|
if (gDjuiInMainMenu) {
|
||||||
// get level choices
|
|
||||||
char* levelChoices[18] = {
|
|
||||||
"CG",
|
|
||||||
"BOB",
|
|
||||||
"WF",
|
|
||||||
"WMOTR",
|
|
||||||
"JRB",
|
|
||||||
"SSL",
|
|
||||||
"TTM",
|
|
||||||
"SL",
|
|
||||||
"BBH",
|
|
||||||
"LLL",
|
|
||||||
"THI",
|
|
||||||
"HMC",
|
|
||||||
"CCM",
|
|
||||||
"RR",
|
|
||||||
"BITDW",
|
|
||||||
"PSS",
|
|
||||||
"TTC",
|
|
||||||
"WDW"
|
|
||||||
};
|
|
||||||
|
|
||||||
// copy sound choices from gMainMenuSounds
|
// copy sound choices from gMainMenuSounds
|
||||||
int numSounds = sizeof(gMainMenuSounds) / sizeof(gMainMenuSounds[0]);
|
int numSounds = sizeof(gMainMenuSounds) / sizeof(gMainMenuSounds[0]);
|
||||||
// if stage roll is on, we shouldn't be allowed to use Stage Music, so remove the entry
|
// if stage roll is on, we shouldn't be allowed to use Stage Music, so remove the entry
|
||||||
|
|
@ -148,7 +151,7 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
|
||||||
soundChoices[i] = gMainMenuSounds[i].name;
|
soundChoices[i] = gMainMenuSounds[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(body, DLANG(MENU_OPTIONS, LEVEL), levelChoices, 18, &configMenuLevel, NULL);
|
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(body, DLANG(MENU_OPTIONS, LEVEL), sLevelChoices, 18, &configMenuLevel, NULL);
|
||||||
djui_base_set_enabled(&selectionbox1->base, !(configMenuRandom || configMenuStaffRoll));
|
djui_base_set_enabled(&selectionbox1->base, !(configMenuRandom || configMenuStaffRoll));
|
||||||
sLevelBox = selectionbox1;
|
sLevelBox = selectionbox1;
|
||||||
djui_selectionbox_create(body, DLANG(MENU_OPTIONS, MUSIC), soundChoices, numSounds, &configMenuSound, NULL);
|
djui_selectionbox_create(body, DLANG(MENU_OPTIONS, MUSIC), soundChoices, numSounds, &configMenuSound, NULL);
|
||||||
|
|
|
||||||
|
|
@ -261,12 +261,15 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
|
||||||
|
|
||||||
sSliderR = djui_slider_create(body, DLANG(PLAYER, RED), &sSliderChannels[0], 0, 255, djui_panel_player_edit_palette_red_changed);
|
sSliderR = djui_slider_create(body, DLANG(PLAYER, RED), &sSliderChannels[0], 0, 255, djui_panel_player_edit_palette_red_changed);
|
||||||
djui_base_set_color(&sSliderR->rectValue->base, 255, 0, 0, 255);
|
djui_base_set_color(&sSliderR->rectValue->base, 255, 0, 0, 255);
|
||||||
|
djui_base_set_gradient(&sSliderR->rectValue->base, false);
|
||||||
sSliderR->updateRectValueColor = false;
|
sSliderR->updateRectValueColor = false;
|
||||||
sSliderG = djui_slider_create(body, DLANG(PLAYER, GREEN), &sSliderChannels[1], 0, 255, djui_panel_player_edit_palette_green_changed);
|
sSliderG = djui_slider_create(body, DLANG(PLAYER, GREEN), &sSliderChannels[1], 0, 255, djui_panel_player_edit_palette_green_changed);
|
||||||
djui_base_set_color(&sSliderG->rectValue->base, 0, 255, 0, 255);
|
djui_base_set_color(&sSliderG->rectValue->base, 0, 255, 0, 255);
|
||||||
|
djui_base_set_gradient(&sSliderG->rectValue->base, false);
|
||||||
sSliderG->updateRectValueColor = false;
|
sSliderG->updateRectValueColor = false;
|
||||||
sSliderB = djui_slider_create(body, DLANG(PLAYER, BLUE), &sSliderChannels[2], 0, 255, djui_panel_player_edit_palette_blue_changed);
|
sSliderB = djui_slider_create(body, DLANG(PLAYER, BLUE), &sSliderChannels[2], 0, 255, djui_panel_player_edit_palette_blue_changed);
|
||||||
djui_base_set_color(&sSliderB->rectValue->base, 0, 0, 255, 255);
|
djui_base_set_color(&sSliderB->rectValue->base, 0, 0, 255, 255);
|
||||||
|
djui_base_set_gradient(&sSliderB->rectValue->base, false);
|
||||||
sSliderB->updateRectValueColor = false;
|
sSliderB->updateRectValueColor = false;
|
||||||
|
|
||||||
struct DjuiRect* space = djui_rect_create(body);
|
struct DjuiRect* space = djui_rect_create(body);
|
||||||
|
|
@ -280,6 +283,7 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
|
||||||
struct DjuiRect* rectValue = djui_rect_create(&space->base);
|
struct DjuiRect* rectValue = djui_rect_create(&space->base);
|
||||||
djui_base_set_size_type(&rectValue->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
|
djui_base_set_size_type(&rectValue->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE);
|
||||||
djui_base_set_color(&rectValue->base, sSliderChannels[0], sSliderChannels[1], sSliderChannels[2], 255);
|
djui_base_set_color(&rectValue->base, sSliderChannels[0], sSliderChannels[1], sSliderChannels[2], 255);
|
||||||
|
djui_base_set_gradient(&rectValue->base, false);
|
||||||
sColorRect = rectValue;
|
sColorRect = rectValue;
|
||||||
|
|
||||||
struct DjuiRect* rect2 = djui_rect_container_create(body, 32);
|
struct DjuiRect* rect2 = djui_rect_container_create(body, 32);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ bool djui_rect_render(struct DjuiBase* base) {
|
||||||
|
|
||||||
// render
|
// render
|
||||||
gDPSetEnvColor(gDisplayListHead++, base->color.r, base->color.g, base->color.b, base->color.a);
|
gDPSetEnvColor(gDisplayListHead++, base->color.r, base->color.g, base->color.b, base->color.a);
|
||||||
gSPDisplayList(gDisplayListHead++, dl_djui_simple_rect);
|
gSPDisplayList(gDisplayListHead++, base->gradient ? dl_djui_menu_rect : dl_djui_simple_rect);
|
||||||
|
|
||||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include "djui.h"
|
#include "djui.h"
|
||||||
|
|
||||||
#define DJUI_THEME_CENTERED_WIDTH 1.3f
|
#define DJUI_THEME_CENTERED_WIDTH 1.3f
|
||||||
#define DJUI_THEME_CENTERED_HEIGHT 0.9f
|
#define DJUI_THEME_CENTERED_HEIGHT 0.921f
|
||||||
|
|
||||||
enum DjuiThemeType {
|
enum DjuiThemeType {
|
||||||
DJUI_THEME_LIGHT,
|
DJUI_THEME_LIGHT,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue