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

Filtering Framework Expansion #5554

Merged

Conversation

ThePotatoGuy
Copy link
Member

@ThePotatoGuy ThePotatoGuy commented Apr 16, 2020

Key Changes

  • MASFilterSwitch - filter-based version of ConditionSwitch. Basically builds a ConditionSwitch that uses filters appropriately. Should be used for most cases, although this may change as we use more filters.
  • MASFilteredSprite - generates a filtered version of an image as a displayable
  • MASFilterableSprite - updated to include highlight via MASFilterMap. In general, this should only be used if you need to combine a sprite and its highlight for whatever reason.
  • filter adding and adjustment framework:
    • mas_sprites.add_filter - adds a new filter. Must be called before init level -1.
    • mas_sprites.get_filter - gets the current filter
    • mas_sprites.set_filter - sets the current filter. ignores invalid filter values
    • mas_isCurrentFlt - checks if the current filter is the same as the passed in one
  • the spaceroom label is now in charge of progressing the filter. It will handle scene change and dissolve all when filter change is appropriate.
  • added parameter progress_filter to the spaceroom label. Passing in False will prevent spaceroom from progressing the filter.
  • added scene change request option to idle mailbox. Also updated weather to use this.
  • replaced morning_flag in the calendar displayable to self.day_mode which is set by the mas_current_background.isFltDay function.
  • Marked some TODOs for MASBackground integration later
  • removed morning_flag
  • removed dev_sprite_timer.rpy
  • removed mas_weather.should_scene_change - if you want the scene to change, call mas_idle_mailbox.send_scene_change

new API functions

  • mas_progressFilter - progresses the filter depending on rules. This should only be called by spaceroom label. DO NOT USE ANYWHERE ELSE.
  • mas_isDay - replaces mas_isSunny
  • mas_isDayNow - variant of mas_isDayNow except uses current time. This should replace previous uses of mas_isMorning
  • mas_isNightNow - variant of mas_isNight except uses current time. This should replace previous uses of not mas_isMorning

New MASBackground functions

  • isFltDay - checks if the given/current filter is considered a "day" filter. This will be fully implemented with filtering-backgrounds development in the future. For now it is specific to day/night filtering. This should replace all uses of the global morning_flag
  • isFltNight - checks if the given/current filter is considered a "night" filter. See isFltDay. This should replace all uses of not morning_flag

Testing

  • verify spaceroom + monika looks okay
  • verify spaceroom + monika transitions between day and night appropriately. When changing suntimes via settings, the spaceroom may not update right away.
  • verify exp previewer looks ok and the Filter option works ok
  • verify calendar still looks okay in day and night UI
  • verify opendoor/crashed/islands greetings still look okay
  • verify islands still looks okay
  • verify weather progression/changing still works okay
  • verify the following images look fine day and night:
    • mas_o31_deco
    • mas_d25_banners
    • mas_mistletoe
    • mas_d25_lights
    • mas_d25_garlands
    • mas_d25_tree
    • mas_d25_gifts_1
    • mas_d25_gifts_2
    • mas_d25_gifts_3
    • mas_bday_cake_monika - lit and unlit
    • mas_bday_cake_player - lit and unlit
    • mas_bday_banners
    • mas_bday_balloons
    • chibi_peek

@ThePotatoGuy ThePotatoGuy added awaiting testing code needs to be tested awaiting code review someone needs to check for syntax/logic/indentation errors labels Apr 16, 2020
@ThePotatoGuy ThePotatoGuy added this to the 0.11.1 milestone Apr 16, 2020
@ThePotatoGuy ThePotatoGuy added this to awaiting review in core via automation Apr 16, 2020
@ThePotatoGuy
Copy link
Member Author

oops there are more morning_flag cases that need to be transitioned. please hold

@ThePotatoGuy ThePotatoGuy removed the DONT MERGE srs label Apr 17, 2020
@ThePotatoGuy
Copy link
Member Author

@multimokia changes addressed

@ThePotatoGuy
Copy link
Member Author

ThePotatoGuy commented Apr 18, 2020

marking as high priority because of future dev that needs the additional options to create filtered sprites

image mas_o31_deco = ConditionSwitch(
"morning_flag", "mod_assets/location/spaceroom/o31/halloween_deco.png",
"not morning_flag", "mod_assets/location/spaceroom/o31/halloween_deco-n.png"
image mas_o31_deco = MASFilterSwitch(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter dims the lighting of o31 decor, the player cake and Monika's cake by a lot. For these 3 cases we should either use the current night sprites or, if possible, highlights.

@@ -222,8 +223,12 @@ M̼̤̱͇̤ ͈̰̬͈̭ͅw̩̜͇͈ͅa̲̩̭̩ͅs̙ ̣͔͓͚̰h̠̯̫̼͉e̗̗̮r
"""
super(renpy.Displayable, self).__init__()

# dont really feel like changing every image line to not do inline
# if statements so this will work for now.
self.day_mode = not mas_globals.dark_mode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calendar was not affected by mas_globals.dark_mode as it is not considered as part of the ui but part of the background, so it should change depending on the day or the filter cycle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why? calendar is all UI elements so it should follow the UI rules.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calendar is only somewhat a button. Since it hangs on the spaceroom walls and also functions as a part of the room, we treat it as such. Additionally, it makes no sense for the calendar to change with ui modes because it's a part of the room.

@multimokia multimokia self-requested a review April 19, 2020 14:35
core automation moved this from awaiting review to awaiting merge Apr 19, 2020
@multimokia multimokia removed the awaiting code review someone needs to check for syntax/logic/indentation errors label Apr 19, 2020
@multimokia multimokia removed awaiting testing code needs to be tested high priority labels Apr 19, 2020
@multimokia multimokia merged commit 591c43b into Monika-After-Story:content Apr 19, 2020
core automation moved this from awaiting merge to done Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
core
  
done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants