improve --client flag, fix hud font character width for spaces (#277)
* improve --client flag and domain resolution * stop using the debug flag for dev binds * smaller character width with spaces for the hud font
This commit is contained in:
parent
e01f1ea04d
commit
98834d5670
|
@ -226,7 +226,7 @@ bool exec_chat_command(char* command) {
|
|||
|
||||
return true;
|
||||
}
|
||||
#if defined(DEBUG) && defined(DEVELOPMENT)
|
||||
#if defined(DEVELOPMENT)
|
||||
if (gNetworkSystem == &gNetworkSystemSocket && str_starts_with("/warp ", command)) {
|
||||
static const struct { const char *name; s32 num; } sLevelNumByName[] = {
|
||||
#undef STUB_LEVEL
|
||||
|
@ -325,7 +325,7 @@ void display_chat_commands(void) {
|
|||
djui_chat_message_create("/permban [NAME|ID] - Ban this player from any game you host");
|
||||
djui_chat_message_create("/moderator [NAME|ID] - Make this player able to use commands like /kick, /ban, /permban on any game you host");
|
||||
}
|
||||
#if defined(DEBUG) && defined(DEVELOPMENT)
|
||||
#if defined(DEVELOPMENT)
|
||||
djui_chat_message_create("/warp [LEVEL] [AREA] [ACT] - Level can be either a numeric value or a shorthand name");
|
||||
#endif
|
||||
if (sConfirming != CCC_NONE) { djui_chat_message_create("/confirm"); }
|
||||
|
|
|
@ -61,10 +61,14 @@ void parse_cli_opts(int argc, char* argv[]) {
|
|||
gCLIOpts.Network = NT_SERVER;
|
||||
arg_uint("--server <port>", argv[++i], &gCLIOpts.NetworkPort);
|
||||
|
||||
} else if (strcmp(argv[i], "--client") == 0 && (i + 2) < argc) { // Join server
|
||||
} else if (strcmp(argv[i], "--client") == 0 && (((i + 1) < argc) || (i + 2) < argc)) { // Join server
|
||||
gCLIOpts.Network = NT_CLIENT;
|
||||
arg_string("--client <ip>", argv[++i], gCLIOpts.JoinIp, IP_MAX_LEN);
|
||||
arg_uint("--client <port>", argv[++i], &gCLIOpts.NetworkPort);
|
||||
if ((i + 2) < argc) {
|
||||
arg_uint("--client <port>", argv[++i], &gCLIOpts.NetworkPort);
|
||||
} else {
|
||||
gCLIOpts.NetworkPort = 7777;
|
||||
}
|
||||
|
||||
} else if (strcmp(argv[i], "--cheats") == 0) // Enable cheats menu
|
||||
Cheats.enabled = true;
|
||||
|
|
|
@ -34,7 +34,7 @@ static int keyboard_map_scancode(int scancode) {
|
|||
}
|
||||
|
||||
bool keyboard_on_key_down(int scancode) {
|
||||
#ifdef DEBUG
|
||||
#ifdef DEVELOPMENT
|
||||
debug_keyboard_on_key_down(scancode);
|
||||
#endif
|
||||
|
||||
|
@ -51,7 +51,7 @@ bool keyboard_on_key_down(int scancode) {
|
|||
}
|
||||
|
||||
bool keyboard_on_key_up(int scancode) {
|
||||
#ifdef DEBUG
|
||||
#ifdef DEVELOPMENT
|
||||
debug_keyboard_on_key_up(scancode);
|
||||
#endif
|
||||
djui_interactable_on_key_up(scancode);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "behavior_data.h"
|
||||
#include "behavior_table.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef DEVELOPMENT
|
||||
#include "pc/lua/smlua.h"
|
||||
#include "pc/network/socket/socket.h"
|
||||
|
||||
|
@ -99,7 +99,6 @@ void debug_keyboard_on_key_down(int scancode) {
|
|||
case SCANCODE_ALT: sHoldingAlt = true; break;
|
||||
case SCANCODE_SHIFT: sHoldingShift = true; break;
|
||||
case SCANCODE_3: debug_breakpoint_here(); break;
|
||||
#ifdef DEVELOPMENT
|
||||
case SCANCODE_1: if (sHoldingAlt) { debug_warp_level1(); } break;
|
||||
case SCANCODE_2: if (sHoldingAlt) { debug_warp_level2(); } break;
|
||||
case SCANCODE_4: if (sHoldingAlt) { debug_warp_level3(); } break;
|
||||
|
@ -107,7 +106,6 @@ void debug_keyboard_on_key_down(int scancode) {
|
|||
case SCANCODE_9: if (sHoldingAlt) { debug_warp_to(); } break;
|
||||
case SCANCODE_0: if (sHoldingAlt) { debug_suicide(); } break;
|
||||
case SCANCODE_F5: debug_reload_lua(); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef CONTROLLER_KEYBOARD_DEBUG_H
|
||||
#define CONTROLLER_KEYBOARD_DEBUG_H
|
||||
#ifdef DEBUG
|
||||
#ifdef DEVELOPMENT
|
||||
|
||||
void debug_keyboard_on_key_down(int scancode);
|
||||
void debug_keyboard_on_key_up(int scancode);
|
||||
|
|
|
@ -123,7 +123,8 @@ static void djui_font_hud_render_char(char c) {
|
|||
djui_gfx_render_texture(main_hud_lut[index], 16, 16, 16);
|
||||
}
|
||||
|
||||
static f32 djui_font_hud_char_width(UNUSED char c) {
|
||||
static f32 djui_font_hud_char_width(char c) {
|
||||
if (c == ' ') { return 0.5; }
|
||||
return 0.75f;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "pc/discord/discordrpc.h"
|
||||
#endif
|
||||
#include "pc/network/version.h"
|
||||
#include "pc/network/socket/socket.h"
|
||||
#include "pc/network/network_player.h"
|
||||
#include "pc/djui/djui.h"
|
||||
#include "pc/debuglog.h"
|
||||
|
@ -352,7 +353,8 @@ void main_func(void) {
|
|||
|
||||
if (gCLIOpts.Network == NT_CLIENT) {
|
||||
network_set_system(NS_SOCKET);
|
||||
strncpy(configJoinIp, gCLIOpts.JoinIp, IP_MAX_LEN);
|
||||
snprintf(gGetHostName, MAX_CONFIG_STRING, "%s", gCLIOpts.JoinIp);
|
||||
snprintf(configJoinIp, MAX_CONFIG_STRING, "%s", gCLIOpts.JoinIp);
|
||||
configJoinPort = gCLIOpts.NetworkPort;
|
||||
network_init(NT_CLIENT);
|
||||
} else if (gCLIOpts.Network == NT_SERVER) {
|
||||
|
|
Loading…
Reference in New Issue