miniMAXIme: Character scaler and selector

by Pi-C

The player stands like a giant near the vehicles. Now you can adjust the size of your character -- and you can change your appearance at any time if you've other mods that provide extra characters!

Tweaks
10 days ago
0.16 - 2.0
31.6K

b [Fixed] Crash when clicking change page buttons: attempt to compare boolean with number

24 days ago
(updated 24 days ago)

Somehow there's two threads about this, third time's the charm lol

Log:

Error while running event minime::on_gui_click (ID 1)
__minime__/scripts/gui_stuff/gui_char_selector.lua:1642: attempt to compare boolean with number
stack traceback:
    __minime__/scripts/gui_stuff/gui_char_selector.lua:1642: in function 'on_gui_selection_state_changed'
    __minime__/scripts/gui.lua:425: in function 'on_gui_selection_state_changed'
    __minime__/scripts/gui_stuff/gui_char_selector.lua:460: in function 'update_page_selector_buttons'
    __minime__/scripts/gui_stuff/gui_char_selector.lua:1568: in function 'on_gui_click'
    __minime__/scripts/gui.lua:370: in function 'event_handler'
    __minime__/scripts/events.lua:302: in function <__minime__/scripts/events.lua:299>"

Replicate/Reproduce: click the gap between the arrow buttons and the dropdown menu for page selection. A non-recoverable error will occur.

Fix: for now, changing line 1510 inside the on_gui_click function in scripts/gui_stuff/gui_char_selector.lua from this:

if not minime.prefixed(element, minime.character_selector_prefix) then

to this:

if not minime.prefixed(element, minime.character_selector_prefix) or element == character_page_selector_flow_name then

seems to be enough. This'll make it so clicking on the page selection flow (the gap) does nothing, idk if this could cause other problems tho.

A guess for the crash: since character_page_selector_flow_name (elements flow), prev/next_button_name (button flows) and dropdown_list_name (dropdown flow) all have the same prefix, the check done at line 1587 (minime.prefixed in --GUI-ACTION) passes even when character_page_selector_flow_name is parsed, which is why element.name ends up becoming ..._elements_flow instead of ..._selector_next or ..._selector_back , causing element.name == buttons.previous/next to become false, since element.name becomes the wrong element when you click the container for the page selection buttons (element flow instead of page button flows). I guess ideally you'd want to change either the element flow's prefix or the page button flows' prefixes in scripts/gui_stuff/gui_element_names.lua, whichever you prefer, so that they are not the same anymore (assuming that doing so doesn't break anything and that it isn't a pain to do).

24 days ago

Somehow there's two threads about this, third time's the charm lol

Thanks to this, I've finally been able to reproduce the crash!

Replicate/Reproduce: click the gap between the arrow buttons and the dropdown menu for page selection. A non-recoverable error will occur.

Like they (used to?) say in London: "Mind the gap!" I always must have landed on the buttons or drop-down list while testing, so I never triggered this before.

Fix: for now, changing line 1510 inside the on_gui_click function in scripts/gui_stuff/gui_char_selector.lua from this:

Yes, you're right! Just to be safe, I've also changed lines 1633f. to this:

new_page = (element.name == buttons.previous and old_page - 1) or
            (element.name == buttons.next and old_page + 1) or
            old_page

Falling back to the value of old_page will protect from crashes even if I'd change the GUI at some point in the future. But your change is more efficient now as it stops execution earlier if the gap is clicked.

A guess for the crash:

Yes, your analysis was correct.

I guess ideally you'd want to change either the element flow's prefix or the page button flows' prefixes in scripts/gui_stuff/gui_element_names.lua, whichever you prefer, so that they are not the same anymore (assuming that doing so doesn't break anything and that it isn't a pain to do).

I'd rather not do this, changing names could break stuff. :-)

20 days ago

Please check out version 2.0.16!

All good now, thx

New response