add global_script statistics dimension property

this script is ran once at the start, and its result is stored in the 'global_value' variable, which is accessible to the regular script.
This commit is contained in:
GenevensiS
2025-07-21 04:31:30 +02:00
parent 51f882315a
commit 5cd8069bf1
4 changed files with 35 additions and 14 deletions
+1
View File
@@ -68,6 +68,7 @@ IMPLEMENT_REFLECTION_NO_GET_MEMBER(StatsDimension) {
REFLECT(position_hint);
REFLECT_N("icon", icon_filename);
REFLECT(script);
REFLECT(global_script);
REFLECT(numeric);
REFLECT(bin_size);
REFLECT(show_empty);
+11 -10
View File
@@ -27,19 +27,20 @@ public:
StatsDimension();
StatsDimension(const Field&);
const bool automatic; ///< Based on a card field?
String name; ///< Name of this dimension
LocalizedString description; ///< Description, used in status bar
int position_hint; ///< Hint for the ordering
String icon_filename; ///< Icon for lists
Bitmap icon; ///< The loaded icon (optional of course)
OptionalScript script; ///< Script that determines the value(s)
bool numeric; ///< Are the values numeric? If so, they require special sorting
const bool automatic; ///< Based on a card field?
String name; ///< Name of this dimension
LocalizedString description; ///< Description, used in status bar
int position_hint; ///< Hint for the ordering
String icon_filename; ///< Icon for lists
Bitmap icon; ///< The loaded icon (optional of course)
OptionalScript script; ///< Script that determines the value(s), ran on each card
OptionalScript global_script; ///< Script that determines the value(s), ran only once at the start
bool numeric; ///< Are the values numeric? If so, they require special sorting
double bin_size; ///< Bin adjecent numbers?
bool show_empty; ///< Should "" be shown?
bool split_list; ///< Split values into multiple ones separated by commas
map<String,Color> colors; ///< Colors for the categories
vector<String> groups; ///< Order of the items
map<String,Color> colors; ///< Colors for the categories
vector<String> groups; ///< Order of the items
DECLARE_REFLECTION();
};