Created
October 18, 2020 04:03
-
-
Save x4fx77x4f/4d8631d8319b73f90660d26800e91fa4 to your computer and use it in GitHub Desktop.
A crude attempt to make Source Engine games look like they're running on the Xbox 360 when they're not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env luajit | |
local files = { | |
"ChatScheme.res", | |
"ClientScheme.res", | |
"GameMenu.res", | |
"LoadingDialogNoBanner.res", | |
"LoadingDialogNoBannerSingle.res", | |
"LoadingDialogVAC.res", | |
"mdlpicker.res", | |
"mdlpickerrender.res", | |
"mdlpickerscreencaps.res", | |
"modevents.res", | |
"OptionsSubGModLegal.res", | |
"OptionsSubMultiplayer.res", | |
"OptionsSubVoice.res", | |
"SourceScheme.res" | |
} | |
for _, filename in pairs(files) do | |
local handle = io.open(filename, "rw") | |
if handle then | |
local contents = handle:read("*a") | |
local replacements | |
local changes = false | |
contents, replacements = contents:gsub("%[%$X360%]\r\n", "\r\n") | |
changes = changes or replacements > 0 | |
contents, replacements = contents:gsub("%[%$WIN32%]\r\n", "[!$WIN32]\r\n") | |
changes = changes or replacements > 0 | |
contents, replacements = contents:gsub("%[%$WINDOWS%]\r\n", "[!$WIN32]\r\n") | |
changes = changes or replacements > 0 | |
contents, replacements = contents:gsub("%[%$OSX%]\r\n", "[!$WIN32]\r\n") | |
changes = changes or replacements > 0 | |
contents, replacements = contents:gsub("%[%$LINUX%]\r\n", "[!$WIN32]\r\n") | |
changes = changes or replacements > 0 | |
contents, replacements = contents:gsub("%[%$POSIX%]\r\n", "[!$WIN32]\r\n") | |
changes = changes or replacements > 0 | |
if changes then | |
print("Made changes, overwriting "..filename) | |
handle:close() | |
handle = io.open(filename, "w+") | |
handle:write(contents) | |
else | |
print("No changes to "..filename) | |
end | |
handle:close() | |
else | |
print("Could not open "..filename) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment