📄 minimap_relative.lua
字号:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------- file: minimap_relative.lua-- brief: keeps the minimap at a relative size (maxspect)-- author: Dave Rodgers---- Copyright (C) 2007.-- Licensed under the terms of the GNU GPL, v2 or later.------------------------------------------------------------------------------------------------------------------------------------------------------------------function widget:GetInfo() return { name = "RelativeMinimap", desc = "Keeps the minimap at a relative size (maxspect)", author = "trepan", date = "Feb 5, 2007", license = "GNU GPL, v2 or later", layer = 0, enabled = false -- loaded by default? }end-------------------------------------------------------------------------------------------------------------------------------------------------------------------- Adjust these setting to your liking---- offsets, in pixelslocal xoff = 2local yoff = 2-- maximum fraction of screen size,-- set one value to 1 to calibrate the otherlocal xmax = 0.262local ymax = 0.310-------------------------------------------------------------------------------------------------------------------------------------------------------------------- Make sure these are floored--xoff = math.floor(xoff)yoff = math.floor(yoff)----------------------------------------------------------------------------------------------------------------------------------------------------------------function widget:Initialize() widget:ViewResize(widgetHandler:GetViewSizes())endfunction widget:ViewResize(viewSizeX, viewSizeY) -- the extra 2 pixels are for the minimap border local xp = math.floor(viewSizeX * xmax) - xoff - 2 local yp = math.floor(viewSizeY * ymax) - yoff - 2 local limitAspect = (xp / yp) local mapAspect = (Game.mapSizeX / Game.mapSizeZ) local sx, sy if (mapAspect > limitAspect) then sx = xp sy = xp / mapAspect else sx = yp * mapAspect sy = yp end sx = math.floor(sx) sy = math.floor(sy) gl.ConfigMiniMap(xoff, viewSizeY - sy - yoff, sx, sy)end----------------------------------------------------------------------------------------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -