Logo

help with the difficulty list

Register Log In Back To Forums

Post #1 · Posted at 2024-09-07 03:11:24pm 2.9 months ago

Offline Wrland
Wrland Avatar Member
54 Posts
Peru
Reg. 2020-10-24


Last updated: 2024-09-07 03:11pm
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)
https://i.imgur.com/GM296h9.png
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

https://i.imgur.com/sbBHnPv.png

Post #2 · Posted at 2024-09-07 08:45:21pm 2.9 months ago

Offline razorblade
razorblade Avatar Member
1,110 Posts
Not Set
Reg. 2011-03-01


Last updated: 2024-09-07 08:56pm
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.

Post #3 · Posted at 2024-09-07 09:06:57pm 2.9 months ago

Offline Wrland
Wrland Avatar Member
54 Posts
Peru
Reg. 2020-10-24


Last updated: 2024-09-07 11:59pm
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 3% · Database: 4% · Server Time: 2024-12-04 12:50:21
This page took 0.005 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language