This mod is making me drop items instead of equipping them - seems as if shift or control is being held down? Disabled it for now, it was actually working well.
Would it be possible to have "Z" function as "Escape"? It would be much more comfortable to use Z to close menus instead of having to reach for Esc every time.
By default both F4 and M open the map, so both should close it. IIRC thats how it works in the original game. I asked grok to mod your code for this, not sure if it did it optimally:
print("MToCloseMap: Loading main.lua") local ELegacyPlayerMenuPage = { Stats = 0, Inventory = 1, Magic = 2, Map = 3, Quest = 4, Codex = 5, Settings = 6, MAX = 7, } bOpenedMap = false local function GetPlayerMenu() return FindFirstOf("VLegacyPlayerMenu") end local function IsOnMapPage(playerMenu) local playerMenuViewModel = playerMenu:GetViewModelRef() if not playerMenuViewModel then return false end if not playerMenuViewModel:IsVisible() then return false end local currentPage = playerMenuViewModel:GetCurrentPage() return currentPage == ELegacyPlayerMenuPage.Map end local function CloseMap() local playerMenu = GetPlayerMenu() if not playerMenu then return end if not IsOnMapPage(playerMenu) then return end playerMenu:CloseMenu() end RegisterKeyBind(Key.M, function() ExecuteInGameThread(function() CloseMap() end) end) RegisterKeyBind(Key.F4, function() ExecuteInGameThread(function() CloseMap() end) end)
16 comments
Would it be possible to have "Z" function as "Escape"? It would be much more comfortable to use Z to close menus instead of having to reach for Esc every time.
print("MToCloseMap: Loading main.lua")
local ELegacyPlayerMenuPage = {
Stats = 0,
Inventory = 1,
Magic = 2,
Map = 3,
Quest = 4,
Codex = 5,
Settings = 6,
MAX = 7,
}
bOpenedMap = false
local function GetPlayerMenu()
return FindFirstOf("VLegacyPlayerMenu")
end
local function IsOnMapPage(playerMenu)
local playerMenuViewModel = playerMenu:GetViewModelRef()
if not playerMenuViewModel then
return false
end
if not playerMenuViewModel:IsVisible() then
return false
end
local currentPage = playerMenuViewModel:GetCurrentPage()
return currentPage == ELegacyPlayerMenuPage.Map
end
local function CloseMap()
local playerMenu = GetPlayerMenu()
if not playerMenu then
return
end
if not IsOnMapPage(playerMenu) then
return
end
playerMenu:CloseMenu()
end
RegisterKeyBind(Key.M, function()
ExecuteInGameThread(function()
CloseMap()
end)
end)
RegisterKeyBind(Key.F4, function()
ExecuteInGameThread(function()
CloseMap()
end)
end)