mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
restrict slider ui to slider fields
This commit is contained in:
@@ -33,14 +33,15 @@ public:
|
||||
class Choice;
|
||||
typedef intrusive_ptr<Choice> ChoiceP;
|
||||
|
||||
ChoiceP choices; ///< A choice group of possible choices
|
||||
OptionalScript script; ///< Script to apply to all values
|
||||
OptionalScript default_script; ///< Script that generates the default value
|
||||
String initial; ///< Initial choice of a new value, or ""
|
||||
String default_name; ///< Name of "default" value
|
||||
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
|
||||
map<String,Color> choice_colors_cardlist; ///< Colors for the various choices, for in the card list
|
||||
|
||||
ChoiceP choices; ///< A choice group of possible choices
|
||||
OptionalScript script; ///< Script to apply to all values
|
||||
OptionalScript default_script; ///< Script that generates the default value
|
||||
String initial; ///< Initial choice of a new value, or ""
|
||||
String default_name; ///< Name of "default" value
|
||||
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
|
||||
map<String,Color> choice_colors_cardlist; ///< Colors for the various choices, for in the card list
|
||||
bool is_slider = false; ///< Should the UI be displayed as a slider?
|
||||
|
||||
void initDependencies(Context&, const Dependency&) const override;
|
||||
void after_reading(Version ver) override;
|
||||
};
|
||||
|
||||
@@ -35,6 +35,8 @@ IMPLEMENT_REFLECTION(SliderField) {
|
||||
void SliderField::after_reading(Version ver) {
|
||||
Field::after_reading(ver);
|
||||
|
||||
is_slider = true;
|
||||
|
||||
int choice_count = choices->choices.size();
|
||||
|
||||
if (maximum < minimum) swap(minimum, maximum);
|
||||
|
||||
Reference in New Issue
Block a user