Posted 02 October 2014 - 12:44 AM
Window api appeared in CC1.6 but will it work if I copy its file to 1.58 version? I need that info for my newest idea :)/>
if parent == term then
error( "term is not a recommended window parent, try term.current() instead", 2 )
end
Is there any way to check which version of CC im working with?It should work fine, though you might need to remove the code that checks if parent == term (the code bellow), since I don't think earlier versions of CC had term.currentif parent == term then error( "term is not a recommended window parent, try term.current() instead", 2 ) end
local version = os.version()
if version < "CraftOS 1.6" then
--# Version before CC 1.6
elseif version > "CraftOS 1.6" then
--# Version after CC 1.6
else
--# ComputerCraft 1.6
end
you could also just check if certain APIs are nil too.