[Update/Refactor] About VRCT: Poster Showcase. ワールド名追加や、ハイパーリンクの設定(Xの投稿)。

リンクがまだ(投稿がまだ)のものは、アイコンが暗く、クリックも出来ないように。
項目が増えたことにより、ページネーションの動きを新しく。
This commit is contained in:
Sakamoto Shiina
2024-04-25 17:29:22 +09:00
parent da83041fca
commit 44cba3f3ae
28 changed files with 181 additions and 90 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -58,8 +58,10 @@ def renameWeightFolder(path):
if os_path.exists(weight_path):
os_rename(weight_path, os_path.join(path, "weights"))
def splitListRandomly(lst, split_count):
random.shuffle(lst)
def splitList(lst:list, split_count:int, to_shuffle:bool=False):
if to_shuffle is True:
random.shuffle(lst)
split_lists = []
for i in range(0, len(lst), split_count):
sub_list = lst[i:i+split_count]

View File

@@ -1046,7 +1046,7 @@ class View():
def openWebPage_DeepL_Auth_Key(self):
self.openWebPage(config.DEEPL_AUTH_KEY_PAGE_URL)
def openWebPage_AboutVrct(self, target_type:str):
def openWebPage_AboutVrct(self, target_type:str, arg):
url = ""
match (target_type):
case ("X_MISYA"):
@@ -1086,6 +1086,11 @@ class View():
case ("SUPPORTER_REGISTRATION"):
url = "https://docs.google.com/forms/d/e/1FAIpQLSepLzdEOTJQFVHdOOxAA0dix3zCmnNBlmH4XWon5FldXkIiqw/viewform"
case ("X_SHIINA_POSTER_SHOWCASE_POST"):
url = "https://twitter.com/Shiina_12siy/status/" + arg
case "TEMP":
print("here is still under construction.")
return

View File

@@ -0,0 +1,122 @@
poster_showcase_worlds_settings = [
# トサカひよ
{
"author_name": "tosaka_hiyo",
"data": [
{ "image_file_name": "kokekkopiyopiyo.png", "x_post_num": "1779076974369276014" },
]
},
# MiuJepang
{
"author_name": "miu_jepang",
"data": [
{ "image_file_name": "ippaidou.png", "x_post_num": None },
{ "image_file_name": "nihongokurabu.png", "x_post_num": "1779004631936614893" },
{ "image_file_name": "language_exchange_tervern.png", "x_post_num": "1779749425923150317" },
{ "image_file_name": "japanese_culture_osenbeito.png", "x_post_num": None },
{ "image_file_name": "silakan_datang_ke_rumahku.png", "x_post_num": None },
{ "image_file_name": "uj_club.png", "x_post_num": "1780791654196388201" },
{ "image_file_name": "sushi_stand_guruguru.png", "x_post_num": None },
]
},
# poposuke_sig
{
"author_name": "poposuke_sig",
"data": [
{ "image_file_name": "usanezumi_shrine2.png", "x_post_num": "1781224020383506649" },
]
},
# KUROINU_YOUHEI
{
"author_name": "kuroinu_youhei",
"data": [
{ "image_file_name": "kuroinu_work_room.png", "x_post_num": "1779750007564112146" },
]
},
# いちや_ICHIYA
{
"author_name": "ichiya",
"data": [
{ "image_file_name": "ehon_no_heikousekai_jimusho.png", "x_post_num": "1780792306976850285" },
{ "image_file_name": "ikoiba.png", "x_post_num": "1782723006923780580" },
{ "image_file_name": "kimodameshi.png", "x_post_num": "1781224391692714133" },
{ "image_file_name": "parallel_collar.png", "x_post_num": None },
]
},
# HayaTikaze
{
"author_name": "haya_tikaze",
"data": [
{ "image_file_name": "study_japanese_world_japanichijou.png", "x_post_num": "1781539871829766550" },
]
},
# aji_3
{
"author_name": "aji_3",
"data": [
{ "image_file_name": "yuttari_eikaiwa.png", "x_post_num": "1779002892999078046" },
]
},
# 八葉そるち
{
"author_name": "yatuha_soruti",
"data": [
{ "image_file_name": "re_yatuha_room.png", "x_post_num": "1779830390435590196" },
]
},
# chakamoto
{
"author_name": "chakamoto",
"data": [
{ "image_file_name": "coffee_keisyoku_chakachaka.png", "x_post_num": None },
]
},
# MloYolM (よるむ)
{
"author_name": "yolm",
"data": [
{ "image_file_name": "cafe_cian.png", "x_post_num": None },
]
},
# ミラクル・オルカ
{
"author_name": "miracle_orca",
"data": [
{ "image_file_name": "mamehinata_dogrun.png", "x_post_num": "1782723423179100471" },
]
},
# いんくEenkoo
{
"author_name": "eenkoo",
"data": [
{ "image_file_name": "tyuuniti_kouryuukai.png", "x_post_num": None },
]
},
# 1ban_meno
{
"author_name": "1ban_meno",
"data": [
{ "image_file_name": "bar_asagao.png", "x_post_num": None },
]
},
# 沈黙静寂
{
"author_name": "sizudama_sizusabi",
"data": [
{ "image_file_name": "monogatari_meetup.png", "x_post_num": "1781538415789674976" },
]
},
]

View File

@@ -1,8 +1,9 @@
from types import SimpleNamespace
from customtkinter import CTkFrame, CTkLabel, CTkImage, CTkFont
from utils import callFunctionIfCallable, splitListRandomly
from utils import callFunctionIfCallable, splitList
from ......ui_utils import bindButtonFunctionAndColor, animateRotation, bindEnterAndLeaveFunction
from .about_vrct_store import poster_showcase_worlds_settings
def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, view_variable):
setting_box_wrapper.grid_columnconfigure(0, weight=1, minsize=settings.uism.MAIN_AREA_MIN_WIDTH)
@@ -49,9 +50,10 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
each_button = settings.about_vrct.embedImageButtonCTkLabel(
parent_frame=parent_frame,
image_file_name=each_setting["image_file_name"],
callback=each_setting["callback"],
callback=each_setting.get("callback", None),
directly_type=directly_type,
corner_radius=corner_radius,
no_bind=each_setting.get("no_bind", False),
)
each_button.grid(column=0, row=button_row, padx=0, pady=(0, bottom_pady), sticky="nsew")
each_button.img_label.grid(padx=ipadx, pady=ipady, sticky="nsew")
@@ -293,74 +295,25 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
poster_showcase_worlds.grid_columnconfigure(0, weight=1)
poster_showcase_worlds_settings = [
{
"image_file_name": "ehon_no_heikousekai_jimusho.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "ikoiba.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "ippaidou.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "japanese_culture_osenbeito.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "kimodameshi.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "kokekkopiyopiyo.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "kuroinu_work_room.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "language_exchange_tervern.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "nihongokurabu.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "parallel_collar.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "re_yatuha_room.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "silakan_datang_ke_rumahku.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "study_japanese_world_japanichijou.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "uj_club.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "usanezumi_shrine2.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
{
"image_file_name": "yuttari_eikaiwa.png",
"callback": lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP")
},
]
result = splitListRandomly(poster_showcase_worlds_settings, 8)
compounded_poster_showcase_worlds_list = []
for each_author_settings in poster_showcase_worlds_settings:
for data in each_author_settings["data"]:
if data["x_post_num"] is None:
append_settings = {
"image_file_name": data["image_file_name"],
"no_bind": True,
}
else:
x_post_num = data["x_post_num"]
callback = lambda _e,arg=x_post_num: view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT("X_SHIINA_POSTER_SHOWCASE_POST", arg)
append_settings = {
"image_file_name": data["image_file_name"],
"callback": callback,
}
compounded_poster_showcase_worlds_list.append(append_settings)
result = splitList(compounded_poster_showcase_worlds_list, 8)
poster_showcase_worlds_frame_list = []
for split_poster_showcase_worlds_settings in result:
poster_showcase_worlds_frame = CTkFrame(poster_showcase_worlds_wrapper, fg_color=ABOUT_VRCT_BG, corner_radius=0, width=0, height=0)
@@ -381,16 +334,24 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
pagination_button_settings = settings.about_vrct.image_file.POSTER_SHOWCASE_WORLD_PAGINATION_BUTTON
def toNextPagePosterShowcase(current_function_index):
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
poster_showcase_worlds_frame_list[current_function_index].grid_remove()
pre_function_index = current_function_index
current_function_index = (current_function_index + 1) % len(poster_showcase_worlds_frame_list)
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 = 180
if current_function_index == 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
@@ -411,7 +372,7 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST=toNextPagePosterShowcase
poster_showcase_worlds_frame_list[0].grid(column=0, row=0, padx=0, pady=(0,about_vrct_uism.POSTER_SHOWCASE_WORLD_BOTTOM_PADY), sticky="nsew")
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")
poster_showcase_worlds_wrapper.grid_rowconfigure(1, weight=1)
@@ -423,7 +384,7 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
config_window.poster_showcase_pagination_button = settings.about_vrct.embedImageButtonCTkLabel(
parent_frame=poster_showcase_pagination_button_wrapper,
image_file_name="poster_showcase_pagination_button.png",
callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST, view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM),
callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST),
hovered_color="transparent",
clicked_color="transparent",
)
@@ -434,11 +395,11 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie
poster_showcase_pagination_button_chato = settings.about_vrct.embedImageButtonCTkLabel(
parent_frame=poster_showcase_pagination_button_wrapper,
image_file_name="poster_showcase_pagination_button_chato.png",
callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST, view_variable.CALLBACK_ABOUT_VRCT_POSTER_SHOWCASE_CURRENT_PAGE_NUM),
callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_ABOUT_VRCT_CHANGE_POSTER_SHOWCASE_WORLD_LIST),
hovered_color="transparent",
clicked_color="transparent",
)
poster_showcase_pagination_button_chato.place(relx=0.5, rely=0.5, anchor="center")
poster_showcase_pagination_button_chato.place(relx=0.502, rely=0.51, anchor="center")
pagination_button_chato_settings = settings.about_vrct.image_file.POSTER_SHOWCASE_WORLD_PAGINATION_BUTTON_CHATO

View File

@@ -151,7 +151,7 @@ class AboutVrctManager():
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):
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):
fg_color = self.ctm.ABOUT_VRCT_BG if fg_color is None else fg_color
@@ -164,16 +164,17 @@ class AboutVrctManager():
img_label = self.embedImageCTkLabel(img_label_frame, image_file_name, image_scaling, directly_type, fg_color, anchor)
img_label_frame.configure(cursor="hand2")
img_label.configure(cursor="hand2")
img_label._canvas.configure(cursor="hand2")
bindButtonFunctionAndColor(
target_widgets=[img_label_frame, img_label],
enter_color=hovered_color,
leave_color=fg_color,
clicked_color=clicked_color,
buttonReleasedFunction=callback,
)
if no_bind is False:
img_label_frame.configure(cursor="hand2")
img_label.configure(cursor="hand2")
img_label._canvas.configure(cursor="hand2")
bindButtonFunctionAndColor(
target_widgets=[img_label_frame, img_label],
enter_color=hovered_color,
leave_color=fg_color,
clicked_color=clicked_color,
buttonReleasedFunction=callback,
)
img_label.grid()
img_label_frame.img_label = img_label