mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
73 lines
2.9 KiB
Lua
73 lines
2.9 KiB
Lua
--[[
|
||
| This file was obtained through the combined efforts
|
||
| of Madbluntz & Plymouth Antiquarian Society.
|
||
|
|
||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||
| Maloy, DrPepper10 @ RIP, Atle!
|
||
|
|
||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||
--]]
|
||
|
||
|
||
PLUGIN.name = "Message Flash"
|
||
PLUGIN.description = "Flashes the client's Garry's Mod application when a message is posted in the chat."
|
||
PLUGIN.author = "Aspect™"
|
||
PLUGIN.readme = [[
|
||
Many people have been in this situation: You are playing in a server, and you are waiting for something, so you decide to tab out for just a bit, to do something else. Before you know it, someone has approached you and has been waiting for you to reply to his message for several minutes.
|
||
|
||
This plugin flashes your Garry's Mod application to alert you when you receive a message, allowing you to jump back into the roleplay when needed.]]
|
||
PLUGIN.license = [[
|
||
MIT License
|
||
|
||
Copyright (c) 2021 Aspect™
|
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
of this software and associated documentation files (the "Software"), to deal
|
||
in the Software without restriction, including without limitation the rights
|
||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
copies of the Software, and to permit persons to whom the Software is
|
||
furnished to do so, subject to the following conditions:
|
||
|
||
The above copyright notice and this permission notice shall be included in all
|
||
copies or substantial portions of the Software.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
SOFTWARE.
|
||
]]
|
||
|
||
ix.lang.AddTable("english", {
|
||
optFlashWindow = "Pencereyi Parlat",
|
||
optdFlashWindow = "Garry's Mod'da bir mesaj gönderildiğinde uygulamanızın parlaması gerekip gerekmediği.",
|
||
optOnlyFlashDirect = "Sadece özel mesajlarda pencereyi parlat.",
|
||
optdOnlyFlashDirect = "Garry's Mod uygulamasının sadece size doğrudan konuşan biri olduğunda (PM'leri içerir) parlaması gerekip gerekmediği.",
|
||
})
|
||
|
||
ix.option.Add("flashWindow", ix.type.bool, true, {
|
||
category = "chat"
|
||
})
|
||
|
||
ix.option.Add("onlyFlashDirect", ix.type.bool, true, {
|
||
category = "chat"
|
||
})
|
||
|
||
if (CLIENT) then
|
||
function PLUGIN:MessageReceived(client, info)
|
||
if (!client or !info) then return end
|
||
|
||
if (ix.option.Get("flashWindow", true) and system.IsWindows() and !system.HasFocus()) then
|
||
if (ix.option.Get("onlyFlashDirect", true)) then
|
||
if (client:GetEyeTraceNoCursor().Entity == LocalPlayer() or info.chatType == "pm") then
|
||
system.FlashWindow()
|
||
end
|
||
else
|
||
system.FlashWindow()
|
||
end
|
||
end
|
||
end
|
||
end
|