Commit Graph
37 Commits
Author SHA1 Message Date
Steve Checkoway 77475dd945 Remove one invalid cast. See stepmania-devs. 2006-08-01 07:49:22 +00:00
Chris Danford 960da85a05 don't try to switch to theme 'default' if it doesn't exist 2006-06-15 06:39:08 +00:00
Chris Danford 73d559156f set default profile ID when creating profiles 2006-05-16 05:28:26 +00:00
Chris Danford c36f86dbf9 add SetStatic 2006-05-03 21:48:56 +00:00
Chris Danford 1bb78b396c don't write values to Preferences.ini that are in Static.ini 2006-03-20 04:57:15 +00:00
Chris Danford 3e157b3ab5 move validation into Preference 2006-02-24 23:39:21 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Glenn Maynard cdf951e589 Instead of loading Defaults.ini underneith Preferences.ini, change the
actual IPreference defaults according to Defaults.ini.  This way, we can
access default values immediately, without having to load and parse a
file.  Since this simply changes the value in the preference, this doesn't
use any more memory.
2006-01-14 03:56:59 +00:00
Glenn Maynard 115e901d82 ReadFrom and WriteTo are never overloaded; they're implemented
via ToString and FromString.  Remove virtual for clarity.
2006-01-14 03:33:48 +00:00
Glenn Maynard 16b998705f That won't work. Preferences register themselves on creation, so
PrefsMan can iterate over them (to load and save), so preferences
must be created on startup, not first use.
2006-01-04 23:04:07 +00:00
Steve Checkoway f5f1097587 Delay init to work around static init dependencies. 2006-01-03 18:14:18 +00:00
Glenn Maynard f435983996 IPreference stores preferences, but knows nothing about loading or
saving them; that's up to PrefsManager.

Treat IPreference as a simple data holder, with simple facilities for
looking them up by name, converting to/from strings, and storing to/from
an XNode, but with no application-specific code to save to disk.  This
can be used alone as a way for code to configure things internally, even
for uses that have no notion of storing user preferences (eg. unit tests),
and other programs can use it to store preferences in entirely different
ways (SMPackage could use it to store to the registry).  PrefsManager is
layered on top, to implement StepMania's particular use of Preference
(saving and loading INIs), but isn't needed for Preference to be useful.

This also makes Preference only use XNode, not the more specialized IniFile.

(One piece is missing: several low-level places, eg. Dialog, want to set
a preference and write it to disk immediately.  The only way to do that
is to have access to PREFSMAN.  FIXME.)
2005-12-31 04:59:56 +00:00
Glenn Maynard 76e55c2f14 PrefsMan and Preference depend on each other. PrefsMan is big, and
depends on some higher level code.  Make Preference stand-alone, so
code that only has its own preferences can be used without PrefsMan.
2005-12-31 01:26:29 +00:00
Chris Danford 81037f05cd move Preferences from ThemeManager to completely in PrefsManager
Also, allow Defaults.ini and Static.ini to have sections
2005-11-09 10:55:30 +00:00
Chris Danford 6e5b3a5ed8 fix PrefsManager::m_sCurrentGame not current, so GamePrefs from Static.ini weren't being used 2005-10-28 01:44:19 +00:00
Glenn Maynard 495799d04b missing header 2005-10-27 17:28:04 +00:00
Glenn Maynard ccbbb2e5ec Add an optional template parameter to Preference to specify the operating type
for conversions.  This way, Preference doesn't need to know about every enum
type used with it.  (This means that you can't construct a Preference<T,U> from T,
since you don't know U, which led to the previous ScreenOptionsMasterPrefs.cpp
change.)
2005-10-27 15:47:31 +00:00
Chris Danford e00a57e05e use Preference1D 2005-10-26 23:09:56 +00:00
Chris Danford feb1bfb0fc naming cleanup: rename scoring "Tier1"s to "W1"s (short for "Window 1")
add Preference1D so that we can index into the grading and life values
2005-10-09 04:30:59 +00:00
Glenn Maynard ea1bede8c3 drop StepMania.ini sections. Almost everything is in [Options], and it's
hard enough keeping straight which arbitrary options screen an option
is in without having a separate categorization for the INI.  (This will
simplify later changes.)
2005-05-19 01:25:38 +00:00
Chris Danford 820fb0b361 broadcast on Preference changes 2005-05-06 20:41:05 +00:00
Glenn Maynard 61064820b9 SetFromStack 2005-02-22 04:22:24 +00:00
Glenn Maynard ef12eea2d4 Add Preference<type>::PushValue() (note that this is not a PushSelf). 2005-01-30 02:02:42 +00:00
Glenn Maynard dbb52c70d7 real fix for options 2004-12-07 09:22:38 +00:00
Glenn Maynard f7bb6ef29e grr, not quite 2004-12-07 08:32:29 +00:00
Glenn Maynard 8e57c4ca76 This should fix options menu crashes. Adding casts to the MOVE() macros
didn't make it work, since there was no cast overload to bool&, etc; it
just forced the (non-POD) type to that type, which resulted in the struct
being clobbered.
2004-12-07 08:28:24 +00:00
Glenn Maynard ba929b8e71 move more common stuff out of the template class, so g_pvpSubscribers is
more useful
2004-12-07 01:44:17 +00:00
Sean Burke e15d1da6b7 Revert and fix a bit better. 2004-12-04 20:44:02 +00:00
Steve Checkoway eaca864906 Fix crash (only gcc?) 2004-12-04 20:36:29 +00:00
Chris Danford 005a7f5efa convert more prefs to use Preference 2004-12-04 10:35:50 +00:00
Chris Danford d46bfd460d convert some prefs to use Preference 2004-12-04 08:21:54 +00:00
Chris Danford 63e138a212 remove includes from Preference.h 2004-12-04 07:15:22 +00:00
Chris Danford 5127ceef4d remove CachedThemeMetrics in favor of ThemeMetric<T>
fix "CachedThemeMetrics don't read HTML colors and don't evaluate Lua expressions"
2004-11-06 20:36:04 +00:00
Chris Danford 807d892f4f allow theme to specify logical screen dimensions 2004-09-21 06:07:12 +00:00
Steve Checkoway 2279d9ba2c Oops, missed one. 2004-09-13 04:45:36 +00:00
Steve Checkoway 3dc17a7804 Add virtual dtor, fix init order, const fixes, add operator const T& so you can use the preference exactly like its type. 2004-09-13 04:37:38 +00:00
Chris Danford 4a08923844 add missing file 2004-09-13 04:27:52 +00:00