Care to suggest some improvements? ![Cool 8)](https://www.pinkpetal.org/Smileys/DarkB/cool.gif)
I would love to go over your entire code thoroughly to see what everything does, there is barely time to write my own and even when there is, I am too tired to
![Sad :(](https://www.pinkpetal.org/Smileys/DarkB/sad.gif)
Besides the design which I called "unnecessary complicated" as I do not understand why it was required, obvious flaw is:
def setSelection_for_chars_list(sel, lst, value="from_lst"):
for l in lst:
sel[l.name] = l if value == "from_lst" else None
char_list_selection = { c.name: None for c in char_lists_filters.sorted }
Names are not guaranteed to be unique (it's even possible to rename character in the profile screen unless someone disabled the button), this does not look like it'll benefit from being a dict either. If you make it a set:
button: # select all on current listing, deselects them if all are selected
xysize (66, 40)
action Function(setSelection_for_chars_list, char_list_selection, chars_list[0] + chars_list[1], value=None if all(char_list_selection[x.name] for x in chars_list[0] + chars_list[1]) else "from_lst")
text "These"
would become something along the lines of:
$ chars_on_page = set(chars_list[0] + chars_list[1])
button: # select all on current listing, deselects them if all are selected
xysize (66, 40)
if char_list_selection.issuperset(chars_on_page)):
action SetVaraible("char_list_selection", char_list_selection.difference(chars_on_page))
else:
action SetVaraible("char_list_selection", char_list_selection.union(chars_on_page))
text "These"
it's clean, efficient, everyone knows what it does and it doesn't require writing extra function. (code is unchecked/untested, I just typed it out in the forum) But even if you don't likes sets, you can use Chars as keys in the dict, it'll be safe and reliable as well and you can just toggle the False/True as values.
I have no clue what problems you were trying to solve with 200 lines of "delegator" classes, the tasks as I see them:
1) Create a group (set) of characters in the listing screen.
2) Pass the group to other screens, like equipment/training and etc.
3) Fix the interface on those screens through isinstance(Char/set) checks whereever required.
4) Write a number of funcs or update existing once to get the group functionality working.
there are no issues with this that I can foresee but I obviously never actually tried adding this functionality.
elif isinstance(var, (dict, renpy.python.RevertableDict)):
elif isinstance(var, (Char, rChar))
Python will check parent classes as well so:
elif isinstance(var, dict):
elif isinstance(var, Char):
will work in the same way.
I'll have a LOT more time for development starting around mid December, I can take a look at the rest of the addons then (but only if something is broken, rewriting code without a good reason is unwise, not before Beta release anyway).
I don't think items transfer is working correctly, you are supposed to have the
same characters in both viewports! The screen itself will make sure that you cannot pick two of the same character from both sides. It's a simple func if I recall correctly, you can take a look at how it's done in the buildings, just copy/paste the code and change the container (at least I hope that it's this simple*).