This file contains hidden or 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
AddCSLuaFile() | |
if SERVER then return end | |
local default_color = Color(68, 112, 146, 255) | |
local black_color = Color(0, 0, 0, 255) | |
local function default_trace() | |
local eye_pos = EyePos() | |
return util.TraceLine({ |
This file contains hidden or 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
html { | |
background-image: none !important; | |
} | |
body { | |
margin: 0px !important; | |
max-width: 100% !important; | |
} | |
.body { |
This file contains hidden or 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
local NET_SEND_OWN_IMG = "IMG_SEND_OWN_IMG" | |
local NET_TRANSFER_IMG = "IMG_TRANSFER_IMG" | |
local NET_REQ_CHECKSUM = "IMG_REQ_CHECKSUM" | |
local CHUNK_SIZE = 60000 | |
local THROTTLE_DELAY = 0.05 -- in seconds | |
if CLIENT then | |
local CACHE_DIRECTORY = "img_cache" | |
if not file.Exists(CACHE_DIRECTORY, "DATA") then | |
file.CreateDir(CACHE_DIRECTORY) |
This file contains hidden or 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
local function init_listener_type(obj, browser, name) | |
local listeners_key = ("%sListeners"):format(name) | |
local callback_key = ("On%s"):format(name) | |
local add_listener_key = ("Add%sListener"):format(name) | |
obj[listeners_key] = {} | |
obj[callback_key] = function(...) | |
for _, listener in ipairs(obj[listeners_key]) do | |
listener(...) | |
end |
This file contains hidden or 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
local tag = "local_tab" | |
local EC_LEGACY_ENTRY = GetConVar("easychat_legacy_entry") | |
local EC_LEGACY_TEXT = GetConVar("easychat_legacy_text") | |
local HAS_CHROMIUM = jit.arch == "x64" | |
local use_new_text_entry = (EC_LEGACY_ENTRY and not EC_LEGACY_ENTRY:GetBool()) or not EC_LEGACY_ENTRY | |
local use_new_richtext = (EC_LEGACY_TEXT and not EC_LEGACY_TEXT:GetBool()) or not EC_LEGACY_TEXT | |
local tab = vgui.Create("DPanel") |
This file contains hidden or 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
require("win_toast") -- you need https://github.com/Earu/gm_win_toast | |
local base_dir = "windows_mentions" | |
local function get_avatar(id64, success_callback, err_callback) | |
http.Fetch("http://steamcommunity.com/profiles/" .. id64 .. "?xml=1", function(content, size) | |
local ret = content:match("<avatarIcon><!%[CDATA%[(.-)%]%]></avatarIcon>") | |
success_callback(ret) | |
end, err_callback) | |
end |
This file contains hidden or 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 ONLY WORKS IN SANDBOX, DARKRP DOES WEIRD STUFF WITH ITS | |
GAMEMODE PLAYERSAY HOOK SO IT WONT WORK (SAME WITH MURDER) | |
--------------------------------------------------------------------- | |
--]] | |
hook.Add("PostGamemodeLoaded", TAG, function() | |
local existing_callbacks = hook.GetTable().PlayerSay or {} | |
for identifier, callback in pairs(existing_callbacks) do |
This file contains hidden or 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
local TAG = "SCREENSHOT_SV" | |
if SERVER then | |
util.AddNetworkString(TAG) | |
local token_base = "1234567890_@#$abcdefghijklmnopqrstuvwxyz" | |
local function generate_token() | |
local ret = "" | |
for _ = 1, math.random(10, 32) do | |
local char = token_base[math.random(#token_base)] |
This file contains hidden or 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
--[[ | |
MAIN DIFFERENCES WITH THE SYNCHRONOUS HOOK LIBRARY | |
- You cannot add a hook callback to an event that is being executed | |
example: | |
hook.Add("Think", "example", function() | |
hook.Add("Think", "example2", function() end) | |
end) | |
In this case the hook would be added from the next call of the Think event | |
and not in the callback. |
OlderNewer