mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Console Overhaul (#490)
Completely redid the console ui to look more like the rest of coop Added log_to_console and djui_console_toggle to lua Made the keybind to activate it the tilda key (~) instead of ctrl+f1
This commit is contained in:
parent
048f4f1fd4
commit
9b502346a7
25 changed files with 180 additions and 49 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
python3 ./autogen/convert_structs.py $1
|
||||
python3 ./autogen/convert_functions.py $1
|
||||
python3 ./autogen/convert_constants.py $1
|
||||
|
|
|
@ -30,6 +30,7 @@ in_files = [
|
|||
"src/game/rumble_init.c",
|
||||
"src/pc/djui/djui_popup.h",
|
||||
"src/pc/network/network_utils.h",
|
||||
"src/pc/djui/djui_console.h",
|
||||
"src/pc/djui/djui_chat_message.h",
|
||||
"src/game/interaction.h",
|
||||
"src/game/level_info.h",
|
||||
|
@ -91,8 +92,9 @@ override_disallowed_functions = {
|
|||
"src/game/mario_actions_object.c": [ "^[us]32 act_.*" ],
|
||||
"src/game/mario_actions_stationary.c": [ "^[us]32 act_.*" ],
|
||||
"src/game/mario_actions_submerged.c": [ "^[us]32 act_.*" ],
|
||||
"src/game/mario_step.h": [ " stub_mario_step", "transfer_bully_speed"],
|
||||
"src/game/mario_step.h": [ " stub_mario_step", "transfer_bully_speed" ],
|
||||
"src/game/mario.h": [ " init_mario" ],
|
||||
"src/pc/djui/djui_console.h": [ " djui_console_create", "djui_console_message_create" ],
|
||||
"src/pc/djui/djui_chat_message.h": [ "create_from" ],
|
||||
"src/game/interaction.h": [ "process_interactions", "_handle_" ],
|
||||
"src/game/sound_init.h": [ "_loop_", "thread4_", "set_sound_mode" ],
|
||||
|
|
|
@ -3627,6 +3627,11 @@ function djui_chat_message_create(message)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return nil
|
||||
function djui_console_toggle()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return number
|
||||
function djui_hud_get_mouse_x()
|
||||
-- ...
|
||||
|
@ -8774,6 +8779,12 @@ function is_transition_playing()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param message string
|
||||
--- @return nil
|
||||
function log_to_console(message)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param name string
|
||||
--- @param level integer
|
||||
--- @param area integer
|
||||
|
|
|
@ -2050,6 +2050,30 @@
|
|||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from djui_console.h
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
## [djui_console_toggle](#djui_console_toggle)
|
||||
|
||||
### Lua Example
|
||||
`djui_console_toggle()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void djui_console_toggle(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from djui_hud_utils.h
|
||||
|
||||
|
|
|
@ -1261,6 +1261,26 @@
|
|||
|
||||
<br />
|
||||
|
||||
## [log_to_console](#log_to_console)
|
||||
|
||||
### Lua Example
|
||||
`log_to_console(message)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| message | `string` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void log_to_console(const char* message);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [movtexqc_register](#movtexqc_register)
|
||||
|
||||
### Lua Example
|
||||
|
|
|
@ -716,6 +716,11 @@
|
|||
|
||||
<br />
|
||||
|
||||
- djui_console.h
|
||||
- [djui_console_toggle](functions-3.md#djui_console_toggle)
|
||||
|
||||
<br />
|
||||
|
||||
- djui_hud_utils.h
|
||||
- [djui_hud_get_mouse_x](functions-3.md#djui_hud_get_mouse_x)
|
||||
- [djui_hud_get_mouse_y](functions-3.md#djui_hud_get_mouse_y)
|
||||
|
@ -1631,6 +1636,7 @@
|
|||
- [hud_show](functions-5.md#hud_show)
|
||||
- [is_game_paused](functions-5.md#is_game_paused)
|
||||
- [is_transition_playing](functions-5.md#is_transition_playing)
|
||||
- [log_to_console](functions-5.md#log_to_console)
|
||||
- [movtexqc_register](functions-5.md#movtexqc_register)
|
||||
- [play_transition](functions-5.md#play_transition)
|
||||
- [save_file_get_using_backup_slot](functions-5.md#save_file_get_using_backup_slot)
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "D-Pad vlevo"
|
|||
D_RIGHT = "D-Pad vpravo"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Řídicí panel"
|
||||
PREV = "Před Stránka"
|
||||
NEXT = "Další Strana"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Nastavení hlavního menu"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Jazyk"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "ŘÍDICÍ PANEL"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODY"
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ D_LEFT = "D Links"
|
|||
D_RIGHT = "D Rechts"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Logboek"
|
||||
PREV = "Vori Bladzijde"
|
||||
NEXT = "Volg Bladzijde"
|
||||
|
||||
|
@ -244,6 +245,9 @@ MENU_OPTIONS = "Menu Instellingen"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Taal"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "LOGBOEK"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "D Left"
|
|||
D_RIGHT = "D Right"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Console"
|
||||
PREV = "Prev Page"
|
||||
NEXT = "Next Page"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Menu Options"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Language"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "CONSOLE"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "D Gauche"
|
|||
D_RIGHT = "D Droite"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Console"
|
||||
PREV = "Page Préc"
|
||||
NEXT = "Page Suiv"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Options du menu"
|
|||
DEBUG = "Débogage"
|
||||
LANGUAGE = "Langue"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "CONSOLE"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "D Links"
|
|||
D_RIGHT = "D Rechts"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Konsole"
|
||||
PREV = "Vorh Seite"
|
||||
NEXT = "Näch Seite"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Menü Optionen"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Sprache"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "KONSOLE"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODIFIKATIONEN"
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ D_LEFT = "D Sinistra"
|
|||
D_RIGHT = "D Destra"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Consolle"
|
||||
PREV = "Pagina Prec"
|
||||
NEXT = "Pagina Succ"
|
||||
|
||||
|
@ -242,6 +243,9 @@ MENU_OPTIONS = "Opzioni Menù"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Lingua"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "CONSOLE"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "D LEFT"
|
|||
D_RIGHT = "D RIGHT"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Console"
|
||||
PREV = "Página Ante"
|
||||
NEXT = "Próx Página"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Opções de Menu"
|
|||
DEBUG = "Debug"
|
||||
LANGUAGE = "Idioma"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "CONSOLE"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ D_LEFT = "Крестовина влево"
|
|||
D_RIGHT = "Крестовина вправо"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "пульт"
|
||||
PREV = "Пред Cтраница"
|
||||
NEXT = "След Cтраница"
|
||||
|
||||
|
@ -244,6 +245,9 @@ MENU_OPTIONS = "Параметры меню"
|
|||
DEBUG = "Отладка"
|
||||
LANGUAGE = "Язык"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "пульт"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ D_LEFT = "Cruz Izquierda"
|
|||
D_RIGHT = "Cruz Derecha"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
CONSOLE = "Consola"
|
||||
PREV = "Pagina Ante"
|
||||
NEXT = "Sigu Página"
|
||||
|
||||
|
@ -245,6 +246,9 @@ MENU_OPTIONS = "Opciones del menú"
|
|||
DEBUG = "Depuración"
|
||||
LANGUAGE = "Idioma"
|
||||
|
||||
[CONSOLE]
|
||||
CONSOLE = "CONSOLA"
|
||||
|
||||
[MODLIST]
|
||||
MODS = "MODS"
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ unsigned int configKeyDUp[MAX_BINDS] = { 0x0147, 0x100b, VK_INVALID
|
|||
unsigned int configKeyDDown[MAX_BINDS] = { 0x014f, 0x100c, VK_INVALID };
|
||||
unsigned int configKeyDLeft[MAX_BINDS] = { 0x0153, 0x100d, VK_INVALID };
|
||||
unsigned int configKeyDRight[MAX_BINDS] = { 0x0151, 0x100e, VK_INVALID };
|
||||
unsigned int configKeyConsole[MAX_BINDS] = { 0x0029, 0x003B, VK_INVALID };
|
||||
unsigned int configKeyPrevPage[MAX_BINDS] = { 0x0016, VK_INVALID, VK_INVALID };
|
||||
unsigned int configKeyNextPage[MAX_BINDS] = { 0x0018, VK_INVALID, VK_INVALID };
|
||||
unsigned int configStickDeadzone = 16; // 16*DEADZONE_STEP=4960 (the original default deadzone)
|
||||
|
|
|
@ -56,6 +56,7 @@ extern unsigned int configKeyDUp[];
|
|||
extern unsigned int configKeyDDown[];
|
||||
extern unsigned int configKeyDLeft[];
|
||||
extern unsigned int configKeyDRight[];
|
||||
extern unsigned int configKeyConsole[];
|
||||
extern unsigned int configKeyPrevPage[];
|
||||
extern unsigned int configKeyNextPage[];
|
||||
extern unsigned int configStickDeadzone;
|
||||
|
|
|
@ -135,7 +135,6 @@ void djui_render(void) {
|
|||
}
|
||||
|
||||
djui_cursor_update();
|
||||
djui_base_render(&gDjuiConsole->base);
|
||||
djui_interactable_update();
|
||||
djui_gfx_displaylist_end();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "djui.h"
|
||||
#include "djui_panel_menu.h"
|
||||
#include "djui_console.h"
|
||||
|
||||
#define MAX_CONSOLE_MESSAGES 500
|
||||
|
@ -10,26 +11,14 @@ bool gDjuiConsoleFocus = false;
|
|||
char gDjuiConsoleTmpBuffer[CONSOLE_MAX_TMP_BUFFER] = "";
|
||||
u32 sDjuiConsoleMessages = 0;
|
||||
|
||||
bool djui_console_render(struct DjuiBase* base) {
|
||||
djui_base_set_size(base, gDjuiRoot->base.width.value, gDjuiRoot->base.height.value * 0.6f);
|
||||
|
||||
djui_rect_render(base);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void djui_console_destroy(struct DjuiBase* base) {
|
||||
struct DjuiConsole* console = (struct DjuiConsole*)base;
|
||||
free(console);
|
||||
}
|
||||
|
||||
void djui_console_toggle(void) {
|
||||
if (gDjuiConsole == NULL) { return; }
|
||||
gDjuiConsoleFocus = !gDjuiConsoleFocus;
|
||||
djui_base_set_visible(&gDjuiConsole->base, gDjuiConsoleFocus);
|
||||
djui_base_set_visible(&gDjuiConsole->panel->base, gDjuiConsoleFocus);
|
||||
|
||||
if (gDjuiConsoleFocus) {
|
||||
if (gDjuiChatBoxFocus) { djui_chat_box_toggle(); }
|
||||
djui_interactable_set_input_focus(&gDjuiConsole->base);
|
||||
djui_interactable_set_input_focus(&gDjuiConsole->panel->base);
|
||||
} else {
|
||||
djui_interactable_set_input_focus(NULL);
|
||||
}
|
||||
|
@ -37,19 +26,20 @@ void djui_console_toggle(void) {
|
|||
|
||||
static bool djui_console_on_key_down(UNUSED struct DjuiBase* base, int scancode) {
|
||||
if (gDjuiConsole == NULL) { return false; }
|
||||
f32 yMax = gDjuiConsole->base.comp.height - gDjuiConsole->flow->base.height.value;
|
||||
struct DjuiBase* body = djui_three_panel_get_body(gDjuiConsole->panel);
|
||||
f32 yMax = body->height.value - gDjuiConsole->flow->base.height.value;
|
||||
|
||||
f32* yValue = &gDjuiConsole->flow->base.y.value;
|
||||
bool canScrollUp = (*yValue > yMax);
|
||||
bool canScrollDown = (*yValue < 0);
|
||||
f32 pageAmount = gDjuiConsole->base.comp.height * 3.0f / 4.0f;
|
||||
f32 pageAmount = body->height.value;
|
||||
|
||||
switch (scancode) {
|
||||
case SCANCODE_UP:
|
||||
if (canScrollUp) { *yValue = fmax(*yValue - 15, yMax); }
|
||||
if (canScrollUp) { *yValue = fmax(*yValue - 30, yMax); }
|
||||
break;
|
||||
case SCANCODE_DOWN:
|
||||
if (canScrollDown) { *yValue = fmin(*yValue + 15, 0); }
|
||||
if (canScrollDown) { *yValue = fmin(*yValue + 30, 0); }
|
||||
break;
|
||||
case SCANCODE_PAGE_UP:
|
||||
if (canScrollUp) { *yValue = fmax(*yValue - pageAmount, yMax); }
|
||||
|
@ -66,10 +56,10 @@ static bool djui_console_on_key_down(UNUSED struct DjuiBase* base, int scancode)
|
|||
|
||||
void djui_console_message_create(char* message) {
|
||||
if (!gDjuiConsole) { return; }
|
||||
djui_base_compute_tree(&gDjuiConsole->base);
|
||||
djui_base_compute_tree(&gDjuiConsole->panel->base);
|
||||
struct DjuiBase* cfBase = &gDjuiConsole->flow->base;
|
||||
|
||||
f32 maxTextWidth = gDjuiConsole->base.comp.width - gDjuiConsole->base.padding.left.value - gDjuiConsole->base.padding.right.value;
|
||||
f32 maxTextWidth = gDjuiConsole->panel->base.comp.width - gDjuiConsole->panel->base.padding.left.value - gDjuiConsole->panel->base.padding.right.value - 20;
|
||||
|
||||
struct DjuiText* text = djui_text_create(cfBase, message);
|
||||
struct DjuiBase* tBase = &text->base;
|
||||
|
@ -107,25 +97,25 @@ void djui_console_message_create(char* message) {
|
|||
|
||||
struct DjuiConsole* djui_console_create(void) {
|
||||
if (gDjuiConsole != NULL) {
|
||||
djui_base_destroy(&gDjuiConsole->base);
|
||||
djui_base_destroy(&gDjuiConsole->panel->base);
|
||||
gDjuiConsole = NULL;
|
||||
}
|
||||
|
||||
struct DjuiConsole* console = calloc(1, sizeof(struct DjuiConsole));
|
||||
struct DjuiBase* base = &console->base;
|
||||
struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(CONSOLE, CONSOLE));
|
||||
djui_three_panel_set_body_size(panel, 750);
|
||||
console->panel = panel;
|
||||
|
||||
djui_base_init(NULL, base, djui_console_render, djui_console_destroy);
|
||||
djui_base_set_size_type(base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE);
|
||||
djui_base_set_size(base, gDjuiRoot->base.width.value, gDjuiRoot->base.height.value * 0.6f);
|
||||
djui_base_set_alignment(base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP);
|
||||
djui_base_set_color(base, 0, 0, 0, 250);
|
||||
djui_base_set_padding(base, 0, 8, 8, 8);
|
||||
djui_base_set_visible(base, false);
|
||||
djui_base_set_alignment(&panel->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER);
|
||||
djui_base_set_size_type(&panel->base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE);
|
||||
djui_base_set_size(&panel->base, 850, 750 + (32 + 16) + 32 + 32);
|
||||
djui_base_set_visible(&panel->base, false);
|
||||
|
||||
djui_interactable_create(base, NULL);
|
||||
djui_interactable_hook_key(base, djui_console_on_key_down, NULL);
|
||||
djui_interactable_create(&panel->base, NULL);
|
||||
djui_interactable_hook_key(&panel->base, djui_console_on_key_down, NULL);
|
||||
|
||||
struct DjuiFlowLayout* flow = djui_flow_layout_create(base);
|
||||
struct DjuiBase* body = djui_three_panel_get_body(panel);
|
||||
struct DjuiFlowLayout* flow = djui_flow_layout_create(body);
|
||||
struct DjuiBase* cfBase = &flow->base;
|
||||
djui_base_set_alignment(cfBase, DJUI_HALIGN_LEFT, DJUI_VALIGN_BOTTOM);
|
||||
djui_base_set_location(cfBase, 0, 0);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "djui.h"
|
||||
|
||||
struct DjuiConsole {
|
||||
struct DjuiBase base;
|
||||
struct DjuiThreePanel* panel;
|
||||
struct DjuiFlowLayout* flow;
|
||||
bool scrolling;
|
||||
};
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#define CALL_CALLBACK(x) if (base->interactable->x != NULL) { base->interactable->x(base); }
|
||||
#define CALL_CALLBACK_PARAM(x, y) if (base->interactable->x != NULL) { base->interactable->x(base, y); }
|
||||
|
||||
#define SCANCODE_F1 59
|
||||
|
||||
enum PadHoldDirection { PAD_HOLD_DIR_NONE, PAD_HOLD_DIR_UP, PAD_HOLD_DIR_DOWN, PAD_HOLD_DIR_LEFT, PAD_HOLD_DIR_RIGHT };
|
||||
static enum PadHoldDirection sKeyboardHoldDirection = PAD_HOLD_DIR_NONE;
|
||||
static u16 sKeyboardButtons = 0;
|
||||
|
@ -35,7 +33,6 @@ bool gInteractableOverridePad = false;
|
|||
OSContPad gInteractablePad = { 0 };
|
||||
static OSContPad sLastInteractablePad = { 0 };
|
||||
static int sLastMouseButtons = 0;
|
||||
static bool sControlDown = false;
|
||||
|
||||
static void djui_interactable_update_style(struct DjuiBase* base) {
|
||||
if (base == NULL) { return; }
|
||||
|
@ -184,7 +181,7 @@ void djui_interactable_set_binding(struct DjuiBase* base) {
|
|||
}
|
||||
|
||||
void djui_interactable_set_input_focus(struct DjuiBase* base) {
|
||||
if (gDjuiConsoleFocus && base != &gDjuiConsole->base) {
|
||||
if (gDjuiConsoleFocus && base != &gDjuiConsole->panel->base) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -203,10 +200,8 @@ bool djui_interactable_on_key_down(int scancode) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (scancode == SCANCODE_CONTROL_LEFT) {
|
||||
sControlDown = true;
|
||||
} else if (sControlDown && scancode == SCANCODE_F1) {
|
||||
djui_console_toggle();
|
||||
for (int i = 0; i < MAX_BINDS; i++) {
|
||||
if (scancode == (int)configKeyConsole[i]) { djui_console_toggle(); }
|
||||
}
|
||||
|
||||
bool keyFocused = (gInteractableFocus != NULL)
|
||||
|
@ -305,10 +300,6 @@ void djui_interactable_on_key_up(int scancode) {
|
|||
}
|
||||
}
|
||||
|
||||
if (scancode == SCANCODE_CONTROL_LEFT) {
|
||||
sControlDown = false;
|
||||
}
|
||||
|
||||
if (keyFocused) {
|
||||
gInteractableFocus->interactable->on_key_up(gInteractableFocus, scancode);
|
||||
sKeyboardHoldDirection = PAD_HOLD_DIR_NONE;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "src/pc/configfile.h"
|
||||
|
||||
void djui_panel_controls_extra_create(struct DjuiBase* caller) {
|
||||
f32 bindBodyHeight = 28 * 10 + 1 * 7;
|
||||
f32 bindBodyHeight = 28 * 11 + 1 * 10;
|
||||
|
||||
struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(CONTROLS, CONTROLS));
|
||||
struct DjuiBase* body = djui_three_panel_get_body(panel);
|
||||
|
@ -23,6 +23,7 @@ void djui_panel_controls_extra_create(struct DjuiBase* caller) {
|
|||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, D_RIGHT), configKeyDRight);
|
||||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, X), configKeyX);
|
||||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, Y), configKeyY);
|
||||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, CONSOLE), configKeyConsole);
|
||||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, PREV), configKeyPrevPage);
|
||||
djui_bind_create(&bindBody->base, DLANG(CONTROLS, NEXT), configKeyNextPage);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "src/game/mario.h"
|
||||
#include "src/pc/djui/djui_popup.h"
|
||||
#include "src/pc/network/network_utils.h"
|
||||
#include "src/pc/djui/djui_console.h"
|
||||
#include "src/pc/djui/djui_chat_message.h"
|
||||
#include "src/game/interaction.h"
|
||||
#include "src/game/level_info.h"
|
||||
|
@ -12064,6 +12065,25 @@ int smlua_func_djui_chat_message_create(lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// djui_console.h //
|
||||
////////////////////
|
||||
|
||||
int smlua_func_djui_console_toggle(UNUSED lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
int top = lua_gettop(L);
|
||||
if (top != 0) {
|
||||
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_console_toggle", 0, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
djui_console_toggle();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
// djui_hud_utils.h //
|
||||
//////////////////////
|
||||
|
@ -28953,6 +28973,23 @@ int smlua_func_is_transition_playing(UNUSED lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_log_to_console(lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
int top = lua_gettop(L);
|
||||
if (top != 1) {
|
||||
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "log_to_console", 1, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* message = smlua_to_string(L, 1);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "log_to_console"); return 0; }
|
||||
|
||||
log_to_console(message);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_movtexqc_register(lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
|
@ -31630,6 +31667,9 @@ void smlua_bind_functions_autogen(void) {
|
|||
// djui_chat_message.h
|
||||
smlua_bind_function(L, "djui_chat_message_create", smlua_func_djui_chat_message_create);
|
||||
|
||||
// djui_console.h
|
||||
smlua_bind_function(L, "djui_console_toggle", smlua_func_djui_console_toggle);
|
||||
|
||||
// djui_hud_utils.h
|
||||
smlua_bind_function(L, "djui_hud_get_mouse_x", smlua_func_djui_hud_get_mouse_x);
|
||||
smlua_bind_function(L, "djui_hud_get_mouse_y", smlua_func_djui_hud_get_mouse_y);
|
||||
|
@ -32489,6 +32529,7 @@ void smlua_bind_functions_autogen(void) {
|
|||
smlua_bind_function(L, "hud_show", smlua_func_hud_show);
|
||||
smlua_bind_function(L, "is_game_paused", smlua_func_is_game_paused);
|
||||
smlua_bind_function(L, "is_transition_playing", smlua_func_is_transition_playing);
|
||||
smlua_bind_function(L, "log_to_console", smlua_func_log_to_console);
|
||||
smlua_bind_function(L, "movtexqc_register", smlua_func_movtexqc_register);
|
||||
smlua_bind_function(L, "play_transition", smlua_func_play_transition);
|
||||
smlua_bind_function(L, "save_file_get_using_backup_slot", smlua_func_save_file_get_using_backup_slot);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "game/object_list_processor.h"
|
||||
#include "game/rendering_graph_node.h"
|
||||
#include "game/level_update.h"
|
||||
#include "pc/djui/djui_console.h"
|
||||
#include "pc/djui/djui_hud_utils.h"
|
||||
#include "game/skybox.h"
|
||||
#include "pc/gfx/gfx_pc.h"
|
||||
|
@ -89,6 +90,12 @@ bool hud_is_hidden(void) {
|
|||
|
||||
///
|
||||
|
||||
void log_to_console(const char* message) {
|
||||
djui_console_message_create((char*)message);
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
extern u8 gLastCollectedStarOrKey;
|
||||
s32 get_last_star_or_key(void) {
|
||||
return gLastCollectedStarOrKey;
|
||||
|
|
|
@ -34,6 +34,7 @@ enum HudDisplayFlags {
|
|||
};
|
||||
|
||||
void djui_popup_create_global(const char* message, int lines);
|
||||
void log_to_console(const char* message);
|
||||
bool djui_is_popup_disabled(void);
|
||||
void djui_set_popup_disabled_override(bool value);
|
||||
void djui_reset_popup_disabled_override(void);
|
||||
|
|
Loading…
Reference in a new issue