Built with ops/pfquest_port/build.py (gateway 4a82cb0a): compat layer + setfenv(1, pfQuestEnv) per Lua file. New README (install/use on Forever, credits to Shagu, rivi-s and contributors) and CONVERTING.md (porting guide).
23 lines
903 B
Lua
23 lines
903 B
Lua
setfenv(1, pfQuestEnv) -- pfQuest on 70334, after compat/optional.lua: pfQuest's optional client hooks answered from the real 70334 APIs.
|
|
local G = _G
|
|
local M = G.C_Map
|
|
|
|
-- AreaTable/zone key of the map the 1.12 API currently shows (also capitals, which 1.12 GetMapZones omits)
|
|
local by_map = {}
|
|
pfQuestCompat.GetCurrentMapAreaID = function()
|
|
local id = __current_map and __current_map() -- compat layer (pfQuestEnv)
|
|
if not id then return nil end
|
|
if by_map[id] ~= nil then return by_map[id] or nil end
|
|
local info = M.GetMapInfo(id)
|
|
local area = info and pfMap and pfMap.GetMapIDByName and pfMap:GetMapIDByName(info.name)
|
|
by_map[id] = area or false
|
|
return area
|
|
end
|
|
|
|
pfQuestCompat.GetItemIcon = function(itemid)
|
|
return G.C_Item and G.C_Item.GetItemIconByID(itemid) or nil
|
|
end
|
|
|
|
-- the 70334 minimap can rotate
|
|
pfQuestCompat.rotateMinimap = G.GetCVar("rotateMinimap") ~= "0" and true or nil
|