Stats page bug fixes (#29)

* Added <atom-sep> to subtype_separators to better accomodate multi-wordsubtypes.
* Fixed the colorless value in Color Category not being localized and not linking relevant cards when clicking on it's histogram bar.
* Fixed the global_variable_average_opening_hand_statistic function being extremely slow and potentially crashing large sets.
* Added is_tokenish method that checks if something is a token, an emblem, a designation, a rulestip, a counter or a checklist.
* Fixed a bug on some setups, where strings could be too long and would cause the display tab of the preferences menu to collapse on itself.
* fix some untranslated strings

---------

Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com>
This commit is contained in:
GenevensiS
2024-01-15 14:10:57 +01:00
committed by GitHub
parent 0960b3d694
commit 666632a4e9
17 changed files with 243 additions and 175 deletions

View File

@@ -1106,10 +1106,9 @@ super_type_filter := {
"<{tag}>{input}</{tag}>"
}
break_subtypes := split_text@(match: " +|<atom-sep>[^<]*</atom-sep>", include_empty:false)
break_subtypes := split_text@(match: "<atom-sep>[^<]*</atom-sep>|</?word-list-[^>]*>", include_empty:false) # splitting at word-list tags is for backwards compatibility, when atom-sep was not yet inserted everywhere.
break_supertypes := split_text@(match: "<atom-sep>[^<]*</atom-sep>", include_empty:false)
sub_type_filter := {
input := remove_tag(tag: "<word-list-")
input := remove_tag(tag: "<soft")
# What word list to use?
list_type_rest := if lang_setting("is_creature")(type) or lang_setting("is_kindred")(type) then "class-"+lang_setting("code")
@@ -1130,9 +1129,11 @@ sub_type_filter := {
);
# wrap wordlist tag around each part
parts := break_subtypes()
(for each i:part in parts do
if i == 0 then
"<word-list-{list_type_first}>{part}</word-list-{list_type_first}>"
checked_first := false
(for each part in parts do
if trim(part) == "" then ""
else if not checked_first then
(checked_first := true; "<word-list-{list_type_first}>{part}</word-list-{list_type_first}>")
else
languages[lang_name()].subtype_separator + "<word-list-{list_type_rest}>{part}</word-list-{list_type_rest}>"
) +