Skip to content

Instantly share code, notes, and snippets.

@Beherith
Beherith / dbg_garbage_collector.lua
Created January 17, 2024 13:43
Garbage Colector
function widget:GetInfo()
return {
name = "Garbage Collector",
desc = "Takes out the trash if there is way too much of it",
author = "Beherith",
date = "20240117",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true,
}
@Beherith
Beherith / json.lua
Last active December 26, 2023 19:11
Base lua json module at 0.9.50, updated to correctly parse empty strings and to not pollute global namespace
-----------------------------------------------------------------------------
-- JSON4Lua: JSON encoding / decoding support for the Lua language.
-- json Module.
-- Author: Craig Mason-Jones
-- Homepage: http://json.luaforge.net/
-- Version: 0.9.50
-- This module is released under the MIT License (MIT).
-- Please see LICENCE.txt for details.
--
-- USAGE:
@Beherith
Beherith / Defenserange_atunit_gl4.lua
Last active June 7, 2023 09:39
Defenserange_atunit_gl4.lua
include("keysym.h.lua")
function widget:GetInfo()
return {
name = "Defense Range GL4",
desc = "Displays range of defenses (enemy and ally)",
author = "Beherith", -- yeah this is now a rewrite from scratch
date = "2021.04.26",
license = "Lua: GPLv2, GLSL: (c) Beherith (mysterme@gmail.com)",
layer = -100,
@Beherith
Beherith / quadtreeatlas.lua
Created May 23, 2023 07:37
on demand atlassing
-- Author: (c) Beherith mysterme@gmail.com
-- QuadTreeAtlas class
-- Size in the total size of the texture
-- Resolution is the size of the splits (e.g. 128 size 'patches'
-- Funny notes: Loading a texture in with gl.Texture(0,':n:'..name) nearest mode is actually slow!!
-- TODO 2023.05.08
-- DONE : Match gl.TextureInfo
-- DONE Validate image size
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Cache Rapid Pool",
desc = "Runs through the HDD while lobby is open trying to open files",
author = "Beherith",
date = "2023.04.03",
license = "GPL-v2",
layer = -3000,
@Beherith
Beherith / gfx_atlas_tester.lua
Created November 22, 2022 13:28
Atlas Tester
function widget:GetInfo()
return {
name = "Atlas Tester",
desc = "Find why order is different",
author = "Beherith",
date = "2021.11.02",
license = "Lua code: GNU GPL, v2 or later, Shader GLSL code: (c) Beherith (mysterme@gmail.com)",
layer = -1,
enabled = false,
}
@Beherith
Beherith / dbg_desync_helper.lua
Last active November 28, 2022 08:30
Spits out the positions of every unit, every frame into a file, and can read it back for validation. Use /startlogging [filename] and /startvalidating [fielname]
function widget:GetInfo()
return {
name = "Desync Helper",
desc = "Spits out the positions of every unit, every frame into a file, and can read it back for validation. Use /startlogging [filename] and /startvalidating [fielname]",
author = "Beherith",
date = "2022.09.09",
license = "GNU GPL, v2 or later",
layer = -math.huge,
enabled = true,
}
@Beherith
Beherith / dbg_test_enginecall_perf.lua
Last active May 25, 2023 10:56
test engine call perf
function widget:GetInfo()
return {
name = "Test Engine Call Perf",
desc = "see how long it takes to run large loops of enigne calls",
author = "beherith",
date = "20211114",
license = "GNU GPL, v2 or later",
layer = 10,
enabled = false -- loaded by default?
}
@Beherith
Beherith / gui_tab_comm_base.lua
Created March 28, 2022 17:48
Mash tab to cycle camera target between your commander and your first factory. Unbinds useless overview mode.
function widget:GetInfo()
return {
name = "Tab Comm Base",
desc = "Binds tab to swap between commander and base",
author = "Beherith",
date = "20220328",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true
}
@Beherith
Beherith / gfx_unit_outlines_gl4.lua
Last active March 20, 2022 12:50
better outlines
function widget:GetInfo()
return {
name = "Unit Outlines GL4",
desc = "An interesting way of doing unit outlines",
author = "Beherith",
date = "2022.03.05",
license = "Lua: GNU GPL, v2 or later, GLSL code: (c) Beherith, mysterme@gmail.com ",
layer = -50,
enabled = false
}