Added immutable strings to autogen, added djui_popup_create

This commit is contained in:
MysterD 2022-02-03 00:42:31 -08:00
parent d82dc207aa
commit 271a375510
11 changed files with 133 additions and 91 deletions

View file

@ -15,6 +15,9 @@ def get_path(p):
return os.path.dirname(os.path.realpath(__file__)) + '/../' + p return os.path.dirname(os.path.realpath(__file__)) + '/../' + p
def translate_type_to_lvt(ptype): def translate_type_to_lvt(ptype):
if ptype == 'char*' or ('char' in ptype and '[' in ptype):
return 'LVT_STRING'
if '[' in ptype or '{' in ptype: if '[' in ptype or '{' in ptype:
return 'LOT_???' return 'LOT_???'
if 'enum ' in ptype: if 'enum ' in ptype:
@ -33,9 +36,15 @@ def translate_type_to_lvt(ptype):
if '*' in ptype: if '*' in ptype:
return 'LVT_COBJECT_P' return 'LVT_COBJECT_P'
return 'LVT_COBJECT' return 'LVT_COBJECT'
return 'LVT_???' return 'LVT_???'
def translate_type_to_lot(ptype): def translate_type_to_lot(ptype):
if ptype == 'const char*':
return 'LOT_NONE'
if ptype == 'char*' or ('char' in ptype and '[' in ptype):
return 'LOT_NONE'
if '[' in ptype or '{' in ptype: if '[' in ptype or '{' in ptype:
return 'LOT_???' return 'LOT_???'
if 'enum ' in ptype: if 'enum ' in ptype:
@ -72,6 +81,12 @@ def translate_type_to_lua(ptype):
if ptype.startswith('struct '): if ptype.startswith('struct '):
return ptype.split(' ')[1].replace('*', ''), True return ptype.split(' ')[1].replace('*', ''), True
if ptype == 'const char*':
return 'string', False
if ptype == 'char*' or ('char' in ptype and '[' in ptype):
return 'string', False
if 'Vec3' in ptype: if 'Vec3' in ptype:
return ptype, True return ptype, True

View file

@ -67,6 +67,7 @@ template = """/* THIS FILE IS AUTOGENERATED */
#include "engine/math_util.h" #include "engine/math_util.h"
#include "engine/surface_collision.h" #include "engine/surface_collision.h"
#include "pc/network/network_utils.h" #include "pc/network/network_utils.h"
#include "src/pc/djui/djui_popup.h"
$[FUNCTIONS] $[FUNCTIONS]
@ -159,6 +160,8 @@ def build_param(param, i):
return ' %s %s = smlua_to_integer(L, %d);\n' % (ptype, pid, i) return ' %s %s = smlua_to_integer(L, %d);\n' % (ptype, pid, i)
elif ptype in number_types: elif ptype in number_types:
return ' %s %s = smlua_to_number(L, %d);\n' % (ptype, pid, i) return ' %s %s = smlua_to_number(L, %d);\n' % (ptype, pid, i)
elif ptype == 'const char*':
return ' %s %s = smlua_to_string(L, %d);\n' % (ptype, pid, i)
else: else:
lot = translate_type_to_lot(ptype) lot = translate_type_to_lot(ptype)
s = ' %s %s = (%s)smlua_to_cobject(L, %d, %s);' % (ptype, pid, ptype, i, lot) s = ' %s %s = (%s)smlua_to_cobject(L, %d, %s);' % (ptype, pid, ptype, i, lot)

View file

@ -185,7 +185,7 @@ def get_struct_field_info(struct, field):
lvt = translate_type_to_lvt(ftype) lvt = translate_type_to_lvt(ftype)
lot = translate_type_to_lot(ftype) lot = translate_type_to_lot(ftype)
fimmutable = str(lvt == 'LVT_COBJECT' or lvt == 'LVT_COBJECT_P').lower() fimmutable = str(lvt == 'LVT_COBJECT' or lvt == 'LVT_COBJECT_P' or lvt == 'LVT_STRING').lower()
if sid in override_field_immutable: if sid in override_field_immutable:
if fid in override_field_immutable[sid] or '*' in override_field_immutable[sid]: if fid in override_field_immutable[sid] or '*' in override_field_immutable[sid]:

View file

@ -21,6 +21,7 @@
<br /> <br />
- djui_popup.h - djui_popup.h
- [djui_popup_create](#djui_popup_create)
<br /> <br />
@ -507,6 +508,27 @@
<br /> <br />
## [djui_popup_create](#djui_popup_create)
### Lua Example
`djui_popup_create(message, lines)`
### Parameters
| Field | Type |
| ----- | ---- |
| message | string |
| lines | int |
### Returns
- None
### C Prototype
`void djui_popup_create(const char* message, int lines);`
[:arrow_up_small:](#)
<br />
--- ---
# functions from external.h # functions from external.h

View file

@ -169,6 +169,7 @@
| capModelId | integer | | capModelId | integer |
| capWingModelId | integer | | capWingModelId | integer |
| modelId | integer | | modelId | integer |
| name | string |
| soundAttacked | integer | | soundAttacked | integer |
| soundCoughing1 | integer | | soundCoughing1 | integer |
| soundCoughing2 | integer | | soundCoughing2 | integer |
@ -576,6 +577,7 @@
| lastSent | number | | lastSent | number |
| localIndex | integer | | localIndex | integer |
| modelIndex | integer | | modelIndex | integer |
| name | string |
| onRxSeqId | integer | | onRxSeqId | integer |
| paletteIndex | integer | | paletteIndex | integer |
| type | integer | | type | integer |

View file

@ -33,7 +33,7 @@ static void djui_popup_destroy(struct DjuiBase* base) {
free(popup); free(popup);
} }
struct DjuiPopup* djui_popup_create(const char* message, int lines) { void djui_popup_create(const char* message, int lines) {
struct DjuiPopup* popup = calloc(1, sizeof(struct DjuiPopup)); struct DjuiPopup* popup = calloc(1, sizeof(struct DjuiPopup));
struct DjuiBase* base = &popup->base; struct DjuiBase* base = &popup->base;
@ -57,7 +57,6 @@ struct DjuiPopup* djui_popup_create(const char* message, int lines) {
sPopupListY -= height + 4; sPopupListY -= height + 4;
djui_popup_add_to_list(popup); djui_popup_add_to_list(popup);
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gDefaultSoundArgs); play_sound(SOUND_MENU_PINCH_MARIO_FACE, gDefaultSoundArgs);
return popup;
} }
void djui_popup_update(void) { void djui_popup_update(void) {

View file

@ -7,5 +7,5 @@ struct DjuiPopup {
struct DjuiText* text; struct DjuiText* text;
}; };
struct DjuiPopup* djui_popup_create(const char* message, int lines); void djui_popup_create(const char* message, int lines);
void djui_popup_update(void); void djui_popup_update(void);

View file

@ -92,6 +92,7 @@ static int smlua__get_field(lua_State* L) {
case LVT_F32: lua_pushnumber( L, *(f32*)p); break; case LVT_F32: lua_pushnumber( L, *(f32*)p); break;
case LVT_COBJECT: smlua_push_object(L, data->lot, p); break; case LVT_COBJECT: smlua_push_object(L, data->lot, p); break;
case LVT_COBJECT_P: smlua_push_object(L, data->lot, *(u8**)p); break; case LVT_COBJECT_P: smlua_push_object(L, data->lot, *(u8**)p); break;
case LVT_STRING: lua_pushstring(L, (char*)p); break;
default: default:
LOG_LUA("_get_field on unimplemented type '%d', key '%s'", data->valueType, key); LOG_LUA("_get_field on unimplemented type '%d', key '%s'", data->valueType, key);
return 0; return 0;

View file

@ -12,6 +12,7 @@ enum LuaValueType {
LVT_F32, LVT_F32,
LVT_COBJECT, LVT_COBJECT,
LVT_COBJECT_P, LVT_COBJECT_P,
LVT_STRING,
}; };
enum LuaObjectType { enum LuaObjectType {

View file

@ -95,68 +95,68 @@ static struct LuaObjectField sCameraTriggerFields[LUA_CAMERA_TRIGGER_FIELD_COUNT
// { "event", LVT_???, offsetof(struct CameraTrigger, event), false, LOT_??? }, <--- UNIMPLEMENTED // { "event", LVT_???, offsetof(struct CameraTrigger, event), false, LOT_??? }, <--- UNIMPLEMENTED
}; };
#define LUA_CHARACTER_FIELD_COUNT 55 #define LUA_CHARACTER_FIELD_COUNT 56
static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = { static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = {
{ "animOffsetEnabled", LVT_U8, offsetof(struct Character, animOffsetEnabled), true, LOT_NONE }, { "animOffsetEnabled", LVT_U8, offsetof(struct Character, animOffsetEnabled), true, LOT_NONE },
{ "animOffsetFeet", LVT_F32, offsetof(struct Character, animOffsetFeet), true, LOT_NONE }, { "animOffsetFeet", LVT_F32, offsetof(struct Character, animOffsetFeet), true, LOT_NONE },
{ "animOffsetHand", LVT_F32, offsetof(struct Character, animOffsetHand), true, LOT_NONE }, { "animOffsetHand", LVT_F32, offsetof(struct Character, animOffsetHand), true, LOT_NONE },
{ "animOffsetLowYPoint", LVT_F32, offsetof(struct Character, animOffsetLowYPoint), true, LOT_NONE }, { "animOffsetLowYPoint", LVT_F32, offsetof(struct Character, animOffsetLowYPoint), true, LOT_NONE },
{ "cameraHudHead", LVT_U32, offsetof(struct Character, cameraHudHead), true, LOT_NONE }, { "cameraHudHead", LVT_U32, offsetof(struct Character, cameraHudHead), true, LOT_NONE },
// { "capEnemyDecalGfx", LVT_???, offsetof(struct Character, capEnemyDecalGfx), true, LOT_??? }, <--- UNIMPLEMENTED // { "capEnemyDecalGfx", LVT_???, offsetof(struct Character, capEnemyDecalGfx), true, LOT_??? }, <--- UNIMPLEMENTED
// { "capEnemyGfx", LVT_???, offsetof(struct Character, capEnemyGfx), true, LOT_??? }, <--- UNIMPLEMENTED // { "capEnemyGfx", LVT_???, offsetof(struct Character, capEnemyGfx), true, LOT_??? }, <--- UNIMPLEMENTED
{ "capEnemyLayer", LVT_U8, offsetof(struct Character, capEnemyLayer), true, LOT_NONE }, { "capEnemyLayer", LVT_U8, offsetof(struct Character, capEnemyLayer), true, LOT_NONE },
{ "capMetalModelId", LVT_U32, offsetof(struct Character, capMetalModelId), true, LOT_NONE }, { "capMetalModelId", LVT_U32, offsetof(struct Character, capMetalModelId), true, LOT_NONE },
{ "capMetalWingModelId", LVT_U32, offsetof(struct Character, capMetalWingModelId), true, LOT_NONE }, { "capMetalWingModelId", LVT_U32, offsetof(struct Character, capMetalWingModelId), true, LOT_NONE },
{ "capModelId", LVT_U32, offsetof(struct Character, capModelId), true, LOT_NONE }, { "capModelId", LVT_U32, offsetof(struct Character, capModelId), true, LOT_NONE },
{ "capWingModelId", LVT_U32, offsetof(struct Character, capWingModelId), true, LOT_NONE }, { "capWingModelId", LVT_U32, offsetof(struct Character, capWingModelId), true, LOT_NONE },
// { "hudHead", LVT_???, offsetof(struct Character, hudHead), true, LOT_??? }, <--- UNIMPLEMENTED // { "hudHead", LVT_???, offsetof(struct Character, hudHead), true, LOT_??? }, <--- UNIMPLEMENTED
// { "hudHeadTexture", LVT_???, offsetof(struct Character, hudHeadTexture), true, LOT_??? }, <--- UNIMPLEMENTED // { "hudHeadTexture", LVT_???, offsetof(struct Character, hudHeadTexture), true, LOT_??? }, <--- UNIMPLEMENTED
{ "modelId", LVT_U32, offsetof(struct Character, modelId), true, LOT_NONE }, { "modelId", LVT_U32, offsetof(struct Character, modelId), true, LOT_NONE },
// { "name", LVT_???, offsetof(struct Character, name), true, LOT_??? }, <--- UNIMPLEMENTED { "name", LVT_STRING, offsetof(struct Character, name), true, LOT_NONE },
{ "soundAttacked", LVT_S32, offsetof(struct Character, soundAttacked), true, LOT_NONE }, { "soundAttacked", LVT_S32, offsetof(struct Character, soundAttacked), true, LOT_NONE },
{ "soundCoughing1", LVT_S32, offsetof(struct Character, soundCoughing1), true, LOT_NONE }, { "soundCoughing1", LVT_S32, offsetof(struct Character, soundCoughing1), true, LOT_NONE },
{ "soundCoughing2", LVT_S32, offsetof(struct Character, soundCoughing2), true, LOT_NONE }, { "soundCoughing2", LVT_S32, offsetof(struct Character, soundCoughing2), true, LOT_NONE },
{ "soundCoughing3", LVT_S32, offsetof(struct Character, soundCoughing3), true, LOT_NONE }, { "soundCoughing3", LVT_S32, offsetof(struct Character, soundCoughing3), true, LOT_NONE },
{ "soundDoh", LVT_S32, offsetof(struct Character, soundDoh), true, LOT_NONE }, { "soundDoh", LVT_S32, offsetof(struct Character, soundDoh), true, LOT_NONE },
{ "soundDrowning", LVT_S32, offsetof(struct Character, soundDrowning), true, LOT_NONE }, { "soundDrowning", LVT_S32, offsetof(struct Character, soundDrowning), true, LOT_NONE },
{ "soundDying", LVT_S32, offsetof(struct Character, soundDying), true, LOT_NONE }, { "soundDying", LVT_S32, offsetof(struct Character, soundDying), true, LOT_NONE },
{ "soundEeuh", LVT_S32, offsetof(struct Character, soundEeuh), true, LOT_NONE }, { "soundEeuh", LVT_S32, offsetof(struct Character, soundEeuh), true, LOT_NONE },
{ "soundFreqScale", LVT_F32, offsetof(struct Character, soundFreqScale), true, LOT_NONE }, { "soundFreqScale", LVT_F32, offsetof(struct Character, soundFreqScale), true, LOT_NONE },
{ "soundGameOver", LVT_S32, offsetof(struct Character, soundGameOver), true, LOT_NONE }, { "soundGameOver", LVT_S32, offsetof(struct Character, soundGameOver), true, LOT_NONE },
{ "soundGroundPoundWah", LVT_S32, offsetof(struct Character, soundGroundPoundWah), true, LOT_NONE }, { "soundGroundPoundWah", LVT_S32, offsetof(struct Character, soundGroundPoundWah), true, LOT_NONE },
{ "soundHaha", LVT_S32, offsetof(struct Character, soundHaha), true, LOT_NONE }, { "soundHaha", LVT_S32, offsetof(struct Character, soundHaha), true, LOT_NONE },
{ "soundHaha_2", LVT_S32, offsetof(struct Character, soundHaha_2), true, LOT_NONE }, { "soundHaha_2", LVT_S32, offsetof(struct Character, soundHaha_2), true, LOT_NONE },
{ "soundHello", LVT_S32, offsetof(struct Character, soundHello), true, LOT_NONE }, { "soundHello", LVT_S32, offsetof(struct Character, soundHello), true, LOT_NONE },
{ "soundHereWeGo", LVT_S32, offsetof(struct Character, soundHereWeGo), true, LOT_NONE }, { "soundHereWeGo", LVT_S32, offsetof(struct Character, soundHereWeGo), true, LOT_NONE },
{ "soundHoohoo", LVT_S32, offsetof(struct Character, soundHoohoo), true, LOT_NONE }, { "soundHoohoo", LVT_S32, offsetof(struct Character, soundHoohoo), true, LOT_NONE },
{ "soundHrmm", LVT_S32, offsetof(struct Character, soundHrmm), true, LOT_NONE }, { "soundHrmm", LVT_S32, offsetof(struct Character, soundHrmm), true, LOT_NONE },
{ "soundImaTired", LVT_S32, offsetof(struct Character, soundImaTired), true, LOT_NONE }, { "soundImaTired", LVT_S32, offsetof(struct Character, soundImaTired), true, LOT_NONE },
{ "soundMamaMia", LVT_S32, offsetof(struct Character, soundMamaMia), true, LOT_NONE }, { "soundMamaMia", LVT_S32, offsetof(struct Character, soundMamaMia), true, LOT_NONE },
{ "soundOnFire", LVT_S32, offsetof(struct Character, soundOnFire), true, LOT_NONE }, { "soundOnFire", LVT_S32, offsetof(struct Character, soundOnFire), true, LOT_NONE },
{ "soundOoof", LVT_S32, offsetof(struct Character, soundOoof), true, LOT_NONE }, { "soundOoof", LVT_S32, offsetof(struct Character, soundOoof), true, LOT_NONE },
{ "soundOoof2", LVT_S32, offsetof(struct Character, soundOoof2), true, LOT_NONE }, { "soundOoof2", LVT_S32, offsetof(struct Character, soundOoof2), true, LOT_NONE },
{ "soundPanting", LVT_S32, offsetof(struct Character, soundPanting), true, LOT_NONE }, { "soundPanting", LVT_S32, offsetof(struct Character, soundPanting), true, LOT_NONE },
{ "soundPantingCold", LVT_S32, offsetof(struct Character, soundPantingCold), true, LOT_NONE }, { "soundPantingCold", LVT_S32, offsetof(struct Character, soundPantingCold), true, LOT_NONE },
{ "soundPressStartToPlay", LVT_S32, offsetof(struct Character, soundPressStartToPlay), true, LOT_NONE }, { "soundPressStartToPlay", LVT_S32, offsetof(struct Character, soundPressStartToPlay), true, LOT_NONE },
{ "soundPunchHoo", LVT_S32, offsetof(struct Character, soundPunchHoo), true, LOT_NONE }, { "soundPunchHoo", LVT_S32, offsetof(struct Character, soundPunchHoo), true, LOT_NONE },
{ "soundPunchWah", LVT_S32, offsetof(struct Character, soundPunchWah), true, LOT_NONE }, { "soundPunchWah", LVT_S32, offsetof(struct Character, soundPunchWah), true, LOT_NONE },
{ "soundPunchYah", LVT_S32, offsetof(struct Character, soundPunchYah), true, LOT_NONE }, { "soundPunchYah", LVT_S32, offsetof(struct Character, soundPunchYah), true, LOT_NONE },
{ "soundSnoring1", LVT_S32, offsetof(struct Character, soundSnoring1), true, LOT_NONE }, { "soundSnoring1", LVT_S32, offsetof(struct Character, soundSnoring1), true, LOT_NONE },
{ "soundSnoring2", LVT_S32, offsetof(struct Character, soundSnoring2), true, LOT_NONE }, { "soundSnoring2", LVT_S32, offsetof(struct Character, soundSnoring2), true, LOT_NONE },
{ "soundSnoring3", LVT_S32, offsetof(struct Character, soundSnoring3), true, LOT_NONE }, { "soundSnoring3", LVT_S32, offsetof(struct Character, soundSnoring3), true, LOT_NONE },
{ "soundSoLongaBowser", LVT_S32, offsetof(struct Character, soundSoLongaBowser), true, LOT_NONE }, { "soundSoLongaBowser", LVT_S32, offsetof(struct Character, soundSoLongaBowser), true, LOT_NONE },
{ "soundTwirlBounce", LVT_S32, offsetof(struct Character, soundTwirlBounce), true, LOT_NONE }, { "soundTwirlBounce", LVT_S32, offsetof(struct Character, soundTwirlBounce), true, LOT_NONE },
{ "soundUh", LVT_S32, offsetof(struct Character, soundUh), true, LOT_NONE }, { "soundUh", LVT_S32, offsetof(struct Character, soundUh), true, LOT_NONE },
{ "soundUh2", LVT_S32, offsetof(struct Character, soundUh2), true, LOT_NONE }, { "soundUh2", LVT_S32, offsetof(struct Character, soundUh2), true, LOT_NONE },
{ "soundUh2_2", LVT_S32, offsetof(struct Character, soundUh2_2), true, LOT_NONE }, { "soundUh2_2", LVT_S32, offsetof(struct Character, soundUh2_2), true, LOT_NONE },
{ "soundWaaaooow", LVT_S32, offsetof(struct Character, soundWaaaooow), true, LOT_NONE }, { "soundWaaaooow", LVT_S32, offsetof(struct Character, soundWaaaooow), true, LOT_NONE },
{ "soundWah2", LVT_S32, offsetof(struct Character, soundWah2), true, LOT_NONE }, { "soundWah2", LVT_S32, offsetof(struct Character, soundWah2), true, LOT_NONE },
{ "soundWhoa", LVT_S32, offsetof(struct Character, soundWhoa), true, LOT_NONE }, { "soundWhoa", LVT_S32, offsetof(struct Character, soundWhoa), true, LOT_NONE },
{ "soundYahWahHoo", LVT_S32, offsetof(struct Character, soundYahWahHoo), true, LOT_NONE }, { "soundYahWahHoo", LVT_S32, offsetof(struct Character, soundYahWahHoo), true, LOT_NONE },
{ "soundYahoo", LVT_S32, offsetof(struct Character, soundYahoo), true, LOT_NONE }, { "soundYahoo", LVT_S32, offsetof(struct Character, soundYahoo), true, LOT_NONE },
{ "soundYahooWahaYippee", LVT_S32, offsetof(struct Character, soundYahooWahaYippee), true, LOT_NONE }, { "soundYahooWahaYippee", LVT_S32, offsetof(struct Character, soundYahooWahaYippee), true, LOT_NONE },
{ "soundYawning", LVT_S32, offsetof(struct Character, soundYawning), true, LOT_NONE }, { "soundYawning", LVT_S32, offsetof(struct Character, soundYawning), true, LOT_NONE },
{ "type", LVT_S32, offsetof(struct Character, type), true, LOT_NONE }, { "type", LVT_S32, offsetof(struct Character, type), true, LOT_NONE },
}; };
#define LUA_CONTROLLER_FIELD_COUNT 10 #define LUA_CONTROLLER_FIELD_COUNT 10
@ -434,28 +434,28 @@ static struct LuaObjectField sModeTransitionInfoFields[LUA_MODE_TRANSITION_INFO_
{ "transitionStart", LVT_COBJECT, offsetof(struct ModeTransitionInfo, transitionStart), true, LOT_LINEARTRANSITIONPOINT }, { "transitionStart", LVT_COBJECT, offsetof(struct ModeTransitionInfo, transitionStart), true, LOT_LINEARTRANSITIONPOINT },
}; };
#define LUA_NETWORK_PLAYER_FIELD_COUNT 17 #define LUA_NETWORK_PLAYER_FIELD_COUNT 18
static struct LuaObjectField sNetworkPlayerFields[LUA_NETWORK_PLAYER_FIELD_COUNT] = { static struct LuaObjectField sNetworkPlayerFields[LUA_NETWORK_PLAYER_FIELD_COUNT] = {
{ "connected", LVT_BOOL, offsetof(struct NetworkPlayer, connected), true, LOT_NONE }, { "connected", LVT_BOOL, offsetof(struct NetworkPlayer, connected), true, LOT_NONE },
{ "currActNum", LVT_S16, offsetof(struct NetworkPlayer, currActNum), true, LOT_NONE }, { "currActNum", LVT_S16, offsetof(struct NetworkPlayer, currActNum), true, LOT_NONE },
{ "currAreaIndex", LVT_S16, offsetof(struct NetworkPlayer, currAreaIndex), true, LOT_NONE }, { "currAreaIndex", LVT_S16, offsetof(struct NetworkPlayer, currAreaIndex), true, LOT_NONE },
{ "currAreaSyncValid", LVT_BOOL, offsetof(struct NetworkPlayer, currAreaSyncValid), true, LOT_NONE }, { "currAreaSyncValid", LVT_BOOL, offsetof(struct NetworkPlayer, currAreaSyncValid), true, LOT_NONE },
{ "currCourseNum", LVT_S16, offsetof(struct NetworkPlayer, currCourseNum), true, LOT_NONE }, { "currCourseNum", LVT_S16, offsetof(struct NetworkPlayer, currCourseNum), true, LOT_NONE },
{ "currLevelAreaSeqId", LVT_U16, offsetof(struct NetworkPlayer, currLevelAreaSeqId), true, LOT_NONE }, { "currLevelAreaSeqId", LVT_U16, offsetof(struct NetworkPlayer, currLevelAreaSeqId), true, LOT_NONE },
{ "currLevelNum", LVT_S16, offsetof(struct NetworkPlayer, currLevelNum), true, LOT_NONE }, { "currLevelNum", LVT_S16, offsetof(struct NetworkPlayer, currLevelNum), true, LOT_NONE },
{ "currLevelSyncValid", LVT_BOOL, offsetof(struct NetworkPlayer, currLevelSyncValid), true, LOT_NONE }, { "currLevelSyncValid", LVT_BOOL, offsetof(struct NetworkPlayer, currLevelSyncValid), true, LOT_NONE },
{ "fadeOpacity", LVT_U8, offsetof(struct NetworkPlayer, fadeOpacity), true, LOT_NONE }, { "fadeOpacity", LVT_U8, offsetof(struct NetworkPlayer, fadeOpacity), true, LOT_NONE },
{ "globalIndex", LVT_U8, offsetof(struct NetworkPlayer, globalIndex), true, LOT_NONE }, { "globalIndex", LVT_U8, offsetof(struct NetworkPlayer, globalIndex), true, LOT_NONE },
{ "lastReceived", LVT_F32, offsetof(struct NetworkPlayer, lastReceived), true, LOT_NONE }, { "lastReceived", LVT_F32, offsetof(struct NetworkPlayer, lastReceived), true, LOT_NONE },
{ "lastSent", LVT_F32, offsetof(struct NetworkPlayer, lastSent), true, LOT_NONE }, { "lastSent", LVT_F32, offsetof(struct NetworkPlayer, lastSent), true, LOT_NONE },
{ "localIndex", LVT_U8, offsetof(struct NetworkPlayer, localIndex), true, LOT_NONE }, { "localIndex", LVT_U8, offsetof(struct NetworkPlayer, localIndex), true, LOT_NONE },
{ "modelIndex", LVT_U8, offsetof(struct NetworkPlayer, modelIndex), true, LOT_NONE }, { "modelIndex", LVT_U8, offsetof(struct NetworkPlayer, modelIndex), true, LOT_NONE },
// { "name", LOT_???, offsetof(struct NetworkPlayer, name), true, LOT_??? }, <--- UNIMPLEMENTED { "name", LVT_STRING, offsetof(struct NetworkPlayer, name), true, LOT_NONE },
{ "onRxSeqId", LVT_U8, offsetof(struct NetworkPlayer, onRxSeqId), true, LOT_NONE }, { "onRxSeqId", LVT_U8, offsetof(struct NetworkPlayer, onRxSeqId), true, LOT_NONE },
{ "paletteIndex", LVT_U8, offsetof(struct NetworkPlayer, paletteIndex), true, LOT_NONE }, { "paletteIndex", LVT_U8, offsetof(struct NetworkPlayer, paletteIndex), true, LOT_NONE },
// { "rxPacketHash", LOT_???, offsetof(struct NetworkPlayer, rxPacketHash), true, LOT_??? }, <--- UNIMPLEMENTED // { "rxPacketHash", LOT_???, offsetof(struct NetworkPlayer, rxPacketHash), true, LOT_??? }, <--- UNIMPLEMENTED
// { "rxSeqIds", LOT_???, offsetof(struct NetworkPlayer, rxSeqIds), true, LOT_??? }, <--- UNIMPLEMENTED // { "rxSeqIds", LOT_???, offsetof(struct NetworkPlayer, rxSeqIds), true, LOT_??? }, <--- UNIMPLEMENTED
{ "type", LVT_U8, offsetof(struct NetworkPlayer, type), true, LOT_NONE }, { "type", LVT_U8, offsetof(struct NetworkPlayer, type), true, LOT_NONE },
}; };
#define LUA_OBJECT_FIELD_COUNT 22 #define LUA_OBJECT_FIELD_COUNT 22

View file

@ -13,6 +13,7 @@
#include "engine/math_util.h" #include "engine/math_util.h"
#include "engine/surface_collision.h" #include "engine/surface_collision.h"
#include "pc/network/network_utils.h" #include "pc/network/network_utils.h"
#include "src/pc/djui/djui_popup.h"
////////////// //////////////
// camera.h // // camera.h //
@ -188,20 +189,18 @@ int smlua_func_update_character_anim_offset(lua_State* L) {
// djui_popup.h // // djui_popup.h //
////////////////// //////////////////
/*
int smlua_func_djui_popup_create(lua_State* L) { int smlua_func_djui_popup_create(lua_State* L) {
if(!smlua_functions_valid_param_count(L, 2)) { return 0; } if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
// const char* message = (const char*)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED const char* message = smlua_to_string(L, 1);
if (!gSmLuaConvertSuccess) { return 0; } if (!gSmLuaConvertSuccess) { return 0; }
int lines = smlua_to_integer(L, 2); int lines = smlua_to_integer(L, 2);
if (!gSmLuaConvertSuccess) { return 0; } if (!gSmLuaConvertSuccess) { return 0; }
UNIMPLEMENTED -->(L, djui_popup_create(message, lines)); djui_popup_create(message, lines);
return 1; return 1;
} }
*/
//////////////// ////////////////
// external.h // // external.h //
@ -2906,7 +2905,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "update_character_anim_offset", smlua_func_update_character_anim_offset); smlua_bind_function(L, "update_character_anim_offset", smlua_func_update_character_anim_offset);
// djui_popup.h // djui_popup.h
//smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create); <--- UNIMPLEMENTED smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create);
// external.h // external.h
smlua_bind_function(L, "fade_volume_scale", smlua_func_fade_volume_scale); smlua_bind_function(L, "fade_volume_scale", smlua_func_fade_volume_scale);