Skip to content

Commit af01a46

Browse files
committed
Update modoptions.
1 parent 68f7897 commit af01a46

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

LuaMenu/configs/gameConfig/zk/ModOptions.lua

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ local options = {
415415
type = "string",
416416
def = "",
417417
},
418+
{
419+
key = "tweakdefs",
420+
name = "Tweak Defs",
421+
desc = "A base64 encoded snippet of code that modifies game definitions.",
422+
section = 'experimental',
423+
type = "string",
424+
def = "",
425+
},
418426
--[[
419427
{
420428
key = 'damagemult',
@@ -579,7 +587,6 @@ local options = {
579587
{ key = 'Chicken: Custom', name = "Chicken: Custom", desc = 'Customize your chicken.' },
580588
},
581589
},
582-
--[[ Broken, see gamseide ticket #3567
583590
{
584591
key = "playerchickens",
585592
name = "Players as chickens",
@@ -588,7 +595,6 @@ local options = {
588595
def = false,
589596
section = 'chicken',
590597
},
591-
]]
592598
{
593599
key = "eggs",
594600
name = "Chicken Eggs",
@@ -738,6 +744,30 @@ local options = {
738744
},
739745
}
740746

747+
for i = 1, 9 do
748+
options[#options + 1] = {
749+
key = "tweakunits" .. i,
750+
name = "Tweak Units " .. i,
751+
desc = "A base64 encoded lua table of unit parameters to change.",
752+
section = 'experimental',
753+
type = "string",
754+
def = "",
755+
noLobby = true,
756+
}
757+
end
758+
759+
for i = 1, 9 do
760+
options[#options + 1] = {
761+
key = "tweakdefs" .. i,
762+
name = "Tweak Defs " .. i,
763+
desc = "A base64 encoded snippet of code that modifies game definitions.",
764+
section = 'experimental',
765+
type = "string",
766+
def = "",
767+
noLobby = true,
768+
}
769+
end
770+
741771
--// add key-name to the description (so you can easier manage modoptions in springie)
742772
for i=1,#options do
743773
local opt = options[i]

LuaMenu/widgets/gui_modoptions_panel.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ function ModoptionsPanel.LoadModotpions(gameName, newBattleLobby)
536536
-- Set modoptionDefaults
537537
for i = 1, #modoptions do
538538
local data = modoptions[i]
539-
if data.key and data.def ~= nil then
539+
if data.key and (not data.noLobby) and (data.def ~= nil) then
540540
if type(data.def) == "boolean" then
541541
modoptionDefaults[data.key] = tostring((data.def and 1) or 0)
542542
elseif type(data.def) == "number" then
@@ -553,7 +553,7 @@ function ModoptionsPanel.LoadModotpions(gameName, newBattleLobby)
553553
local data = modoptions[i]
554554
if data.type == "section" then
555555
modoptionStructure.sectionTitles[data.key] = data.name
556-
else
556+
elseif not data.noLobby then
557557
if data.section then
558558
modoptionStructure.sections[data.section] = modoptionStructure.sections[data.section] or {
559559
title = data.section,

0 commit comments

Comments
 (0)