bauiv1lib.achievements
Provides a popup window to view achievements.
1# Released under the MIT License. See LICENSE for details. 2# 3"""Provides a popup window to view achievements.""" 4 5from __future__ import annotations 6 7from typing import override 8 9import bauiv1 as bui 10 11 12class AchievementsWindow(bui.MainWindow): 13 """Popup window to view achievements.""" 14 15 def __init__( 16 self, 17 transition: str | None = 'in_right', 18 origin_widget: bui.Widget | None = None, 19 ): 20 # pylint: disable=too-many-locals 21 assert bui.app.classic is not None 22 uiscale = bui.app.ui_v1.uiscale 23 self._width = 600 if uiscale is bui.UIScale.SMALL else 500 24 self._height = ( 25 380 26 if uiscale is bui.UIScale.SMALL 27 else 370 if uiscale is bui.UIScale.MEDIUM else 450 28 ) 29 yoffs = -45 if uiscale is bui.UIScale.SMALL else 0 30 31 super().__init__( 32 root_widget=bui.containerwidget( 33 size=(self._width, self._height), 34 toolbar_visibility=( 35 'menu_minimal' 36 if uiscale is bui.UIScale.SMALL 37 else 'menu_full' 38 ), 39 scale=( 40 2.3 41 if uiscale is bui.UIScale.SMALL 42 else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 43 ), 44 stack_offset=( 45 (0, 0) 46 if uiscale is bui.UIScale.SMALL 47 else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) 48 ), 49 ), 50 transition=transition, 51 origin_widget=origin_widget, 52 ) 53 54 if uiscale is bui.UIScale.SMALL: 55 bui.containerwidget( 56 edit=self._root_widget, on_cancel_call=self.main_window_back 57 ) 58 self._back_button = None 59 else: 60 self._back_button = bui.buttonwidget( 61 parent=self._root_widget, 62 autoselect=True, 63 position=(50, self._height - 38 + yoffs), 64 size=(60, 60), 65 scale=0.6, 66 label=bui.charstr(bui.SpecialChar.BACK), 67 button_type='backSmall', 68 on_activate_call=self.main_window_back, 69 ) 70 bui.containerwidget( 71 edit=self._root_widget, cancel_button=self._back_button 72 ) 73 74 achievements = bui.app.classic.ach.achievements 75 num_complete = len([a for a in achievements if a.complete]) 76 77 txt_final = bui.Lstr( 78 resource='accountSettingsWindow.achievementProgressText', 79 subs=[ 80 ('${COUNT}', str(num_complete)), 81 ('${TOTAL}', str(len(achievements))), 82 ], 83 ) 84 self._title_text = bui.textwidget( 85 parent=self._root_widget, 86 position=( 87 self._width * 0.5, 88 self._height 89 - (27 if uiscale is bui.UIScale.SMALL else 20) 90 + yoffs, 91 ), 92 size=(0, 0), 93 h_align='center', 94 v_align='center', 95 scale=0.6, 96 text=txt_final, 97 maxwidth=200, 98 color=bui.app.ui_v1.title_color, 99 ) 100 101 self._scrollwidget = bui.scrollwidget( 102 parent=self._root_widget, 103 size=( 104 self._width - 60, 105 self._height - (150 if uiscale is bui.UIScale.SMALL else 80), 106 ), 107 position=( 108 30, 109 (110 if uiscale is bui.UIScale.SMALL else 35) + yoffs, 110 ), 111 capture_arrows=True, 112 simple_culling_v=10, 113 border_opacity=0.4, 114 ) 115 bui.widget(edit=self._scrollwidget, autoselect=True) 116 if uiscale is bui.UIScale.SMALL: 117 bui.widget( 118 edit=self._scrollwidget, 119 left_widget=bui.get_special_widget('back_button'), 120 ) 121 122 bui.containerwidget( 123 edit=self._root_widget, cancel_button=self._back_button 124 ) 125 126 incr = 36 127 sub_width = self._width - 90 128 sub_height = 40 + len(achievements) * incr 129 130 eq_rsrc = 'coopSelectWindow.powerRankingPointsEqualsText' 131 pts_rsrc = 'coopSelectWindow.powerRankingPointsText' 132 133 self._subcontainer = bui.containerwidget( 134 parent=self._scrollwidget, 135 size=(sub_width, sub_height), 136 background=False, 137 ) 138 139 total_pts = 0 140 for i, ach in enumerate(achievements): 141 complete = ach.complete 142 bui.textwidget( 143 parent=self._subcontainer, 144 position=(sub_width * 0.08 - 5, sub_height - 20 - incr * i), 145 maxwidth=20, 146 scale=0.5, 147 color=(0.6, 0.6, 0.7) if complete else (0.6, 0.6, 0.7, 0.2), 148 flatness=1.0, 149 shadow=0.0, 150 text=str(i + 1), 151 size=(0, 0), 152 h_align='right', 153 v_align='center', 154 ) 155 156 bui.imagewidget( 157 parent=self._subcontainer, 158 position=( 159 (sub_width * 0.10 + 1, sub_height - 20 - incr * i - 9) 160 if complete 161 else (sub_width * 0.10 - 4, sub_height - 20 - incr * i - 14) 162 ), 163 size=(18, 18) if complete else (27, 27), 164 opacity=1.0 if complete else 0.3, 165 color=ach.get_icon_color(complete)[:3], 166 texture=ach.get_icon_ui_texture(complete), 167 ) 168 if complete: 169 bui.imagewidget( 170 parent=self._subcontainer, 171 position=( 172 sub_width * 0.10 - 4, 173 sub_height - 25 - incr * i - 9, 174 ), 175 size=(28, 28), 176 color=(2, 1.4, 0), 177 texture=bui.gettexture('achievementOutline'), 178 ) 179 bui.textwidget( 180 parent=self._subcontainer, 181 position=(sub_width * 0.19, sub_height - 19 - incr * i + 3), 182 maxwidth=sub_width * 0.62, 183 scale=0.6, 184 flatness=1.0, 185 shadow=0.0, 186 color=(1, 1, 1) if complete else (1, 1, 1, 0.2), 187 text=ach.display_name, 188 size=(0, 0), 189 h_align='left', 190 v_align='center', 191 ) 192 193 bui.textwidget( 194 parent=self._subcontainer, 195 position=(sub_width * 0.19, sub_height - 19 - incr * i - 10), 196 maxwidth=sub_width * 0.62, 197 scale=0.4, 198 flatness=1.0, 199 shadow=0.0, 200 color=(0.83, 0.8, 0.85) if complete else (0.8, 0.8, 0.8, 0.2), 201 text=( 202 ach.description_full_complete 203 if complete 204 else ach.description_full 205 ), 206 size=(0, 0), 207 h_align='left', 208 v_align='center', 209 ) 210 211 pts = ach.power_ranking_value 212 bui.textwidget( 213 parent=self._subcontainer, 214 position=(sub_width * 0.92, sub_height - 20 - incr * i), 215 maxwidth=sub_width * 0.15, 216 color=(0.7, 0.8, 1.0) if complete else (0.9, 0.9, 1.0, 0.3), 217 flatness=1.0, 218 shadow=0.0, 219 scale=0.6, 220 text=bui.Lstr( 221 resource=pts_rsrc, subs=[('${NUMBER}', str(pts))] 222 ), 223 size=(0, 0), 224 h_align='center', 225 v_align='center', 226 ) 227 if complete: 228 total_pts += pts 229 230 bui.textwidget( 231 parent=self._subcontainer, 232 position=( 233 sub_width * 1.0, 234 sub_height - 20 - incr * len(achievements), 235 ), 236 maxwidth=sub_width * 0.5, 237 scale=0.7, 238 color=(0.7, 0.8, 1.0), 239 flatness=1.0, 240 shadow=0.0, 241 text=bui.Lstr( 242 value='${A} ${B}', 243 subs=[ 244 ('${A}', bui.Lstr(resource='coopSelectWindow.totalText')), 245 ( 246 '${B}', 247 bui.Lstr( 248 resource=eq_rsrc, 249 subs=[('${NUMBER}', str(total_pts))], 250 ), 251 ), 252 ], 253 ), 254 size=(0, 0), 255 h_align='right', 256 v_align='center', 257 ) 258 259 @override 260 def get_main_window_state(self) -> bui.MainWindowState: 261 # Support recreating our window for back/refresh purposes. 262 cls = type(self) 263 return bui.BasicMainWindowState( 264 create_call=lambda transition, origin_widget: cls( 265 transition=transition, origin_widget=origin_widget 266 ) 267 )
class
AchievementsWindow(bauiv1._uitypes.MainWindow):
13class AchievementsWindow(bui.MainWindow): 14 """Popup window to view achievements.""" 15 16 def __init__( 17 self, 18 transition: str | None = 'in_right', 19 origin_widget: bui.Widget | None = None, 20 ): 21 # pylint: disable=too-many-locals 22 assert bui.app.classic is not None 23 uiscale = bui.app.ui_v1.uiscale 24 self._width = 600 if uiscale is bui.UIScale.SMALL else 500 25 self._height = ( 26 380 27 if uiscale is bui.UIScale.SMALL 28 else 370 if uiscale is bui.UIScale.MEDIUM else 450 29 ) 30 yoffs = -45 if uiscale is bui.UIScale.SMALL else 0 31 32 super().__init__( 33 root_widget=bui.containerwidget( 34 size=(self._width, self._height), 35 toolbar_visibility=( 36 'menu_minimal' 37 if uiscale is bui.UIScale.SMALL 38 else 'menu_full' 39 ), 40 scale=( 41 2.3 42 if uiscale is bui.UIScale.SMALL 43 else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 44 ), 45 stack_offset=( 46 (0, 0) 47 if uiscale is bui.UIScale.SMALL 48 else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) 49 ), 50 ), 51 transition=transition, 52 origin_widget=origin_widget, 53 ) 54 55 if uiscale is bui.UIScale.SMALL: 56 bui.containerwidget( 57 edit=self._root_widget, on_cancel_call=self.main_window_back 58 ) 59 self._back_button = None 60 else: 61 self._back_button = bui.buttonwidget( 62 parent=self._root_widget, 63 autoselect=True, 64 position=(50, self._height - 38 + yoffs), 65 size=(60, 60), 66 scale=0.6, 67 label=bui.charstr(bui.SpecialChar.BACK), 68 button_type='backSmall', 69 on_activate_call=self.main_window_back, 70 ) 71 bui.containerwidget( 72 edit=self._root_widget, cancel_button=self._back_button 73 ) 74 75 achievements = bui.app.classic.ach.achievements 76 num_complete = len([a for a in achievements if a.complete]) 77 78 txt_final = bui.Lstr( 79 resource='accountSettingsWindow.achievementProgressText', 80 subs=[ 81 ('${COUNT}', str(num_complete)), 82 ('${TOTAL}', str(len(achievements))), 83 ], 84 ) 85 self._title_text = bui.textwidget( 86 parent=self._root_widget, 87 position=( 88 self._width * 0.5, 89 self._height 90 - (27 if uiscale is bui.UIScale.SMALL else 20) 91 + yoffs, 92 ), 93 size=(0, 0), 94 h_align='center', 95 v_align='center', 96 scale=0.6, 97 text=txt_final, 98 maxwidth=200, 99 color=bui.app.ui_v1.title_color, 100 ) 101 102 self._scrollwidget = bui.scrollwidget( 103 parent=self._root_widget, 104 size=( 105 self._width - 60, 106 self._height - (150 if uiscale is bui.UIScale.SMALL else 80), 107 ), 108 position=( 109 30, 110 (110 if uiscale is bui.UIScale.SMALL else 35) + yoffs, 111 ), 112 capture_arrows=True, 113 simple_culling_v=10, 114 border_opacity=0.4, 115 ) 116 bui.widget(edit=self._scrollwidget, autoselect=True) 117 if uiscale is bui.UIScale.SMALL: 118 bui.widget( 119 edit=self._scrollwidget, 120 left_widget=bui.get_special_widget('back_button'), 121 ) 122 123 bui.containerwidget( 124 edit=self._root_widget, cancel_button=self._back_button 125 ) 126 127 incr = 36 128 sub_width = self._width - 90 129 sub_height = 40 + len(achievements) * incr 130 131 eq_rsrc = 'coopSelectWindow.powerRankingPointsEqualsText' 132 pts_rsrc = 'coopSelectWindow.powerRankingPointsText' 133 134 self._subcontainer = bui.containerwidget( 135 parent=self._scrollwidget, 136 size=(sub_width, sub_height), 137 background=False, 138 ) 139 140 total_pts = 0 141 for i, ach in enumerate(achievements): 142 complete = ach.complete 143 bui.textwidget( 144 parent=self._subcontainer, 145 position=(sub_width * 0.08 - 5, sub_height - 20 - incr * i), 146 maxwidth=20, 147 scale=0.5, 148 color=(0.6, 0.6, 0.7) if complete else (0.6, 0.6, 0.7, 0.2), 149 flatness=1.0, 150 shadow=0.0, 151 text=str(i + 1), 152 size=(0, 0), 153 h_align='right', 154 v_align='center', 155 ) 156 157 bui.imagewidget( 158 parent=self._subcontainer, 159 position=( 160 (sub_width * 0.10 + 1, sub_height - 20 - incr * i - 9) 161 if complete 162 else (sub_width * 0.10 - 4, sub_height - 20 - incr * i - 14) 163 ), 164 size=(18, 18) if complete else (27, 27), 165 opacity=1.0 if complete else 0.3, 166 color=ach.get_icon_color(complete)[:3], 167 texture=ach.get_icon_ui_texture(complete), 168 ) 169 if complete: 170 bui.imagewidget( 171 parent=self._subcontainer, 172 position=( 173 sub_width * 0.10 - 4, 174 sub_height - 25 - incr * i - 9, 175 ), 176 size=(28, 28), 177 color=(2, 1.4, 0), 178 texture=bui.gettexture('achievementOutline'), 179 ) 180 bui.textwidget( 181 parent=self._subcontainer, 182 position=(sub_width * 0.19, sub_height - 19 - incr * i + 3), 183 maxwidth=sub_width * 0.62, 184 scale=0.6, 185 flatness=1.0, 186 shadow=0.0, 187 color=(1, 1, 1) if complete else (1, 1, 1, 0.2), 188 text=ach.display_name, 189 size=(0, 0), 190 h_align='left', 191 v_align='center', 192 ) 193 194 bui.textwidget( 195 parent=self._subcontainer, 196 position=(sub_width * 0.19, sub_height - 19 - incr * i - 10), 197 maxwidth=sub_width * 0.62, 198 scale=0.4, 199 flatness=1.0, 200 shadow=0.0, 201 color=(0.83, 0.8, 0.85) if complete else (0.8, 0.8, 0.8, 0.2), 202 text=( 203 ach.description_full_complete 204 if complete 205 else ach.description_full 206 ), 207 size=(0, 0), 208 h_align='left', 209 v_align='center', 210 ) 211 212 pts = ach.power_ranking_value 213 bui.textwidget( 214 parent=self._subcontainer, 215 position=(sub_width * 0.92, sub_height - 20 - incr * i), 216 maxwidth=sub_width * 0.15, 217 color=(0.7, 0.8, 1.0) if complete else (0.9, 0.9, 1.0, 0.3), 218 flatness=1.0, 219 shadow=0.0, 220 scale=0.6, 221 text=bui.Lstr( 222 resource=pts_rsrc, subs=[('${NUMBER}', str(pts))] 223 ), 224 size=(0, 0), 225 h_align='center', 226 v_align='center', 227 ) 228 if complete: 229 total_pts += pts 230 231 bui.textwidget( 232 parent=self._subcontainer, 233 position=( 234 sub_width * 1.0, 235 sub_height - 20 - incr * len(achievements), 236 ), 237 maxwidth=sub_width * 0.5, 238 scale=0.7, 239 color=(0.7, 0.8, 1.0), 240 flatness=1.0, 241 shadow=0.0, 242 text=bui.Lstr( 243 value='${A} ${B}', 244 subs=[ 245 ('${A}', bui.Lstr(resource='coopSelectWindow.totalText')), 246 ( 247 '${B}', 248 bui.Lstr( 249 resource=eq_rsrc, 250 subs=[('${NUMBER}', str(total_pts))], 251 ), 252 ), 253 ], 254 ), 255 size=(0, 0), 256 h_align='right', 257 v_align='center', 258 ) 259 260 @override 261 def get_main_window_state(self) -> bui.MainWindowState: 262 # Support recreating our window for back/refresh purposes. 263 cls = type(self) 264 return bui.BasicMainWindowState( 265 create_call=lambda transition, origin_widget: cls( 266 transition=transition, origin_widget=origin_widget 267 ) 268 )
Popup window to view achievements.
AchievementsWindow( transition: str | None = 'in_right', origin_widget: _bauiv1.Widget | None = None)
16 def __init__( 17 self, 18 transition: str | None = 'in_right', 19 origin_widget: bui.Widget | None = None, 20 ): 21 # pylint: disable=too-many-locals 22 assert bui.app.classic is not None 23 uiscale = bui.app.ui_v1.uiscale 24 self._width = 600 if uiscale is bui.UIScale.SMALL else 500 25 self._height = ( 26 380 27 if uiscale is bui.UIScale.SMALL 28 else 370 if uiscale is bui.UIScale.MEDIUM else 450 29 ) 30 yoffs = -45 if uiscale is bui.UIScale.SMALL else 0 31 32 super().__init__( 33 root_widget=bui.containerwidget( 34 size=(self._width, self._height), 35 toolbar_visibility=( 36 'menu_minimal' 37 if uiscale is bui.UIScale.SMALL 38 else 'menu_full' 39 ), 40 scale=( 41 2.3 42 if uiscale is bui.UIScale.SMALL 43 else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 44 ), 45 stack_offset=( 46 (0, 0) 47 if uiscale is bui.UIScale.SMALL 48 else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) 49 ), 50 ), 51 transition=transition, 52 origin_widget=origin_widget, 53 ) 54 55 if uiscale is bui.UIScale.SMALL: 56 bui.containerwidget( 57 edit=self._root_widget, on_cancel_call=self.main_window_back 58 ) 59 self._back_button = None 60 else: 61 self._back_button = bui.buttonwidget( 62 parent=self._root_widget, 63 autoselect=True, 64 position=(50, self._height - 38 + yoffs), 65 size=(60, 60), 66 scale=0.6, 67 label=bui.charstr(bui.SpecialChar.BACK), 68 button_type='backSmall', 69 on_activate_call=self.main_window_back, 70 ) 71 bui.containerwidget( 72 edit=self._root_widget, cancel_button=self._back_button 73 ) 74 75 achievements = bui.app.classic.ach.achievements 76 num_complete = len([a for a in achievements if a.complete]) 77 78 txt_final = bui.Lstr( 79 resource='accountSettingsWindow.achievementProgressText', 80 subs=[ 81 ('${COUNT}', str(num_complete)), 82 ('${TOTAL}', str(len(achievements))), 83 ], 84 ) 85 self._title_text = bui.textwidget( 86 parent=self._root_widget, 87 position=( 88 self._width * 0.5, 89 self._height 90 - (27 if uiscale is bui.UIScale.SMALL else 20) 91 + yoffs, 92 ), 93 size=(0, 0), 94 h_align='center', 95 v_align='center', 96 scale=0.6, 97 text=txt_final, 98 maxwidth=200, 99 color=bui.app.ui_v1.title_color, 100 ) 101 102 self._scrollwidget = bui.scrollwidget( 103 parent=self._root_widget, 104 size=( 105 self._width - 60, 106 self._height - (150 if uiscale is bui.UIScale.SMALL else 80), 107 ), 108 position=( 109 30, 110 (110 if uiscale is bui.UIScale.SMALL else 35) + yoffs, 111 ), 112 capture_arrows=True, 113 simple_culling_v=10, 114 border_opacity=0.4, 115 ) 116 bui.widget(edit=self._scrollwidget, autoselect=True) 117 if uiscale is bui.UIScale.SMALL: 118 bui.widget( 119 edit=self._scrollwidget, 120 left_widget=bui.get_special_widget('back_button'), 121 ) 122 123 bui.containerwidget( 124 edit=self._root_widget, cancel_button=self._back_button 125 ) 126 127 incr = 36 128 sub_width = self._width - 90 129 sub_height = 40 + len(achievements) * incr 130 131 eq_rsrc = 'coopSelectWindow.powerRankingPointsEqualsText' 132 pts_rsrc = 'coopSelectWindow.powerRankingPointsText' 133 134 self._subcontainer = bui.containerwidget( 135 parent=self._scrollwidget, 136 size=(sub_width, sub_height), 137 background=False, 138 ) 139 140 total_pts = 0 141 for i, ach in enumerate(achievements): 142 complete = ach.complete 143 bui.textwidget( 144 parent=self._subcontainer, 145 position=(sub_width * 0.08 - 5, sub_height - 20 - incr * i), 146 maxwidth=20, 147 scale=0.5, 148 color=(0.6, 0.6, 0.7) if complete else (0.6, 0.6, 0.7, 0.2), 149 flatness=1.0, 150 shadow=0.0, 151 text=str(i + 1), 152 size=(0, 0), 153 h_align='right', 154 v_align='center', 155 ) 156 157 bui.imagewidget( 158 parent=self._subcontainer, 159 position=( 160 (sub_width * 0.10 + 1, sub_height - 20 - incr * i - 9) 161 if complete 162 else (sub_width * 0.10 - 4, sub_height - 20 - incr * i - 14) 163 ), 164 size=(18, 18) if complete else (27, 27), 165 opacity=1.0 if complete else 0.3, 166 color=ach.get_icon_color(complete)[:3], 167 texture=ach.get_icon_ui_texture(complete), 168 ) 169 if complete: 170 bui.imagewidget( 171 parent=self._subcontainer, 172 position=( 173 sub_width * 0.10 - 4, 174 sub_height - 25 - incr * i - 9, 175 ), 176 size=(28, 28), 177 color=(2, 1.4, 0), 178 texture=bui.gettexture('achievementOutline'), 179 ) 180 bui.textwidget( 181 parent=self._subcontainer, 182 position=(sub_width * 0.19, sub_height - 19 - incr * i + 3), 183 maxwidth=sub_width * 0.62, 184 scale=0.6, 185 flatness=1.0, 186 shadow=0.0, 187 color=(1, 1, 1) if complete else (1, 1, 1, 0.2), 188 text=ach.display_name, 189 size=(0, 0), 190 h_align='left', 191 v_align='center', 192 ) 193 194 bui.textwidget( 195 parent=self._subcontainer, 196 position=(sub_width * 0.19, sub_height - 19 - incr * i - 10), 197 maxwidth=sub_width * 0.62, 198 scale=0.4, 199 flatness=1.0, 200 shadow=0.0, 201 color=(0.83, 0.8, 0.85) if complete else (0.8, 0.8, 0.8, 0.2), 202 text=( 203 ach.description_full_complete 204 if complete 205 else ach.description_full 206 ), 207 size=(0, 0), 208 h_align='left', 209 v_align='center', 210 ) 211 212 pts = ach.power_ranking_value 213 bui.textwidget( 214 parent=self._subcontainer, 215 position=(sub_width * 0.92, sub_height - 20 - incr * i), 216 maxwidth=sub_width * 0.15, 217 color=(0.7, 0.8, 1.0) if complete else (0.9, 0.9, 1.0, 0.3), 218 flatness=1.0, 219 shadow=0.0, 220 scale=0.6, 221 text=bui.Lstr( 222 resource=pts_rsrc, subs=[('${NUMBER}', str(pts))] 223 ), 224 size=(0, 0), 225 h_align='center', 226 v_align='center', 227 ) 228 if complete: 229 total_pts += pts 230 231 bui.textwidget( 232 parent=self._subcontainer, 233 position=( 234 sub_width * 1.0, 235 sub_height - 20 - incr * len(achievements), 236 ), 237 maxwidth=sub_width * 0.5, 238 scale=0.7, 239 color=(0.7, 0.8, 1.0), 240 flatness=1.0, 241 shadow=0.0, 242 text=bui.Lstr( 243 value='${A} ${B}', 244 subs=[ 245 ('${A}', bui.Lstr(resource='coopSelectWindow.totalText')), 246 ( 247 '${B}', 248 bui.Lstr( 249 resource=eq_rsrc, 250 subs=[('${NUMBER}', str(total_pts))], 251 ), 252 ), 253 ], 254 ), 255 size=(0, 0), 256 h_align='right', 257 v_align='center', 258 )
Create a MainWindow given a root widget and transition info.
Automatically handles in and out transitions on the provided widget, so there is no need to set transitions when creating it.
260 @override 261 def get_main_window_state(self) -> bui.MainWindowState: 262 # Support recreating our window for back/refresh purposes. 263 cls = type(self) 264 return bui.BasicMainWindowState( 265 create_call=lambda transition, origin_widget: cls( 266 transition=transition, origin_widget=origin_widget 267 ) 268 )
Return a WindowState to recreate this window, if supported.