Skip to content

Commit c1e873a

Browse files
committed
hedit: change outputDebugString behavior
Changes the function override for `outputDebugString` to always output errors and warnings, instead of only in `DEBUGMODE`.
1 parent 0131b80 commit c1e873a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

[gameplay]/hedit/server/core.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ addEventHandler ( "onResourceStart", resourceRoot, function ( )
88
local resName = getResourceName ( resource )
99

1010
if resName ~= "hedit" and not DEBUGMODE then
11-
print ( "[HEDIT] Please rename resource '"..resName.."' to 'hedit' to use the handling editor.")
11+
outputDebugString ( "[HEDIT] Please rename resource '"..resName.."' to 'hedit' to use the handling editor.", 1)
1212
return cancelEvent ( true, "Rename the handling editor resource to 'hedit' in order to use the resource." )
1313
end
1414

1515
if fileExists ( "handling.cfg" ) then
16-
print ( "[HEDIT] Handling.cfg found; type 'loadcfg' to load handling.cfg into the memory.")
16+
outputDebugString ( "[HEDIT] Handling.cfg found; type 'loadcfg' to load handling.cfg into the memory.")
1717
end
1818

1919
--Parse meta settings

[gameplay]/hedit/server/utils.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ function parseMetaSettings()
123123
propertySettings[handlingProperty] = tobool(settingExists)
124124
else
125125
propertySettings[handlingProperty] = false
126-
print("Missing setting for "..handlingProperty..", defaulting to false.")
127126
outputDebugString("Missing setting for "..handlingProperty..", defaulting to false.", 2)
128127
end
129128
end

[gameplay]/hedit/shared/wrappers/general.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ end
1111

1212

1313
_outputDebugString = outputDebugString
14-
function outputDebugString(...)
15-
if DEBUGMODE then
16-
return _outputDebugString(...)
17-
end
14+
function outputDebugString(string, level, r, g, b)
15+
if not level then level = 3 end
16+
if (not DEBUGMODE) and level >= 3 then return end
17+
return _outputDebugString(string, level, r, g, b)
1818
end
1919

2020

0 commit comments

Comments
 (0)