OptionRow::Reload doesn't take an OptionRowDefinition.

Implement Reload() explicitly, so we can clearly short-
circuit for static rows.

Fix up ScreenOptionsEditCourseEntry (broken during the
course of things).
This commit is contained in:
Glenn Maynard
2006-01-18 01:34:45 +00:00
parent 9b37d8966c
commit a3dc5596de
5 changed files with 124 additions and 59 deletions
+13 -1
View File
@@ -32,7 +32,19 @@ public:
this->LoadInternal( cmds );
}
virtual void LoadInternal( const Commands &cmds ) = 0;
virtual void Reload() { this->Load(m_cmds); }
/*
* We may re-use OptionRowHandlers. This is called before each
* use. If the contents of the row are dependent on external
* state (for example, the current song), clear the row contents
* and reinitialize them. As an optimization, rows which do not
* change can be initialized just once and left alone.
*
* If the row has been reinitialized, return true, and the graphic
* elements will also be reinitialized. If the row is static, and
* nothing has changed, return false.
*/
virtual bool Reload() { return false; }
virtual void ImportOption( const OptionRowDefinition &row, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const = 0;
/* Returns an OPT mask. */
virtual int ExportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const = 0;