From bae638b7d725a108182a4fe403da4605bc7d5828 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:36:10 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20About=20VRCT:=20Poster=20Showcase.?= =?UTF-8?q?=20=E8=B5=B7=E5=8B=95=E6=AF=8E=E3=81=AB=E3=80=81=E6=9C=80?= =?UTF-8?q?=E5=88=9D=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=AB=E3=83=89=E5=90=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E3=83=A9=E3=83=B3?= =?UTF-8?q?=E3=83=80=E3=83=A0=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../createSettingBox_AboutVrct.py | 31 ++++++++++++------- vrct_gui/ui_managers/AboutVrctManager.py | 8 ++--- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py index eb0b9b11..41eb28e6 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py @@ -1,3 +1,4 @@ +from random import randint from types import SimpleNamespace from customtkinter import CTkFrame, CTkLabel, CTkImage, CTkFont @@ -334,6 +335,20 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie pagination_button_settings = settings.about_vrct.image_file.POSTER_SHOWCASE_WORLD_PAGINATION_BUTTON + def defineAngles(index): + start_angle = 0 + goal_angle = 90 + if index == 0: + start_angle = 0 + goal_angle = 90 + elif index == 1: + start_angle = 90 + goal_angle = 180 + elif index == 2: + start_angle = 180 + goal_angle = 360 + return(start_angle, goal_angle) + def toNextPagePosterShowcase(): current_function_index = view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST=None @@ -343,17 +358,7 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie poster_showcase_worlds_frame_list[current_function_index].grid(column=0, row=0, padx=0, pady=(0,about_vrct_uism.POSTER_SHOWCASE_WORLD_BOTTOM_PADY), sticky="nsew") view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM = current_function_index - start_angle = 0 - goal_angle = 90 - if pre_function_index == 0: - start_angle = 0 - goal_angle = 90 - elif pre_function_index == 1: - start_angle = 90 - goal_angle = 180 - elif pre_function_index == 2: - start_angle = 180 - goal_angle = 360 + start_angle, goal_angle = defineAngles(pre_function_index) animateRotation( tk_root=config_window, @@ -371,6 +376,9 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie # Initialize view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST=toNextPagePosterShowcase + view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM = randint(0, len(poster_showcase_worlds_frame_list)-1) + + start_angle, _goal_angle = defineAngles(view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM) poster_showcase_worlds_frame_list[view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM].grid(column=0, row=0, padx=0, pady=(0,about_vrct_uism.POSTER_SHOWCASE_WORLD_BOTTOM_PADY), sticky="nsew") @@ -387,6 +395,7 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST), hovered_color="transparent", clicked_color="transparent", + rotate_angle=-start_angle # for clockwise angle, put negative "-" ) config_window.poster_showcase_pagination_button.grid(column=1, row=0, padx=0, pady=0, sticky="nsew") diff --git a/vrct_gui/ui_managers/AboutVrctManager.py b/vrct_gui/ui_managers/AboutVrctManager.py index a4305020..88f4b7d4 100644 --- a/vrct_gui/ui_managers/AboutVrctManager.py +++ b/vrct_gui/ui_managers/AboutVrctManager.py @@ -124,7 +124,7 @@ class AboutVrctManager(): return size - def embedImageCTkLabel(self, parent_frame, image_file_name, image_scaling=IMAGE_STANDARD_SCALING, directly_type:str=None, fg_color:str="transparent", anchor:str="w"): + def embedImageCTkLabel(self, parent_frame, image_file_name, image_scaling=IMAGE_STANDARD_SCALING, directly_type:str=None, fg_color:str="transparent", anchor:str="w", rotate_angle:int=0): img = getImageFileFromUiUtils_AboutVrct(image_file_name, directly_type) @@ -146,12 +146,12 @@ class AboutVrctManager(): height=image_height, fg_color=fg_color, anchor=anchor, - image=CTkImage((img), size=(image_width, image_height)) + image=CTkImage((img).rotate(rotate_angle), size=(image_width, image_height)) ) return img_label - def embedImageButtonCTkLabel(self, parent_frame, image_file_name, callback, image_scaling=IMAGE_STANDARD_SCALING, directly_type:str=None, fg_color:str=None, hovered_color:str=None, clicked_color:str=None, anchor:str="w", corner_radius:int=0, no_bind:bool=False): + def embedImageButtonCTkLabel(self, parent_frame, image_file_name, callback, image_scaling=IMAGE_STANDARD_SCALING, directly_type:str=None, fg_color:str=None, hovered_color:str=None, clicked_color:str=None, anchor:str="w", corner_radius:int=0, no_bind:bool=False, rotate_angle:int=0): fg_color = self.ctm.ABOUT_VRCT_BG if fg_color is None else fg_color @@ -162,7 +162,7 @@ class AboutVrctManager(): img_label_frame = CTkFrame(parent_frame, fg_color=fg_color, corner_radius=corner_radius, width=0, height=0) - img_label = self.embedImageCTkLabel(img_label_frame, image_file_name, image_scaling, directly_type, fg_color, anchor) + img_label = self.embedImageCTkLabel(img_label_frame, image_file_name, image_scaling, directly_type, fg_color, anchor, rotate_angle) if no_bind is False: img_label_frame.configure(cursor="hand2")