File: hideinv.lua

package info (click to toggle)
instead 3.5.2%2Bdfsg-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,316 kB
  • sloc: ansic: 28,336; sh: 452; makefile: 236
file content (24 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local attr = "hideinv"
if stead.api_atleast(1, 6, 3) then
	game.gui.hideinv = function(s)
		if stead.call_bool(stead.here(), 'hideinv') then
			return true
		end
	end
	attr = "noinv"
end
room = stead.inherit(room, function(v)
	v.entered = stead.hook(v.entered, function(f, s, ...)
		if stead.call_bool(s, attr) then
			me():disable_all();
		end
		return f(s, ...)
	end)
	v.left = stead.hook(v.left, function(f, s, ...)
		if stead.call_bool(s, attr) then
			me():enable_all();
		end
		return f(s, ...)
	end)
	return v
end)