Singe Toolbar for ZB is working!
This commit is contained in:
parent
48564570b3
commit
b9b6236981
4 changed files with 32 additions and 11 deletions
|
@ -891,6 +891,7 @@ void unpackGames(void) {
|
||||||
packageType = x;
|
packageType = x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
x++;
|
||||||
}
|
}
|
||||||
if (packageType >= 0) {
|
if (packageType >= 0) {
|
||||||
showHeader();
|
showHeader();
|
||||||
|
|
13
src/singe.c
13
src/singe.c
|
@ -4621,7 +4621,8 @@ void startControllers(void) {
|
||||||
|
|
||||||
|
|
||||||
void startLuaContext(lua_State *L) {
|
void startLuaContext(lua_State *L) {
|
||||||
size_t length;
|
size_t length;
|
||||||
|
int i;
|
||||||
|
|
||||||
// What to do when bad things happen
|
// What to do when bad things happen
|
||||||
lua_atpanic(L, luaError);
|
lua_atpanic(L, luaError);
|
||||||
|
@ -4639,9 +4640,15 @@ void startLuaContext(lua_State *L) {
|
||||||
lua_getfield(L, -1, "searchers");
|
lua_getfield(L, -1, "searchers");
|
||||||
// Get the number of existing searchers in the table
|
// Get the number of existing searchers in the table
|
||||||
length = lua_rawlen(L, -1);
|
length = lua_rawlen(L, -1);
|
||||||
// Add our own searcher to the list
|
// Shift existing elements to make room for ours
|
||||||
|
for (i=length+1; i>1; i--) {
|
||||||
|
lua_rawgeti(L, -2, i - 1);
|
||||||
|
lua_rawseti(L, -2, i);
|
||||||
|
}
|
||||||
|
// Add our own searcher to the front of the list
|
||||||
lua_pushcfunction(L, luaSearcher);
|
lua_pushcfunction(L, luaSearcher);
|
||||||
lua_rawseti(L, -2, length + 1);
|
//lua_rawseti(L, -2, length + 1);
|
||||||
|
lua_rawseti(L, -2, 1);
|
||||||
// Remove the seachers and the package tables from the stack
|
// Remove the seachers and the package tables from the stack
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 2);
|
||||||
}
|
}
|
||||||
|
|
8
thirdparty/lua/src/loslib.c
vendored
8
thirdparty/lua/src/loslib.c
vendored
|
@ -166,10 +166,16 @@ static int os_rename (lua_State *L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
static int os_tmpname (lua_State *L) {
|
static int os_tmpname (lua_State *L) {
|
||||||
char buff[LUA_TMPNAMBUFSIZE];
|
char buff[LUA_TMPNAMBUFSIZE];
|
||||||
int err;
|
int err;
|
||||||
lua_tmpnam(buff, err);
|
|
||||||
|
//lua_tmpnam(buff, err);
|
||||||
|
int fd = mkstemp(buff); // With this…
|
||||||
|
if (fd >= 0)
|
||||||
|
close(fd);
|
||||||
|
|
||||||
if (l_unlikely(err))
|
if (l_unlikely(err))
|
||||||
return luaL_error(L, "unable to generate a unique filename");
|
return luaL_error(L, "unable to generate a unique filename");
|
||||||
lua_pushstring(L, buff);
|
lua_pushstring(L, buff);
|
||||||
|
|
|
@ -25,6 +25,7 @@ local configId = ID("singemenu.singemenu")
|
||||||
local id = ID("singetoolbar.singemenu")
|
local id = ID("singetoolbar.singemenu")
|
||||||
local tool
|
local tool
|
||||||
local settings
|
local settings
|
||||||
|
local line = "-------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
|
||||||
local function utilDump(o)
|
local function utilDump(o)
|
||||||
|
@ -142,9 +143,13 @@ local function configureSinge(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function singeEnd()
|
||||||
|
ide:Print("\n"..line)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function singeOutput(s)
|
local function singeOutput(s)
|
||||||
--ide:GetOutput():Write(s)
|
ide:GetOutput():Write(s)
|
||||||
ide:Print("[] " .. s)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,6 +158,8 @@ local function startSinge(self)
|
||||||
local cdir = wx.wxFileName.GetCwd()
|
local cdir = wx.wxFileName.GetCwd()
|
||||||
local wdir
|
local wdir
|
||||||
local launch
|
local launch
|
||||||
|
local env
|
||||||
|
local ok
|
||||||
|
|
||||||
if settings then
|
if settings then
|
||||||
if not settings.singe then message = "You must specify the Singe executable in the Singe configuration." end
|
if not settings.singe then message = "You must specify the Singe executable in the Singe configuration." end
|
||||||
|
@ -171,13 +178,13 @@ local function startSinge(self)
|
||||||
launch = settings.singe .. ' ' .. settings.options .. ' -v ' .. settings.video .. ' ' .. settings.script
|
launch = settings.singe .. ' ' .. settings.options .. ' -v ' .. settings.video .. ' ' .. settings.script
|
||||||
launch = launch:gsub(wdir, "./", 1):gsub(wdir, "")
|
launch = launch:gsub(wdir, "./", 1):gsub(wdir, "")
|
||||||
wdir = wx.wxFileName.DirName(wdir):GetFullPath()
|
wdir = wx.wxFileName.DirName(wdir):GetFullPath()
|
||||||
|
ide:Print(line)
|
||||||
ide:Print(launch)
|
ide:Print(launch)
|
||||||
|
|
||||||
ide:ExecuteCommand(launch, wdir, singeOutput)
|
ok, env = wx.wxGetEnv('LUA_CPATH')
|
||||||
|
wx.wxUnsetEnv('LUA_CPATH')
|
||||||
--wx.wxFileName.SetCwd(wdir)
|
ide:ExecuteCommand(launch, wdir, singeOutput, singeEnd)
|
||||||
--wx.wxExecute(launch)
|
wx.wxSetEnv('LUA_CPATH', env)
|
||||||
--wx.wxFileName.SetCwd(cdir)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue