Skip to content

Commit

Permalink
screenplayeroptions stuff, also working on REing and wrapping over sc…
Browse files Browse the repository at this point in the history
…reenoptions
  • Loading branch information
oatmealine committed Jan 8, 2025
1 parent 29f2729 commit 1765e80
Show file tree
Hide file tree
Showing 10 changed files with 625 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .typings/Actor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ function Actor:diffuse(r, g, b, a) end
---
--- |since_notitg_v3|
---
--- @return multiple
--- @return number, number, number, number
function Actor:getdiffuse() end

--- Sets the actor's color/tint - ignores alpha
Expand Down
4 changes: 4 additions & 0 deletions BGAnimations/ScreenPlayerOptions overlay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<ActorFrame InitCommand="%gimmick.s.ScreenPlayerOptions.overlay.init"><children>
<Layer File="../actors.xml" InitCommand="%gimmick.s.ScreenPlayerOptions.overlay.initEnd"/>
</children></ActorFrame>
4 changes: 4 additions & 0 deletions BGAnimations/ScreenPlayerOptions underlay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<ActorFrame InitCommand="%gimmick.s.ScreenPlayerOptions.underlay.init"><children>
<Layer File="../actors.xml" InitCommand="%gimmick.s.ScreenPlayerOptions.underlay.initEnd"/>
</children></ActorFrame>
4 changes: 4 additions & 0 deletions Graphics/ScreenPlayerOptions footer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<ActorFrame InitCommand="%gimmick.s.ScreenPlayerOptions.footer.init"><children>
<Layer File="../actors.xml" InitCommand="%gimmick.s.ScreenPlayerOptions.footer.initEnd"/>
</children></ActorFrame>
4 changes: 4 additions & 0 deletions Graphics/ScreenPlayerOptions header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<ActorFrame InitCommand="%gimmick.s.ScreenPlayerOptions.header.init"><children>
<Layer File="../actors.xml" InitCommand="%gimmick.s.ScreenPlayerOptions.header.initEnd"/>
</children></ActorFrame>
2 changes: 1 addition & 1 deletion gimmick/lib/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function prettyColored(o, config, depth, indent, seen)
local str = {
{ type, type = TokenType.Plain },
{ '[', type = TokenType.Parens },
{ o.getName and o:getName() or '', type = TokenType.Value },
{ o.GetName and o:GetName() or '', type = TokenType.Value },
{ ']', type = TokenType.Parens }
}

Expand Down
13 changes: 3 additions & 10 deletions gimmick/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ end
local modRegistry = {}

---@param modName string
local function modOptionRow(modName)
function M.option.mod(modName)
local origModName = modName
modName = string.lower(modName)
local entry = modRegistry[modName]
Expand Down Expand Up @@ -141,7 +141,8 @@ local function modOptionRow(modName)
end
end

---@alias Option { type: 'lua', optionRow: OptionRow, y: number? } | { type: 'conf', pref: string, y: number? } | { type: 'list', list: string, y: number? } | { type: 'mod', modName: string, y: number? }
-- todo: `stepstype` and `steps`
---@alias Option { type: 'lua', optionRow: OptionRow, y: number? } | { type: 'conf', pref: string, y: number? } | { type: 'list', list: string, y: number? }

local ROWS_SHOWN = 10
local HEIGHT = 300
Expand All @@ -159,8 +160,6 @@ function M.LineProvider(screenName, optionsGetter)
return 'conf,' .. opt.pref
elseif opt.type == 'list' then
return 'list,' .. opt.list
elseif opt.type == 'mod' then
return 'lua,gimmick.s.' .. screenName .. '.lines.mod(' .. n .. ')'
end
end)

Expand All @@ -175,12 +174,6 @@ function M.LineProvider(screenName, optionsGetter)
assert(option.optionRow, 'option #' .. n .. ' type specified to be \'option\', but no \'optionRow\' exists!')
return option.optionRow
end,
mod = function(n)
local option = optionsGetter()[n]
print(option)
assert(option.modName, 'option #' .. n .. ' type specified to be \'mod\', but no \'modName\' exists!')
return modOptionRow(option.modName)
end,
NumRowsShown = function()
return ROWS_SHOWN
end,
Expand Down
Loading

0 comments on commit 1765e80

Please sign in to comment.