Fix main menu buttons
This commit is contained in:
parent
74455d3eb3
commit
ae55d8af08
@ -1,17 +1,3 @@
|
|||||||
local maincampaign = LUI.MenuBuilder.m_types_build["main_campaign"]
|
|
||||||
LUI.MenuBuilder.m_types_build["main_campaign"] = function(...)
|
|
||||||
local initlist = LUI.Options.InitScrollingList
|
|
||||||
LUI.Options.InitScrollingList = function(list)
|
|
||||||
initlist(list, nil ,{
|
|
||||||
rows = 10
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local menu = maincampaign(...)
|
|
||||||
LUI.Options.InitScrollingList = initlist
|
|
||||||
return menu
|
|
||||||
end
|
|
||||||
|
|
||||||
LUI.MenuBuilder.registerType("achievements_menu", function(root, controller)
|
LUI.MenuBuilder.registerType("achievements_menu", function(root, controller)
|
||||||
local menuwidth = 1129
|
local menuwidth = 1129
|
||||||
local menu = LUI.MenuTemplate.new(root, {
|
local menu = LUI.MenuTemplate.new(root, {
|
||||||
|
31
data/cdata/ui_scripts/buttons/__init__.lua
Normal file
31
data/cdata/ui_scripts/buttons/__init__.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
LUI.addmenubutton("main_campaign", {
|
||||||
|
index = 6,
|
||||||
|
text = "@LUA_MENU_ACHIEVEMENTS",
|
||||||
|
description = Engine.Localize("@LUA_MENU_ACHIEVEMENTS_DESC"),
|
||||||
|
callback = function()
|
||||||
|
LUI.FlowManager.RequestAddMenu(nil, "achievements_menu")
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
LUI.addmenubutton("main_campaign", {
|
||||||
|
index = 6,
|
||||||
|
text = "@MENU_MODS",
|
||||||
|
description = Engine.Localize("@MENU_MODS_DESC"),
|
||||||
|
callback = function()
|
||||||
|
LUI.FlowManager.RequestAddMenu(nil, "mods_menu")
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
local maincampaign = LUI.MenuBuilder.m_types_build["main_campaign"]
|
||||||
|
LUI.MenuBuilder.m_types_build["main_campaign"] = function(...)
|
||||||
|
local initlist = LUI.Options.InitScrollingList
|
||||||
|
LUI.Options.InitScrollingList = function(list)
|
||||||
|
initlist(list, nil ,{
|
||||||
|
rows = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local menu = maincampaign(...)
|
||||||
|
LUI.Options.InitScrollingList = initlist
|
||||||
|
return menu
|
||||||
|
end
|
@ -29,24 +29,6 @@ function string:truncate(length)
|
|||||||
return self:sub(1, length - 3) .. "..."
|
return self:sub(1, length - 3) .. "..."
|
||||||
end
|
end
|
||||||
|
|
||||||
LUI.addmenubutton("main_campaign", {
|
|
||||||
index = 6,
|
|
||||||
text = "@LUA_MENU_ACHIEVEMENTS",
|
|
||||||
description = Engine.Localize("@LUA_MENU_ACHIEVEMENTS_DESC"),
|
|
||||||
callback = function()
|
|
||||||
LUI.FlowManager.RequestAddMenu(nil, "achievements_menu")
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
LUI.addmenubutton("main_campaign", {
|
|
||||||
index = 6,
|
|
||||||
text = "@MENU_MODS",
|
|
||||||
description = Engine.Localize("@MENU_MODS_DESC"),
|
|
||||||
callback = function()
|
|
||||||
LUI.FlowManager.RequestAddMenu(nil, "mods_menu")
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
function getmodname(path)
|
function getmodname(path)
|
||||||
local modinfo = mods.getinfo(path)
|
local modinfo = mods.getinfo(path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user