Skip to content

Instantly share code, notes, and snippets.

@treeherder
Created September 18, 2018 02:45
Show Gist options
  • Save treeherder/d6ed074880daad618de3de7b12e48235 to your computer and use it in GitHub Desktop.
Save treeherder/d6ed074880daad618de3de7b12e48235 to your computer and use it in GitHub Desktop.
dont forget special characters in file name. incompatible with map explorer.
function MAP_OPEN_HOOKED(frame)
_G["MAP_OPEN_OLD"](frame);
DRAW_RED_FOG(frame);
end
function REVEAL_MAP_PICTURE_HOOKED(frame, mapName, info, i, forMinimap)
_G["REVEAL_MAP_PICTURE_OLD"](frame, mapName, info, i, forMinimap);
DRAW_RED_FOG(frame);
end
function MINIMAP_CHAR_UDT_HOOKED(frame, msg, argStr, argNum)
_G["MINIMAP_CHAR_UDT_OLD"](frame, msg, argStr, argNum);
DRAW_RED_FOG(frame);
end
function UPDATE_MINIMAP_HOOKED(frame, isFirst)
_G["UPDATE_MINIMAP_OLD"](frame, isFirst);
DRAW_RED_FOG(frame);
end
function DRAW_RED_FOG(frame)
HIDE_CHILD_BYNAME(frame, "_SAMPLE_");
local offsetX, offsetY = GET_MAPFOG_PIC_OFFSET(frame);
local mapPic = GET_CHILD(frame, "map", 'ui::CPicture');
local mapZoom = math.abs((GET_MINIMAPSIZE() + 100) / 100);
if frame == ui.GetFrame("map") then
mapZoom = 1;
end
local list = session.GetMapFogList(session.GetMapName());
local cnt = list:Count();
for i = 0 , cnt - 1 do
local tile = list:PtrAt(i);
if tile.revealed == 0 then
local mapName = session.GetMapName();
local list = session.GetMapFogList(mapName);
local cnt = list:Count();
for i = 0 , cnt - 1 do
local info = list:PtrAt(i);
info.revealed = 1;
end
packet.ReqSaveMapReveal(mapName);
local frame = ui.GetFrame('map');
UPDATE_MAP(frame);
if tile.selected == 1 then
pic:ShowWindow(0);
end
end
end
frame:Invalidate();
end
local acutil = require("acutil")
--ui.SysMsg("Map Fog Viewer loaded!");
CHAT_SYSTEM("Map Completer loaded!")
acutil.setupHook(MAP_OPEN_HOOKED, "MAP_OPEN");
acutil.setupHook(REVEAL_MAP_PICTURE_HOOKED, "REVEAL_MAP_PICTURE");
acutil.setupHook(MINIMAP_CHAR_UDT_HOOKED, "MINIMAP_CHAR_UDT");
acutil.setupHook(UPDATE_MINIMAP_HOOKED, "UPDATE_MINIMAP");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment