Platform modtime, little changes to entergame

master
Henrique Santiago 11 years ago
parent 120c2b4231
commit e85afd4b63

@ -1,4 +1,9 @@
EnterGameWindow < MainWindow
!text: tr('Enter Game')
size: 236 274
EnterGameButton < Button
width: 64
ServerListButton < UIButton
size: 17 17
@ -16,8 +21,6 @@ ServerListButton < UIButton
EnterGameWindow
id: enterGame
!text: tr('Enter Game')
size: 236 274
@onEnter: EnterGame.doLogin()
MenuLabel
@ -130,9 +133,8 @@ EnterGameWindow
anchors.top: prev.bottom
margin-top: 2
Button
EnterGameButton
!text: tr('Ok')
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
@onClick: EnterGame.doLogin()

@ -90,6 +90,7 @@ void Application::registerLuaFunctions()
g_lua.bindSingletonFunction("g_platform", "getCPUName", &Platform::getCPUName, &g_platform);
g_lua.bindSingletonFunction("g_platform", "getTotalSystemMemory", &Platform::getTotalSystemMemory, &g_platform);
g_lua.bindSingletonFunction("g_platform", "getOSName", &Platform::getOSName, &g_platform);
g_lua.bindSingletonFunction("g_platform", "getFileModificationTime", &Platform::getFileModificationTime, &g_platform);
// Application
g_lua.registerSingletonClass("g_app");

@ -43,6 +43,7 @@ public:
std::string getCPUName();
double getTotalSystemMemory();
std::string getOSName();
time_t getFileModificationTime(const std::string& filename);
};
extern Platform g_platform;

@ -160,5 +160,15 @@ std::string Platform::getOSName()
return std::string();
}
time_t Platform::getFileModificationTime(const std::string& filename)
{
struct stat attrib;
if(stat(filename.c_str(), &attrib))
perror(filename.c_str());
else
return attrib.st_mtime;
return 0;
}
#endif

@ -401,4 +401,13 @@ std::string Platform::getOSName()
return ret;
}
time_t Platform::getFileModificationTime(const std::string& filename)
{
//TODO
/*WIN32_FILE_ATTRIBUTE_DATA fileAttrData = {0};
GetFileAttributesEx(filename.c_str(), GetFileExInfoStandard, &fileAttrData);
return fileAttrData.ftLastWriteTime;*/
return 0;
}
#endif

@ -83,7 +83,7 @@ public:
c += (color.g() / 51) * 6;
c += (color.b() / 51);
return c;
};
}
static Color from8bit(int color) {
if(color >= 216 || color <= 0)

Loading…
Cancel
Save