Merge pull request #510 from WantedDV/ranked
Allow access to online menus with mod loaded
This commit is contained in:
commit
a5075e150e
1
data/ui_scripts/ranked/__init__.lua
Normal file
1
data/ui_scripts/ranked/__init__.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
require("online_mods_loaded")
|
23
data/ui_scripts/ranked/online_mods_loaded.lua
Normal file
23
data/ui_scripts/ranked/online_mods_loaded.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
if Engine.GetCurrentMap() ~= "core_frontend" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
function ShouldUnloadMod(arg0)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Load usermaps mod if custom map selected
|
||||||
|
local mustLoadUsermaps = function(element, controller)
|
||||||
|
if CoD.perController[controller].mapCategory == CoD.CONTENT_MODS_INDEX then
|
||||||
|
if not Engine.IsUsingMods() then
|
||||||
|
LuaUtils.Mods_LoadMod("usermaps") -- LuaUtils.Mods_LoadMod(element.loadModName)
|
||||||
|
|
||||||
|
CoD.OverlayUtility.ShowToast("DefaultState", Engine.Localize("MENU_MODS_CAPS"), Engine.Localize("PLATFORM_MODS_LOADED") .. " " .. element.mapName)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function MapSelected(element, controller)
|
||||||
|
SetMap(controller, element.mapName, false)
|
||||||
|
mustLoadUsermaps(element, controller)
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user