Restore old version code

This commit is contained in:
MysterD 2023-04-20 00:51:34 -07:00
parent 2f59d29f95
commit 491a69549c
8 changed files with 32 additions and 26 deletions

View file

@ -4744,13 +4744,13 @@ PLAYER_INTERACTIONS_SOLID = 1
PLAYER_INTERACTIONS_PVP = 2 PLAYER_INTERACTIONS_PVP = 2
--- @type integer --- @type integer
MAX_RX_SEQ_IDS = 64 MAX_RX_SEQ_IDS = 256
--- @type integer --- @type integer
NETWORK_PLAYER_PING_TIMEOUT = 3 NETWORK_PLAYER_PING_TIMEOUT = 3
--- @type integer --- @type integer
NETWORK_PLAYER_TIMEOUT = 10 NETWORK_PLAYER_TIMEOUT = 15
--- @type integer --- @type integer
UNKNOWN_GLOBAL_INDEX = (-1) UNKNOWN_GLOBAL_INDEX = (-1)
@ -11519,10 +11519,10 @@ SPTASK_STATE_FINISHED = 3
SPTASK_STATE_FINISHED_DP = 4 SPTASK_STATE_FINISHED_DP = 4
--- @type integer --- @type integer
MAX_LOCAL_VERSION_LENGTH = 12 MAX_LOCAL_VERSION_LENGTH = 32
--- @type integer --- @type integer
MAX_VERSION_LENGTH = 10 MAX_VERSION_LENGTH = 28
--- @type integer --- @type integer
MINOR_VERSION_NUMBER = 0 MINOR_VERSION_NUMBER = 0

View file

@ -783,6 +783,7 @@
--- @class Mod --- @class Mod
--- @field public basePath string --- @field public basePath string
--- @field public customBehaviorIndex integer
--- @field public description string --- @field public description string
--- @field public enabled boolean --- @field public enabled boolean
--- @field public fileCount integer --- @field public fileCount integer

View file

@ -1116,6 +1116,7 @@
| Field | Type | Access | | Field | Type | Access |
| ----- | ---- | ------ | | ----- | ---- | ------ |
| basePath | `string` | read-only | | basePath | `string` | read-only |
| customBehaviorIndex | `integer` | read-only |
| description | `string` | read-only | | description | `string` | read-only |
| enabled | `boolean` | read-only | | enabled | `boolean` | read-only |
| fileCount | `integer` | read-only | | fileCount | `integer` | read-only |

View file

@ -893,19 +893,20 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE },
}; };
#define LUA_MOD_FIELD_COUNT 10 #define LUA_MOD_FIELD_COUNT 11
static struct LuaObjectField sModFields[LUA_MOD_FIELD_COUNT] = { static struct LuaObjectField sModFields[LUA_MOD_FIELD_COUNT] = {
{ "basePath", LVT_STRING, offsetof(struct Mod, basePath), true, LOT_NONE }, { "basePath", LVT_STRING, offsetof(struct Mod, basePath), true, LOT_NONE },
{ "description", LVT_STRING_P, offsetof(struct Mod, description), true, LOT_NONE }, { "customBehaviorIndex", LVT_U8, offsetof(struct Mod, customBehaviorIndex), true, LOT_NONE },
{ "enabled", LVT_BOOL, offsetof(struct Mod, enabled), true, LOT_NONE }, { "description", LVT_STRING_P, offsetof(struct Mod, description), true, LOT_NONE },
{ "fileCount", LVT_U16, offsetof(struct Mod, fileCount), true, LOT_NONE }, { "enabled", LVT_BOOL, offsetof(struct Mod, enabled), true, LOT_NONE },
{ "incompatible", LVT_STRING_P, offsetof(struct Mod, incompatible), true, LOT_NONE }, { "fileCount", LVT_U16, offsetof(struct Mod, fileCount), true, LOT_NONE },
{ "index", LVT_S32, offsetof(struct Mod, index), true, LOT_NONE }, { "incompatible", LVT_STRING_P, offsetof(struct Mod, incompatible), true, LOT_NONE },
{ "isDirectory", LVT_BOOL, offsetof(struct Mod, isDirectory), true, LOT_NONE }, { "index", LVT_S32, offsetof(struct Mod, index), true, LOT_NONE },
{ "name", LVT_STRING_P, offsetof(struct Mod, name), true, LOT_NONE }, { "isDirectory", LVT_BOOL, offsetof(struct Mod, isDirectory), true, LOT_NONE },
{ "relativePath", LVT_STRING, offsetof(struct Mod, relativePath), true, LOT_NONE }, { "name", LVT_STRING_P, offsetof(struct Mod, name), true, LOT_NONE },
{ "selectable", LVT_BOOL, offsetof(struct Mod, selectable), true, LOT_NONE }, { "relativePath", LVT_STRING, offsetof(struct Mod, relativePath), true, LOT_NONE },
// { "size", LVT_???, offsetof(struct Mod, size), true, LOT_??? }, <--- UNIMPLEMENTED { "selectable", LVT_BOOL, offsetof(struct Mod, selectable), true, LOT_NONE },
// { "size", LVT_???, offsetof(struct Mod, size), true, LOT_??? }, <--- UNIMPLEMENTED
}; };
#define LUA_MOD_FILE_FIELD_COUNT 3 #define LUA_MOD_FILE_FIELD_COUNT 3

View file

@ -1767,9 +1767,9 @@ char gSmluaConstants[] = ""
"UNKNOWN_LOCAL_INDEX = (-1)\n" "UNKNOWN_LOCAL_INDEX = (-1)\n"
"UNKNOWN_GLOBAL_INDEX = (-1)\n" "UNKNOWN_GLOBAL_INDEX = (-1)\n"
"UNKNOWN_NETWORK_INDEX = (-1)\n" "UNKNOWN_NETWORK_INDEX = (-1)\n"
"NETWORK_PLAYER_TIMEOUT = 10\n" "NETWORK_PLAYER_TIMEOUT = 15\n"
"NETWORK_PLAYER_PING_TIMEOUT = 3\n" "NETWORK_PLAYER_PING_TIMEOUT = 3\n"
"MAX_RX_SEQ_IDS = 64\n" "MAX_RX_SEQ_IDS = 256\n"
"USE_REAL_PALETTE_VAR = 0xFF\n" "USE_REAL_PALETTE_VAR = 0xFF\n"
"NPT_UNKNOWN = 0\n" "NPT_UNKNOWN = 0\n"
"NPT_LOCAL = 1\n" "NPT_LOCAL = 1\n"
@ -4019,6 +4019,6 @@ char gSmluaConstants[] = ""
"VERSION_NUMBER = 34\n" "VERSION_NUMBER = 34\n"
"MINOR_VERSION_NUMBER = 0\n" "MINOR_VERSION_NUMBER = 0\n"
"PATCH_VERSION_NUMBER = 0\n" "PATCH_VERSION_NUMBER = 0\n"
"MAX_VERSION_LENGTH = 10\n" "MAX_VERSION_LENGTH = 28\n"
"MAX_LOCAL_VERSION_LENGTH = 12\n" "MAX_LOCAL_VERSION_LENGTH = 32\n"
; ;

View file

@ -1,13 +1,16 @@
#include <stdio.h> #include <stdio.h>
#include "version.h" #include "version.h"
#include "version_text.h"
#include "types.h" #include "types.h"
static char sVersionString[MAX_VERSION_LENGTH] = { 0 }; static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 }; static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
char* get_version(void) { char* get_version(void) {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s", VERSION_TEXT); if (MINOR_VERSION_NUMBER > 0) {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER);
} else {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d", VERSION_TEXT, VERSION_NUMBER);
}
return sVersionString; return sVersionString;
} }
@ -15,6 +18,6 @@ char* get_version_local(void) {
if (PATCH_VERSION_NUMBER <= 0) { if (PATCH_VERSION_NUMBER <= 0) {
return get_version(); return get_version();
} }
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s.%d", VERSION_TEXT, PATCH_VERSION_NUMBER); snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER);
return sLocalVersionString; return sLocalVersionString;
} }

View file

@ -1,11 +1,13 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
#define VERSION_TEXT "beta"
#define VERSION_NUMBER 34
#define MINOR_VERSION_NUMBER 0
#define PATCH_VERSION_NUMBER 0 #define PATCH_VERSION_NUMBER 0
#define MAX_VERSION_LENGTH 28 #define MAX_VERSION_LENGTH 28
#define MAX_LOCAL_VERSION_LENGTH 32 #define MAX_LOCAL_VERSION_LENGTH 32
char* get_version(void); char* get_version(void);
char* get_version_local(void); char* get_version_local(void);

View file

@ -1,2 +0,0 @@
#pragma once
#define VERSION_TEXT "beta 34"