Skip to content

Commit 07faa91

Browse files
committed
Enabled experimental Graphics module with some changes and added armor slots to inventory
1 parent 0b0062c commit 07faa91

File tree

9 files changed

+591
-231
lines changed

9 files changed

+591
-231
lines changed

Includes/Core/Graphics.hpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,10 @@
44

55
#include <CTRPluginFramework.hpp>
66

7-
typedef enum DrawCommandID : u8 {
8-
DRAWCMD_RECT,
9-
DRAWCMD_RECTFILL,
10-
DRAWCMD_PRINT,
11-
} DrawCommandID;
12-
13-
typedef struct {
14-
DrawCommandID id;
15-
std::string text;
16-
int x, y, width, height;
17-
u32 color1;
18-
u32 color2;
19-
bool topScreen;
20-
} DrawCommandInfo;
21-
227
namespace Core {
23-
namespace Graphics {
24-
void PushCommand(const DrawCommandInfo &cmd);
25-
}
26-
27-
bool GraphicsHandlerCallback(const CTRPluginFramework::Screen &screen);
8+
void GraphicsHandlerCallback();
289

29-
namespace Game {
10+
namespace Module {
3011
bool RegisterGraphicsModule(lua_State *L);
3112
}
3213
}

Sources/Core/Event.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -98,39 +98,6 @@ void Core::EventHandlerCallback()
9898
}
9999
lua_pop(L, 3);
100100
}
101-
102-
#ifdef EXPERIMENTAL
103-
lua_getglobal(L, "Game");
104-
lua_getfield(L, -1, "Event");
105-
lua_getfield(L, -1, "OnNewFrame");
106-
lua_getfield(L, -1, "Trigger");
107-
108-
if (lua_isfunction(L, -1))
109-
{
110-
lua_pushvalue(L, -2);
111-
lua_pushstring(L, "top");
112-
graphicsIsTop.store(true);
113-
if (lua_pcall(L, 2, 0, 0))
114-
{
115-
Core::Debug::LogError("Core::Event::OnNewFrame(top) error: " + std::string(lua_tostring(L, -1)));
116-
lua_pop(L, 1);
117-
}
118-
lua_getfield(L, -1, "Trigger");
119-
lua_pushvalue(L, -2);
120-
lua_pushstring(L, "bottom");
121-
graphicsIsTop.store(false);
122-
if (lua_pcall(L, 2, 0, 0))
123-
{
124-
Core::Debug::LogError("Core::Event::OnNewFrame(bottom) error: " + std::string(lua_tostring(L, -1)));
125-
lua_pop(L, 1);
126-
}
127-
}
128-
else {
129-
Core::Debug::LogError("Core::Event::OnNewFrame::Trigger error. Unexpected type");
130-
lua_pop(L, 1);
131-
}
132-
lua_pop(L, 3);
133-
#endif
134101
}
135102

136103
void Core::Event::TriggerOnPlayerJoinWorld(lua_State *L) {
@@ -309,15 +276,6 @@ bool Core::Game::RegisterEventModule(lua_State *L)
309276
lua_getglobal(L, "Game");
310277
lua_getfield(L, -1, "Event");
311278

312-
#ifdef EXPERIMENTAL
313-
//--$@@@Game.Event.OnNewFrame: EventClass
314-
lua_newtable(L);
315-
lua_newtable(L);
316-
lua_setfield(L, -2, "listeners");
317-
luaC_setmetatable(L, "EventClass");
318-
lua_setfield(L, -2, "OnNewFrame");
319-
#endif
320-
321279
//$@@@Game.Event.OnKeyPressed: EventClass
322280
lua_newtable(L);
323281
lua_newtable(L);

0 commit comments

Comments
 (0)