Skip to content

Commit

Permalink
Infinite load stuff (#232)
Browse files Browse the repository at this point in the history
* Just for repro

* 🤷‍♂️

* Revert test changes

---------

Co-authored-by: dyceron <[email protected]>
  • Loading branch information
ThanatosGit and dyceron authored Dec 23, 2023
1 parent 560efb5 commit a9c302f
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 407 deletions.
145 changes: 74 additions & 71 deletions src/open_samus_returns_rando/files/guilib.lua
Original file line number Diff line number Diff line change
@@ -1,78 +1,81 @@

GUILib = GUILib or {}
if GUILib == nil then

function GUILib.AddDNACounter()
local randoUI = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechIconRando")
if randoUI ~= nil then
return
GUILib = GUILib or {}

function GUILib.AddDNACounter()
local randoUI = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechIconRando")
if randoUI ~= nil then
return
end

local lowerInfo = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition")
lowerInfo:AddChild((GUI.CreateDisplayObjectEx("DNAMechIconRando", "CSprite", {
X = "0.17188",
Y = "0.02500",
SizeX = "0.06562",
SizeY = "0.09166",
ScaleX = "1.00000",
ScaleY = "1.00000",
Angle = "0.00000",
FlipX = false,
FlipY = false,
Enabled = true,
Visible = true,
SkinItemType = "",
Autosize = false,
SpriteSheetItem = "IconL_MetroidDNAData",
BlendMode = "AlphaBlend",
USelMode = "Scale",
VSelMode = "Scale"
})))
lowerInfo:AddChild((GUI.CreateDisplayObjectEx("DNAMechCounterRando", "CText", {
X = "0.24688",
Y = "0.02500",
SizeX = "0.12499",
SizeY = "0.05833",
ScaleX = "1.00000",
ScaleY = "1.00000",
Angle = "0.00000",
FlipX = false,
FlipY = false,
ColorR = "0.68000",
ColorG = "0.83000",
ColorB = "0.93000",
ColorA = "1.00000",
Enabled = true,
Visible = true,
SkinItemType = "",
Text = "10 / 10",
Font = "digital_hefty",
TextAlignment = "Left",
Autosize = true,
Outline = true,
EmbeddedSpritesSuffix = "",
BlinkColorR = "1.00000",
BlinkColorG = "1.00000",
BlinkColorB = "1.00000",
BlinkAlpha = "1.00000",
Blink = "-1.00000"
})))
local dnaCounterVanilla = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechCounter")
local dnaIconVanilla = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechIcon")
GUI.SetProperties(dnaCounterVanilla, {
Enabled = false,
Visible = false
})
GUI.SetProperties(dnaIconVanilla, {
Enabled = false,
Visible = false
})
end

local lowerInfo = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition")
lowerInfo:AddChild((GUI.CreateDisplayObjectEx("DNAMechIconRando", "CSprite", {
X = "0.17188",
Y = "0.02500",
SizeX = "0.06562",
SizeY = "0.09166",
ScaleX = "1.00000",
ScaleY = "1.00000",
Angle = "0.00000",
FlipX = false,
FlipY = false,
Enabled = true,
Visible = true,
SkinItemType = "",
Autosize = false,
SpriteSheetItem = "IconL_MetroidDNAData",
BlendMode = "AlphaBlend",
USelMode = "Scale",
VSelMode = "Scale"
})))
lowerInfo:AddChild((GUI.CreateDisplayObjectEx("DNAMechCounterRando", "CText", {
X = "0.24688",
Y = "0.02500",
SizeX = "0.12499",
SizeY = "0.05833",
ScaleX = "1.00000",
ScaleY = "1.00000",
Angle = "0.00000",
FlipX = false,
FlipY = false,
ColorR = "0.68000",
ColorG = "0.83000",
ColorB = "0.93000",
ColorA = "1.00000",
Enabled = true,
Visible = true,
SkinItemType = "",
Text = "10 / 10",
Font = "digital_hefty",
TextAlignment = "Left",
Autosize = true,
Outline = true,
EmbeddedSpritesSuffix = "",
BlinkColorR = "1.00000",
BlinkColorG = "1.00000",
BlinkColorB = "1.00000",
BlinkAlpha = "1.00000",
Blink = "-1.00000"
})))
local dnaCounterVanilla = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechCounter")
local dnaIconVanilla = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechIcon")
GUI.SetProperties(dnaCounterVanilla, {
Enabled = false,
Visible = false
})
GUI.SetProperties(dnaIconVanilla, {
Enabled = false,
Visible = false
})
end


function GUILib.UpdateDNACounter(currentDNA, maxDNA)
local dna = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechCounterRando")
if dna ~= nil then
GUI.SetTextText(dna, tostring(currentDNA) .. " / " .. tostring(maxDNA))
dna:ForceRedraw()
function GUILib.UpdateDNACounter(currentDNA, maxDNA)
local dna = GUI.GetDisplayObject("IngameMenuRoot.IngameMenuComposition.LowerComposition.LowerInfoComposition.DNAMechCounterRando")
if dna ~= nil then
GUI.SetTextText(dna, tostring(currentDNA) .. " / " .. tostring(maxDNA))
dna:ForceRedraw()
end
end
end
Loading

0 comments on commit a9c302f

Please sign in to comment.