Ego seems to have changed something in the Lua code for the map menu call, which I call via SirNukes modsupportapi. Since 4.1 or 4.2 e.g. in the called LUA code
Code: Select all
mapMenu = Lib.Get_Egosoft_Menu("MapMenu")
.
.
.
mapMenu.infoTableMode = "propertyowned"
Code: Select all
mapMenu.updateMapAndInfoFrame ()
Curious: with the parameter "mission" the menu opens, but not with other parameters.
Does anyone have an idea what is going wrong? Thank you very much.
Background: In the extension of my "more-Hotkeys"-series I'm trying to reliably jump to different tabs in the map menu with hotkeys or to turn the trade info on and off with hotkeys...
Here is my complete code so far, which still worked under 3.x (probably also 4.0):
Code: Select all
-- ffi setup
local ffi = require("ffi")
local C = ffi.C
local Lib = require("extensions.sn_mod_support_apis.lua_library")
local mapMenu = {}
local mhk_menu = {}
local selectedcomponent = nil
local function init()
DebugError("More Hotkeys MAM Init")
mapMenu = Lib.Get_Egosoft_Menu("MapMenu")
RegisterEvent("MoreHotkeys.openObjectListWithHotkey", mhk_menu.openObjectListWithHotkey)
RegisterEvent("MoreHotkeys.openPropertyOwnedWithHotkey", mhk_menu.openPropertyOwnedWithHotkey)
RegisterEvent("MoreHotkeys.openMissionOffersWithHotkey", mhk_menu.openMissionOffersWithHotkey)
RegisterEvent("MoreHotkeys.openMissionManagerWithHotkey", mhk_menu.openMissionManagerWithHotkey)
RegisterEvent("MoreHotkeys.openMissionManagerWithHotkey", mhk_menu.openMap1)
RegisterEvent("MoreHotkeys.openMissionManagerWithHotkey", mhk_menu.openMap2)
RegisterEvent("MoreHotkeys.openMissionManagerWithHotkey", mhk_menu.openMap3)
RegisterEvent("MoreHotkeys.openMissionManagerWithHotkey", mhk_menu.closeMap)
end
function mhk_menu.openObjectListWithHotkey(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "objectlist"
-- mapMenu.refreshMainFrame = true
-- mapMenu.refreshInfoFrame()
mapMenu.updateMapAndInfoFrame ()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openPropertyOwnedWithHotkey(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "propertyowned"
-- mapMenu.refreshMainFrame = true
-- mapMenu.refreshInfoFrame()
mapMenu.updateMapAndInfoFrame ()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openMissionOffersWithHotkey(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "missionoffer"
-- mapMenu.refreshMainFrame = true
-- mapMenu.refreshInfoFrame()
mapMenu.updateMapAndInfoFrame ()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openMissionManagerWithHotkey(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "mission"
-- mapMenu.refreshMainFrame = true
-- mapMenu.refreshInfoFrame()
mapMenu.updateMapAndInfoFrame ()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openMap1(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "info"
-- mapMenu.refreshMainFrame = true
-- mapMenu.refreshInfoFrame()
mapMenu.updateMapAndInfoFrame ()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openMap1(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "mission"
mapMenu.refreshMainFrame = true
mapMenu.refreshInfoFrame()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.openMap1(_, event)
if event == "onPress" then
mapMenu.infoTableMode = "mission"
mapMenu.refreshMainFrame = true
mapMenu.refreshInfoFrame()
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
function mhk_menu.closeMap(_, event)
if event == "onPress" then
mapMenu.onCloseElement("close")
OpenMenu("MapMenu", { 0, 0 }, nil)
end
end
init()
Trajan von Olb