Skip to content

Commit

Permalink
Add missing midpoint beats to 3-act template, #1165
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Aug 12, 2024
1 parent 6d5e652 commit 956ab6b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/python/plotlyst/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ def update_acts(self):
midpoint_false_victory = StoryBeat(text='False victory',
icon='mdi.trophy-broken',
icon_color='#b5838d',
description="A moment when the protagonist appears to achieve their goal, only to face immediate significant setbacks",
description="A moment when the protagonist appears to achieve their goal, only to face immediate setbacks",
id=uuid.UUID('404883e9-d110-4e83-9c52-e37bb888632c'),
act=2, percentage=50)
midpoint_re_dedication = StoryBeat(text='Re-dedication',
Expand Down
27 changes: 25 additions & 2 deletions src/main/python/plotlyst/view/widget/structure/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
save_the_cat, three_act_structure, heros_journey, hook_beat, motion_beat, \
disturbance_beat, normal_world_beat, characteristic_moment_beat, midpoint, midpoint_ponr, midpoint_mirror, \
midpoint_proactive, crisis, first_plot_point, first_plot_point_ponr, first_plot_points, midpoints, story_spine, \
twists_and_turns, twist_beat, turn_beat, danger_beat, copy_beat, five_act_structure
twists_and_turns, twist_beat, turn_beat, danger_beat, copy_beat, five_act_structure, midpoint_false_victory, \
midpoint_re_dedication
from plotlyst.view.common import ExclusiveOptionalButtonGroup, push_btn, label
from plotlyst.view.generated.story_structure_selector_dialog_ui import Ui_StoryStructureSelectorDialog
from plotlyst.view.icons import IconRegistry
Expand Down Expand Up @@ -112,13 +113,17 @@ class _ThreeActMidpoint(BeatCustomization):
Point_of_no_return = auto()
Mirror_moment = auto()
Proactive = auto()
False_victory = auto()
Re_dedication = auto()


class _ThreeActEnding(BeatCustomization):
Crisis = auto()


def beat_option_title(option: BeatCustomization) -> str:
if option == _ThreeActMidpoint.Re_dedication:
return 'Re-dedication'
return option.name.replace('_', ' ')


Expand Down Expand Up @@ -147,6 +152,10 @@ def beat_option_description(option: BeatCustomization) -> str:
return midpoint_mirror.description
elif option == _ThreeActMidpoint.Proactive:
return midpoint_proactive.description
elif option == _ThreeActMidpoint.False_victory:
return midpoint_false_victory.description
elif option == _ThreeActMidpoint.Re_dedication:
return midpoint_re_dedication.description

elif option == _ThreeActEnding.Crisis:
return crisis.description
Expand Down Expand Up @@ -177,6 +186,10 @@ def beat_option_icon(option: BeatCustomization) -> Tuple[str, str]:
return midpoint_mirror.icon, midpoint_mirror.icon_color
elif option == _ThreeActMidpoint.Proactive:
return midpoint_proactive.icon, midpoint_proactive.icon_color
elif option == _ThreeActMidpoint.False_victory:
return midpoint_false_victory.icon, midpoint_false_victory.icon_color
elif option == _ThreeActMidpoint.Re_dedication:
return midpoint_re_dedication.icon, midpoint_re_dedication.icon_color

elif option == _ThreeActEnding.Crisis:
return crisis.icon, crisis.icon_color
Expand Down Expand Up @@ -207,6 +220,10 @@ def option_from_beat(beat: StoryBeat) -> Optional[BeatCustomization]:
return _ThreeActMidpoint.Mirror_moment
elif beat == midpoint_proactive:
return _ThreeActMidpoint.Proactive
elif beat == midpoint_false_victory:
return _ThreeActMidpoint.False_victory
elif beat == midpoint_re_dedication:
return _ThreeActMidpoint.Re_dedication

elif beat == crisis:
return _ThreeActEnding.Crisis
Expand Down Expand Up @@ -336,7 +353,9 @@ def __init__(self, novel: Novel, structure: StoryStructure, parent=None):
checked = option_from_beat(midpoint_beat) if midpoint_beat else None
menu = StructureOptionsMenu(self.btnMidpoint, 'Select the midpoint',
[_ThreeActMidpoint.Turning_point, _ThreeActMidpoint.Point_of_no_return,
_ThreeActMidpoint.Mirror_moment, _ThreeActMidpoint.Proactive], checked=checked)
_ThreeActMidpoint.Mirror_moment, _ThreeActMidpoint.Proactive,
_ThreeActMidpoint.Re_dedication,
_ThreeActMidpoint.False_victory], checked=checked)
menu.options.optionSelected.connect(self._midpointChanged)
menu.options.optionsReset.connect(self._midpointReset)

Expand Down Expand Up @@ -403,6 +422,10 @@ def _midpointChanged(self, midpoint_option: _ThreeActMidpoint):
beat = midpoint_mirror
elif midpoint_option == _ThreeActMidpoint.Proactive:
beat = midpoint_proactive
elif midpoint_option == _ThreeActMidpoint.False_victory:
beat = midpoint_false_victory
elif midpoint_option == _ThreeActMidpoint.Re_dedication:
beat = midpoint_re_dedication
else:
return

Expand Down

0 comments on commit 956ab6b

Please sign in to comment.