Logo

[Help] Saving custom theme and song options

Register Log In Back To Forums

Post #1 · Posted at 2016-08-12 02:27:38pm 7.6 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Hello friends, I'm back with 2 troubles Laughing Out Loud

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' }
},
}

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"

Thanks for reading and sorry for the inconvenience Green Grin

Post #2 · Posted at 2016-08-12 10:04:59pm 7.6 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
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.
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #3 · Posted at 2016-08-12 11:53:47pm 7.6 years ago

Offline FlameyBoy
FlameyBoy Avatar Member
335 Posts
United States
Reg. 2011-03-09


Last updated: 2016-08-13 12:01am
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".

Post #4 · Posted at 2016-08-13 12:40:44am 7.6 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
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.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
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: 5% · Database: 4% · Server Time: 2024-04-19 20:59:08
This page took 0.004 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language