mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Reverted commit bcb6336
This commit is contained in:
@@ -57,17 +57,24 @@ int w_getClipboardText(lua_State *L)
|
|||||||
int w_getPowerInfo(lua_State *L)
|
int w_getPowerInfo(lua_State *L)
|
||||||
{
|
{
|
||||||
int seconds = -1, percent = -1;
|
int seconds = -1, percent = -1;
|
||||||
const char *statestr;
|
const char *str;
|
||||||
|
|
||||||
System::PowerState state = instance->getPowerInfo(seconds, percent);
|
System::PowerState state = instance->getPowerInfo(seconds, percent);
|
||||||
|
|
||||||
if (!System::getConstant(state, statestr))
|
if (!System::getConstant(state, str))
|
||||||
statestr = "unknown";
|
str = "unknown";
|
||||||
|
|
||||||
lua_pushstring(L, statestr);
|
lua_pushstring(L, str);
|
||||||
|
|
||||||
lua_pushinteger(L, percent);
|
if (percent >= 0)
|
||||||
lua_pushinteger(L, seconds);
|
lua_pushinteger(L, percent);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
|
|
||||||
|
if (seconds >= 0)
|
||||||
|
lua_pushinteger(L, seconds);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user