Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlocking "backpedaling" of character creation #83

Open
Toma400 opened this issue Oct 3, 2023 · 2 comments
Open

Unlocking "backpedaling" of character creation #83

Toma400 opened this issue Oct 3, 2023 · 2 comments
Labels
code improvement Call for some improvement of code feature request Feature being officially approved to be added
Milestone

Comments

@Toma400
Copy link
Owner

Toma400 commented Oct 3, 2023

During pre-alpha 3 development stage, there was an idea for smooth GUI in character creation space where you would just "climb" up next steps. This, however, had a significant downside: when clicking 'back' to revert previously agreed change, GUI would be messy and change states weirdly.
I do not want playerbase to be bugged by this behaviour, but I also do not want to focus on this particular case before everything really needed is done (bugs take time and motivation). So, in 05d42e5 I locked backpedaling, allowing for predictable behaviour of menu.

This, however, should be reverted for convenience once all is made and I will have post-development time (most likely pre-alpha 4 or pre-alpha 5).

@Toma400 Toma400 added feature request Feature being officially approved to be added code improvement Call for some improvement of code labels Oct 3, 2023
@Toma400 Toma400 added this to the Pre-Alpha 4 milestone Oct 3, 2023
@Toma400
Copy link
Owner Author

Toma400 commented Oct 22, 2023

Considering ceab6f0, it would be fairly easy to make this system fully working like before, the case would be just to - for each option - make them list not only the option further, like this, for example:

elif mouseColliderPx(mn7[0], mn7[1], mn7[2], mn7[3]):
    # go next
    if guitype[1] == "religion" and dyn_screen.journey.stages[5] is True:
        put_text(screen, text=langstring("ccrt__gen_category7"), font_cat="menu", size=30, align_x="left", pos_x=5, pos_y=58, colour=fCol.HOVERED.value)
        if mouseRec(pg_events):
            guitype[1] = switch_gscr(dyn_screen, screen, "origin")
            dyn_screen.reset_pgui()
    # go back
    if guitype[1] == "gameplay_settings":
        put_text(screen, text=langstring("ccrt__gen_category7"), font_cat="menu", size=30, align_x="left", pos_x=5, pos_y=58, colour=fCol.HOVERED.value)
        if mouseRec(pg_events):
            dyn_screen.journey.stages[7] = False
            guitype[1] = switch_gscr(dyn_screen, screen, "origin")
            dyn_screen.reset_pgui()

But make it so you have all next menus, but also all stages got reseted:

elif mouseColliderPx(mn7[0], mn7[1], mn7[2], mn7[3]):
    # go next
    if guitype[1] == "religion" and dyn_screen.journey.stages[5] is True:
        put_text(screen, text=langstring("ccrt__gen_category7"), font_cat="menu", size=30, align_x="left", pos_x=5, pos_y=58, colour=fCol.HOVERED.value)
        if mouseRec(pg_events):
            guitype[1] = switch_gscr(dyn_screen, screen, "origin")
            dyn_screen.reset_pgui()
    # go back
    if guitype[1] == "gameplay_settings" or guitype[1] == "summary":
        put_text(screen, text=langstring("ccrt__gen_category7"), font_cat="menu", size=30, align_x="left", pos_x=5, pos_y=58, colour=fCol.HOVERED.value)
        if mouseRec(pg_events):
            dyn_screen.journey.stages[7] = False
            dyn_screen.journey.stages[8] = False
            guitype[1] = switch_gscr(dyn_screen, screen, "origin")
            dyn_screen.reset_pgui()

Obviously this means more code, so before everything I'd suggest making some macro-like loop that will make it in one big checker (in similar style as this, however with memory that we are using variables here which are not as easily iterable).
This way we won't end up with like 150 lines of code for simply changing buttons, but one loop with very complex if-system.

It is a bit of hassle, so I'm putting this as low priority and even pushing to pre-alpha 5, for the time being.

@Toma400 Toma400 modified the milestones: Pre-Alpha 5, Pre-Alpha 6 Feb 26, 2024
@Toma400 Toma400 modified the milestones: Pre-Alpha 6, Pre-Alpha 7 Sep 17, 2024
@Toma400
Copy link
Owner Author

Toma400 commented Oct 12, 2024

Note: I got this issue when handling #129, it seems like going back from name submenu to gender menu, despite changing gender, the names were still sticking to what was picked the first time (non-binary names were listing only female ones). Probably needs some resetting system or stricter check on clicked elements and their values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code improvement Call for some improvement of code feature request Feature being officially approved to be added
Projects
None yet
Development

No branches or pull requests

1 participant