Last active
May 29, 2018 06:09
-
-
Save igniuss/330410da676c13a6aee8cb096ee18bbf to your computer and use it in GitHub Desktop.
This file contains 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
-- This mod goes into %appdata%/../locallow/copybugpaste/homebrew14/Lua/ModLua | |
-- Created by Igniuss#6852 | |
-- Toggles *ALL* UI with the press of a button (F5 to be specific) | |
local mod = {} | |
function mod:Start() | |
self.enabled = true | |
self.scalers = {} | |
local c = GameObject.FindObjectsOfType(Canvas) | |
for canvas in Slua.iter(c) do | |
if canvas ~= nil then | |
local group = canvas.gameObject:GetComponent(CanvasGroup) | |
print("No canvasgroup") | |
if Slua.IsNull(group) then | |
group = canvas.gameObject:AddComponent(CanvasGroup) | |
print("Added canvasgroup") | |
end | |
table.insert(self.scalers, group) | |
end | |
end | |
end | |
function mod:Update() | |
if Input.GetKeyDown(KeyCode.F5) then | |
self.enabled = not self.enabled | |
local a = 0 | |
if self.enabled then a = 1; end | |
for k, v in ipairs(self.scalers) do | |
if v and Slua.IsNull(v) == false then | |
v.alpha = a | |
end | |
end | |
HBU.TakingScreenshot = not self.enabled | |
end | |
end | |
return mod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment