Skip to content

Commit

Permalink
Add Lua-sided backwards compatibility for HOOKS pointer rename
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 19, 2020
1 parent 17eb317 commit d5227b6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Themes/_fallback/Scripts/00 compat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- this file is for some lua backwards compatibility purposes
-- add to this as C++ Lua bindings become refactored or renamed as needed


-- ArchHooks
-- used to be referred to as HOOKS:f(etc)
-- now Arch.f(etc)
-- DO NOT SHADOW THIS NAME
HOOKS = {}
-- old names for compat
Arch["AppHasFocus"] = Arch.isGameFocused
Arch["GetArchName"] = Arch.getSystem
Arch["GetClipboard"] = Arch.getClipboard
Arch["ShowCursor"] = Arch.setCursorVisible
for k,v in pairs(Arch) do
HOOKS[k] = function(_, ...) return v(...) end
end

0 comments on commit d5227b6

Please sign in to comment.