Restore periodicalEvent function

* and typo fixes
This commit is contained in:
Eduardo Bart 2012-07-10 14:36:18 -03:00
parent 351115d9d9
commit d39ca7de10
3 changed files with 21 additions and 2 deletions

View File

@ -13,7 +13,7 @@ Beyond of it's flexibility with scripts, otclient comes with tons of other featu
the creation of new client side stuff in otserv that was not possible before. These include,
sound system, graphics effects with shaders, particle engines, modules/addons system, animated textures,
styleable user interface, transparency, multi language, in game lua terminal, an OpenGL 1.1/2.0 ES engine that make possible to
run on mobile platforms like Androi/iPhon/iPad and much more. Otclient is also flexible enough to
run on mobile platforms like Android/iPhone/iPad and much more. Otclient is also flexible enough to
create tibia tools like map editors just using scripts, because it wasn't designed to be just a
client, instead otclient was designed to be a combination of a framework and tibia APIs.

View File

@ -31,6 +31,25 @@ function cycleEvent(callback, front)
return event
end
function periodicalEvent(eventFunc, conditionFunc, delay, autoRepeatDelay)
delay = delay or 30
autoRepeatDelay = autoRepeatDelay or delay
local func
func = function()
if conditionFunc and not conditionFunc() then
func = nil
return
end
eventFunc()
scheduleEvent(func, delay)
end
scheduleEvent(function()
func()
end, autoRepeatDelay)
end
function removeEvent(event)
if event then
event:cancel()

View File

@ -62,7 +62,7 @@ void ResourceManager::discoverWorkDir(const std::string& appName, const std::str
}
if(!found)
g_logger.fatal("Unable to find application work directory.");
g_logger.fatal(stdext::format("Unable to find %s, the application cannot be initialized.", existentFile));
}
bool ResourceManager::setupWriteDir(const std::string& appWriteDirName)