whoward69
DLL Minion
Modularised version of the MiniMap Panel that permits new entries to be added to the Overlays drop-down.
New entries can be inserted into the list or appended to it or replace existing (standard) entries.
Uses the techniques found in Utils - Modular DiploCorner, so an understanding of how that works is an advantage to using the components in this mod.
The following LuaEvents are supported
* LuaEvents.MiniMapOverlayAddin.Add(function OnMiniMapOverlayAddin(tab) ... end)
adds a new tab (or replaces a standard one) in the Overlay drop-down
tab is an associative array with the following entries
* LuaEvents.MiniMapOverlayLegend.Add(function PopulateLegend(title, info) ... end)
sets the legend panel title and defines the boxes to draw in the legend key
* LuaEvents.MiniMapOverlayHideLegendNav.Add(function OnHideLegendNav(bHide) ... end)
hides/shows the legend next/previous buttons
* LuaEvents.MiniMapOverlayResizeLegendOptions.Add(function OnResizeLegendOptions(sizeX, sizeY, offsetCallback) ... end)
resizes the options "space" in the Legend side panel
The following mods use the components of this mod
New entries can be inserted into the list or appended to it or replace existing (standard) entries.
Uses the techniques found in Utils - Modular DiploCorner, so an understanding of how that works is an advantage to using the components in this mod.
The following LuaEvents are supported
* LuaEvents.MiniMapOverlayAddin.Add(function OnMiniMapOverlayAddin(tab) ... end)
adds a new tab (or replaces a standard one) in the Overlay drop-down
tab is an associative array with the following entries
- text - the string (or TXT_KEY_) to display in the overlay drop-down
- group - the name of the group to place the entry in (see g_OverlayIndexes below for valid group names)
- call - the method to call when the entry is selected/deselected (receives a single bShow parameter)
- nav - the method to call when the next/previous legend buttons are pressed (omit or set to nil to disable the buttons)
- next_tt - the tooltip string (or TXT_KEY_) for the next button
- prev_tt - the tooltip string (or TXT_KEY_) for the previous button
* LuaEvents.MiniMapOverlayLegend.Add(function PopulateLegend(title, info) ... end)
sets the legend panel title and defines the boxes to draw in the legend key
- title - the string (or TXT_KEY_) to display at the top of the legend panel
- info - a list of Name and Color entries to populate the legend key with
* LuaEvents.MiniMapOverlayHideLegendNav.Add(function OnHideLegendNav(bHide) ... end)
hides/shows the legend next/previous buttons
* LuaEvents.MiniMapOverlayResizeLegendOptions.Add(function OnResizeLegendOptions(sizeX, sizeY, offsetCallback) ... end)
resizes the options "space" in the Legend side panel
- sizeX/sizeY - the dimensions of the space to allocate
- offsetCallback - the method to call to receive the offsetX/offsetY location of the "hole"
The following mods use the components of this mod
- UI - Continents - basic example of an overlay with and without a legend key
- UI - City Limits - basic example with a legend key
- UI - Barbarians - intermediate example with a legend key and next/previous buttons
- UI - Resources - complex example replacing a standard overlay and adding additional controls to the legend panel