Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GLOBAL.setmetatable(env, {__index=function(t,k) return GLOBAL.rawget(GLOBAL,k) end})
- --> That's is just a merge of mod env and global env
- ------------------------------------------------------------------------------------
- local UpvalueHacker = require("tools/upvaluehacker")
- local function RGB(n)
- return Point(n/255, n/255, n/255)
- end
- local INTERIOR_COLOUR = RGB(0)
- local DUSK_COLOUR = RGB(150)
- --> Your if statement was checking if the game was on the hamlet map,
- -- so interiors outside the hamlet map got weird light at dusk
- local function GetDuskColour()
- return TheCamera.interior and INTERIOR_COLOUR or DUSK_COLOUR
- end
- --> I also removed the spring color change, as in the game it is not applied (at least in the hamlet and other files I looked at)
- local function SetGetDuskColour(initial_fn)
- if initial_fn then
- UpvalueHacker.SetUpvalue(initial_fn, GetDuskColour, "GetDuskColour")
- end
- end
- AddComponentPostInit("clock", function(self)
- self.duskColour = DUSK_COLOUR
- SetGetDuskColour(self.OnUpdate) --Here I set the new function to all places where it was used, instead of just in StartDusk.
- SetGetDuskColour(self.StartDusk)
- SetGetDuskColour(self.LongUpdate)
- SetGetDuskColour(self.updateAmibentColor)
- end)
- local RBG = nil
- local UpvalueHacker = nil
- local SetGetDuskColour = nil
Advertisement
Add Comment
Please, Sign In to add comment