Post #1 · Posted at 2024-09-07 03:11:24pm 2.9 months ago
I'm creating a new difficulty list for my new theme. I don't know if I can put a cursor in the difficulty list. I tried to look for some codes from other themes but I can't find the way to put the cursor in the difficulty.
(I made in photoshop to see how it works)
in the ScreenSelectMusic decorations > difficulty.lua
p.s. I'm not good at making themes
current code:
(I made in photoshop to see how it works)
in the ScreenSelectMusic decorations > difficulty.lua
p.s. I'm not good at making themes
current code:
if not GAMESTATE:IsCourseMode() then
local difficulties = {"Beginner", "Easy", "Medium", "Hard", "Challenge" }
for difficulty in ivalues(difficulties) do
t[#t+1] = DrawDifListItem("Difficulty_" .. difficulty);
end
t[#t+1]=Def.ActorFrame {
InitCommand=cmd(y, 157),
Def.Quad{
InitCommand=function(self)
self:diffusealpha(0)
LoadActor("cursorglow")
self:draworder(1);
GetDifListX(self, -7)
self:zoomto(183, 35)
end,
["CurrentSteps" .. ToEnumShortString(player) .. "ChangedMessageCommand"]=function(self)
self:diffusealpha(0)
self:finishtweening()
self:diffusealpha(1)
local song=GAMESTATE:GetCurrentSong()
if song then
local steps = GAMESTATE:GetCurrentSteps(player)
if steps then
local diff = steps:GetDifficulty();
local st=GAMESTATE:GetCurrentStyle():GetStepsType();
self:y( Difficulty:Reverse()[diff] * 42 )
end
end
end,
SaveCommand=function(self)
-- There's no need to make a custom function to interpret
-- StepMania's enums. The Reverse() method can be applied to any
-- enum to do that for you. That being said...
--
-- Whatever you're trying to do here, it'll always be nil because
-- your "diff" variable is always nil...
--
-- I would help you more here, but I have no idea what you're attempting.
-- So, to temporarily prevent errors, I'm just going to comment this out.
-- setenv("SaveDifficulty1P", Difficulty:Reverse()[diff]+1 );
end
}
}
end
local difficulties = {"Beginner", "Easy", "Medium", "Hard", "Challenge" }
for difficulty in ivalues(difficulties) do
t[#t+1] = DrawDifListItem("Difficulty_" .. difficulty);
end
t[#t+1]=Def.ActorFrame {
InitCommand=cmd(y, 157),
Def.Quad{
InitCommand=function(self)
self:diffusealpha(0)
LoadActor("cursorglow")
self:draworder(1);
GetDifListX(self, -7)
self:zoomto(183, 35)
end,
["CurrentSteps" .. ToEnumShortString(player) .. "ChangedMessageCommand"]=function(self)
self:diffusealpha(0)
self:finishtweening()
self:diffusealpha(1)
local song=GAMESTATE:GetCurrentSong()
if song then
local steps = GAMESTATE:GetCurrentSteps(player)
if steps then
local diff = steps:GetDifficulty();
local st=GAMESTATE:GetCurrentStyle():GetStepsType();
self:y( Difficulty:Reverse()[diff] * 42 )
end
end
end,
SaveCommand=function(self)
-- There's no need to make a custom function to interpret
-- StepMania's enums. The Reverse() method can be applied to any
-- enum to do that for you. That being said...
--
-- Whatever you're trying to do here, it'll always be nil because
-- your "diff" variable is always nil...
--
-- I would help you more here, but I have no idea what you're attempting.
-- So, to temporarily prevent errors, I'm just going to comment this out.
-- setenv("SaveDifficulty1P", Difficulty:Reverse()[diff]+1 );
end
}
}
end
Post #2 · Posted at 2024-09-07 08:45:21pm 2.9 months ago
paste your lua codes here https://codeshare.io/ , and get the codepaste link and paste here. Just by looking the codes via code tags is eyesore.
Edit: judging from the codes, it seems incomplete. You may rather send the lua file here instead.
Edit: judging from the codes, it seems incomplete. You may rather send the lua file here instead.