The decompiled versions of all \domino\ scripts found in Watch_Dogs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
600 B

--Get the lua callstack and trim the output to get the executing project.
--Used in Mission Flow system to get the mission name.
function GetProjectName()
DrawTextToScreen(, 10, "WHITE")
local fullStackStr = System:GetCurrentCallstack();
--Lua Regular Expression
--http://www.lua.org/pil/20.1.html
--http://www.lua.org/pil/20.2.html
--http://www.lua.org/pil/20.3.html
local regexp = "%(domino%\\user%\\[[%w%s%]*%\\]-([%w%s]+)%.[%w%s]+%.lua";
_,_,name = string.find(fullStackStr, regexp);
name or System:Warning("Cannot get Project Name from lua call stack");
return name;
end