Default item selection in Carousel Mode? #1825
-
I would like to extend the behavior of the built-in Carousel mode to support having a default value provided as a mode setting/parameter (which could be either a dynamic value or a static string value that exists in the list). I have extended the implementation so that it is fully working but I would like to know:
Many thanks for the response. Note: I can submit a pull request if you would like to get this additional feature incorporated into the main code base. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
On the one hand, it depends whether you're asking about MPF-MC or GMC. On the other hand, no, there's no way it can be achieved with the current implementation :) The carousel is managed by MPF as an array of items and rendered in the media controller through events. With MPF being the source of truth and the "selection" being an index of the array of items, there is always something selected. If the desire is to conditionally choose which item is selected first, conditional events in the carousel What situation are you facing where a default value for the carousel is the solution? |
Beta Was this translation helpful? Give feedback.
-
I did something exactly that in my first game, where the player could choose from a variety of missions. If they played but did not complete a mission, the first item in the carousel would always be the last mission they attempted. (That block is the only relevant section, all the rest of that code is for much more complex stuff) |
Beta Was this translation helpful? Give feedback.
I did something exactly that in my first game, where the player could choose from a variety of missions. If they played but did not complete a mission, the first item in the carousel would always be the last mission they attempted.
https://github.com/avanwinkle/masseffect2/blob/master/modes/missionselect/code/missionselect.py#L90-L95
(That block is the only relevant section, all the rest of that code is for much more complex stuff)