Added focus module (test, to be replaced)
This commit is contained in:
parent
eacaa63725
commit
2b0031c683
2 changed files with 36 additions and 0 deletions
9
modules/client/cl_focus.txt
Normal file
9
modules/client/cl_focus.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
--@name
|
||||
--@author
|
||||
--@client
|
||||
|
||||
net.receive("LSFT-Get-Focused", function(data)
|
||||
net.start("LSFT-Get-Focused-Resp")
|
||||
net.writeBool(game.hasFocus())
|
||||
net.send()
|
||||
end)
|
27
modules/server/sv_focus.txt
Normal file
27
modules/server/sv_focus.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
--@name
|
||||
--@author
|
||||
--@server
|
||||
|
||||
do
|
||||
function getFocused()
|
||||
net.start("LSFT-Get-Focused")
|
||||
net.send()
|
||||
end
|
||||
|
||||
net.receive("LSFT-Get-Focused-Resp", function(data, ply)
|
||||
print(ply:getName(), net.readBool())
|
||||
end)
|
||||
|
||||
core.modules.getfocus = {
|
||||
version = 1,
|
||||
desc = "Queries all players to see if their game is focused.",
|
||||
commands = {
|
||||
focus = {
|
||||
func = getFocused,
|
||||
usage = "focus",
|
||||
desc = "Prints a list of what the current state of getFocused() is for each player on the server",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
Loading…
Reference in a new issue