Post #1 · Publicado en 2016-08-12 02:27:38pm Hace 8.1 años
MadkaT | |
---|---|
Member | |
824 Mensajes | |
Not Set | |
Reg. 2009-11-24 | |
Hello friends, I'm back with 2 troubles
1. I'm creating custom theme options for my themes, but those options are not saving, they just take effect until I close Stepmania, Im defining they In a Lua file like this:
I think this is caused is missing the SetUserPref, but I don't see an Example of how to implement it. Can anyone help me?
2. I'm adding a note selection on the song options to change the arrows color for DDR simulation, but when the song options screens appear i get this error:
This is how I declare the options in [ScreenOptionsMaster]
Thanks for reading and sorry for the inconvenience
1. I'm creating custom theme options for my themes, but those options are not saving, they just take effect until I close Stepmania, Im defining they In a Lua file like this:
Quote
local Prefs =
{
SONGOPT =
{
Default = 'No',
Choices = { OptionNameString('No'), OptionNameString('DDR'), OptionNameString('PRO') },
Values = { 'No', 'DDR', 'PRO' }
},
}
{
SONGOPT =
{
Default = 'No',
Choices = { OptionNameString('No'), OptionNameString('DDR'), OptionNameString('PRO') },
Values = { 'No', 'DDR', 'PRO' }
},
}
I think this is caused is missing the SetUserPref, but I don't see an Example of how to implement it. Can anyone help me?
2. I'm adding a note selection on the song options to change the arrows color for DDR simulation, but when the song options screens appear i get this error:
Quote
Command 'Vivid' is not valid.
This is how I declare the options in [ScreenOptionsMaster]
Quote
#Arrow vivid/note/flat/rainbow
SpecialArrow="4"
SpecialArrowDefault="Vivid"
SpecialArrow,1="name,Vivid"
SpecialArrow,2="name,Note"
SpecialArrow,3="name,Flat"
SpecialArrow,4="name,Rainbow"
SpecialArrow="4"
SpecialArrowDefault="Vivid"
SpecialArrow,1="name,Vivid"
SpecialArrow,2="name,Note"
SpecialArrow,3="name,Flat"
SpecialArrow,4="name,Rainbow"
Thanks for reading and sorry for the inconvenience
Post #2 · Publicado en 2016-08-12 10:04:59pm Hace 8.1 años
Th3_Ov3rHell_3XoduZ | |
---|---|
Member | |
313 Mensajes | |
Reg. 2012-09-13 | |
"ITG, The Best Dance Machine!" |
Last updated: 2016-08-12 10:06pm
Tbh, I never liked the ThemePrefs system, that's why I decided to create my own system that, is basically, Save any setting/preference/etc into files. This of course, works so much better in my case.
You can create them, write on them and the load the content. I use them all over my Theme, works perfectly with everything and also works great with OptionRows to create Custom Options/Mods List, etc. You should try to do the same, ThemePrefs are rly the worst.
PD: The best of all is that I can choose multiples directories for different types of settings my Theme has. As Root, the /Others/ folder inside the same Theme is the best place to store those files.
You can create them, write on them and the load the content. I use them all over my Theme, works perfectly with everything and also works great with OptionRows to create Custom Options/Mods List, etc. You should try to do the same, ThemePrefs are rly the worst.
PD: The best of all is that I can choose multiples directories for different types of settings my Theme has. As Root, the /Others/ folder inside the same Theme is the best place to store those files.
Post #3 · Publicado en 2016-08-12 11:53:47pm Hace 8.1 años
Yeah, ThemePrefs is old and busted, and I'm not a huge fan of it.
You can find code out there for serializing Lua tables (Kyzentun's consensual includes some, for example), and then you can use dofile or (preferably) a safer variant thereof (also present in consensual) to load those files back. Having all your prefs in one file makes things a lot faster: an early version of DDR SN3 had some serious issues on ScreenSelectProfile because of the overhead required to write 5 ThemePrefs out every profile switch (I did not write that code).
Lua is, in my opinion, very well suited to storing structured data; this was one of its original design goals, after all. Plus, loading a Lua file is probably faster than anything you could make in Lua, at least anything with comparable power.
EDIT: also, regarding your second problem: the lines are like Game Commands, so they need to be formatted "mod,vivid;name,vivid".
You can find code out there for serializing Lua tables (Kyzentun's consensual includes some, for example), and then you can use dofile or (preferably) a safer variant thereof (also present in consensual) to load those files back. Having all your prefs in one file makes things a lot faster: an early version of DDR SN3 had some serious issues on ScreenSelectProfile because of the overhead required to write 5 ThemePrefs out every profile switch (I did not write that code).
Lua is, in my opinion, very well suited to storing structured data; this was one of its original design goals, after all. Plus, loading a Lua file is probably faster than anything you could make in Lua, at least anything with comparable power.
EDIT: also, regarding your second problem: the lines are like Game Commands, so they need to be formatted "mod,vivid;name,vivid".
Post #4 · Publicado en 2016-08-13 12:40:44am Hace 8.1 años
Kyzentun | |
---|---|
Member | |
3,209 Mensajes | |
Reg. 2008-02-20 | |
"I'm honestly pissed off." |
It's worth noting that the lua config system FlameyBoy mentions is included in SM 5.1, with documentation. It's used by the default and fallback themes to provide various simple features.
I've never used the ThemePrefs system, so I'll leave it up to the people who have used both to judge which is better.
I've never used the ThemePrefs system, so I'll leave it up to the people who have used both to judge which is better.