Skip to content

Instantly share code, notes, and snippets.

@kurapica
kurapica / siwtch.lua
Last active June 28, 2021 14:07
PLoop-Switcher
require "PLoop" (function(_ENV)
__Sealed__()
struct "Case" (function(_ENV)
import "System.Text"
export { unpack = unpack or table.unpack }
member "vars" { type = Variables, require = true }
member "func" { type = Callable, require = true }
@kurapica
kurapica / minimap.lua
Created June 28, 2021 14:06
Minimap Patch For WOW
Scorpio "MinimmapPatch" ""
MinimapZoneTextButton:SetParent(Minimap)
MinimapZoneTextButton:ClearAllPoints()
MinimapZoneTextButton:SetPoint("BOTTOMLEFT", Minimap, "TOPLEFT", 0, 4)
MinimapZoneTextButton:SetPoint("BOTTOMRIGHT", Minimap, "TOPRIGHT", 0, 4)
MiniMapTracking:Show()
MiniMapTrackingBackground:Hide()
MiniMapTrackingIconOverlay:Hide()
@kurapica
kurapica / infobar.lua
Created June 29, 2021 13:44
Info bar for world of warcraft
Scorpio "InfoBar" ""
_Status = Frame("_Status", UIParent)
_Text = FontString("Text", _Status)
Style[_Status] = {
{
Text = {
drawLayer = "ARTWORK",
fontObject = TextStatusBarTextLarge,
@kurapica
kurapica / ChatFrameFix.lua
Created June 29, 2021 16:10
Chat Frame Fix for WOW
Scorpio "ChatFix" ""
local _LoadedTab = 1
local _CheckCompare = false
local _CheckType = nil
local _CheckAchievement = nil
local GameTooltip = _G.GameTooltip
_G.CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
_G.CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0
@kurapica
kurapica / MinimapClassic.lua
Last active July 3, 2021 01:31
Minimap For Classic
Scorpio "MinimmapPatch" ""
MinimapZoneTextButton:SetParent(Minimap)
MinimapZoneTextButton:ClearAllPoints()
MinimapZoneTextButton:SetPoint("BOTTOMLEFT", Minimap, "TOPLEFT", 0, 4)
MinimapZoneTextButton:SetPoint("BOTTOMRIGHT", Minimap, "TOPRIGHT", 0, 4)
MinimapZoneText:ClearAllPoints()
MinimapZoneText:SetAllPoints()
MinimapZoneText.JustifyH = "CENTER"
@kurapica
kurapica / SpellCooldown.lua
Last active July 10, 2021 14:29
Simple SpellCooldownPanel For WOW with mover
Scorpio "SpellCooldown" ""
class "Scorpio.Widget.SpellCooldownPanel" (function(_ENV)
inherit "ElementPanel"
import "System.Reactive"
class "Icon" { Frame }
__Indexer__() __Observable__()
@kurapica
kurapica / threadpool.lua
Created July 12, 2021 07:06
Lua simple thread pool
local create = coroutine.create
local resume = coroutine.resume
local running = coroutine.running
local status = coroutine.status
local wrap = coroutine.wrap
local yield = coroutine.yield
local tinsert = table.insert
local tremove = table.remove
local PREPARE_CONFIRM = {}
@kurapica
kurapica / example.lua
Created July 12, 2021 13:22
Controller Example
class "FileController" (function(_ENV)
inherit "Controller"
-- GET /file/download?name=test&fields=["name","age"]
__Action__("download", HttpMethod.GET)
__Form__{ -- Form验证并自动按照结构组织数据,下面的fields是字符串数组
name = String,
fields = struct { String },
}
__File__() __Iterator__() -- 申明返回为文件,并且使用迭代器的形式返回数据
@kurapica
kurapica / async.lua
Created July 19, 2021 01:58
Full thread pool support func and iterator
local create = coroutine.create
local resume = coroutine.resume
local running = coroutine.running
local status = coroutine.status
local wrap = coroutine.wrap
local yield = coroutine.yield
local tinsert = table.insert
local tremove = table.remove
Scorpio "AshToAshSkin" ""
pcall(Style.RegisterSkin, "5MSkin")
DEFAULT_COLOR = Color("|c222222ff")
LOW_HEALTH_COLOR = Color.WHITE
HEALTHBAR = (Scorpio.IsRetail or Scorpio.IsBCC or IsAddOnLoaded("LibHealComm-4.0") or pcall(_G.LibStub, "LibHealComm-4.0")) and "PredictionHealthBar" or "HealthBar"
Style.UpdateSkin("5MSkin", {
[AshToAsh.AshUnitFrame] = {