[Update] Easter Eggとして、メイン画面ロゴ(コンパクトモード未対応)を3回クリックするとEaster Egg機能がオンになるように。

オフに戻すには再起動で。
※save jsonはコメントアウトしています。(今後、本実装する時に値が増えたり何かしら名前が変更になる可能性を考えて、ユーザー側にデータを保存したくないため)
This commit is contained in:
Sakamoto Shiina
2024-04-14 21:35:19 +09:00
parent f0bcc56483
commit cae1406d2b
4 changed files with 45 additions and 1 deletions

View File

@@ -247,6 +247,15 @@ class Config:
if isinstance(value, bool):
self._IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = value
@property
def IS_EASTER_EGG_ENABLED(self):
return self._IS_EASTER_EGG_ENABLED
@IS_EASTER_EGG_ENABLED.setter
def IS_EASTER_EGG_ENABLED(self, value):
if isinstance(value, bool):
self._IS_EASTER_EGG_ENABLED = value
# Save Json Data
## Main Window
@property
@@ -736,7 +745,7 @@ class Config:
def OVERLAY_UI_TYPE(self, value):
if isinstance(value, str):
self._OVERLAY_UI_TYPE = value
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
# saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
@property
@json_serializable('ENABLE_SEND_MESSAGE_TO_VRC')
@@ -911,6 +920,7 @@ class Config:
self._CURRENT_SENT_MESSAGES_LOG_INDEX = 0
self._IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
self._IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = False
self._IS_EASTER_EGG_ENABLED = False
# Save Json Data
## Main Window

View File

@@ -27,6 +27,11 @@ def callbackFilepathConfigFile():
def callbackQuitVrct():
setMainWindowGeometry()
def callbackEnableEasterEgg():
config.IS_EASTER_EGG_ENABLED = True
config.OVERLAY_UI_TYPE = "sakura"
view.printToTextbox_enableEasterEgg()
def setMainWindowGeometry():
PRE_SCALING_INT = strPctToInt(view.getPreUiScaling())
NEW_SCALING_INT = strPctToInt(config.UI_SCALING)
@@ -994,6 +999,8 @@ def createMainWindow(splash):
# set UI and callback
view.register(
common_registers={
"callback_enable_easter_egg": callbackEnableEasterEgg,
"callback_update_software": callbackUpdateSoftware,
"callback_restart_software": callbackRestartSoftware,
"callback_filepath_logs": callbackFilepathLogs,

View File

@@ -18,6 +18,7 @@ main_window:
textbox_tab_system: System
textbox_system_message:
enabled_easter_egg: Whoa! You caught us! There is something...like...easter-egg-ish function has enabled!
enabled_translation: Translation feature is turned on.
disabled_translation: Translation feature is turned off.
enabled_voice2chatbox: Transcription from the microphone has started.

26
view.py
View File

@@ -99,6 +99,8 @@ class View():
self.view_variable = SimpleNamespace(
# Common
CALLBACK_ENABLE_EASTER_EGG=None,
CALLBACK_RESTART_SOFTWARE=None,
CALLBACK_UPDATE_SOFTWARE=None,
CALLBACK_OPEN_FILEPATH_LOGS=None,
@@ -535,6 +537,8 @@ class View():
if common_registers is not None:
self.view_variable.CALLBACK_ENABLE_EASTER_EGG=common_registers.get("callback_enable_easter_egg", None)
self.view_variable.CALLBACK_UPDATE_SOFTWARE=common_registers.get("callback_update_software", None)
self.view_variable.CALLBACK_RESTART_SOFTWARE=common_registers.get("callback_restart_software", None)
self.view_variable.CALLBACK_OPEN_FILEPATH_LOGS=common_registers.get("callback_filepath_logs", None)
@@ -737,6 +741,25 @@ class View():
self.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
self.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
# Set Easter Egg
self.count = 0
def clickedCounter(_e):
if self.count < 2:
self.count+=1
print("Easter egg count:", self.count)
else:
print("Easter egg count:", self.count, "Easter egg has enabled.")
callFunctionIfCallable(self.view_variable.CALLBACK_ENABLE_EASTER_EGG)
print(config.OVERLAY_UI_TYPE)
vrct_gui.sidebar_logo.bind(
"<ButtonRelease>",
clickedCounter,
"+"
)
# Insert sample conversation for testing.
# self._insertSampleConversationToTextbox()
@@ -1616,6 +1639,9 @@ class View():
# Print To Textbox.
def printToTextbox_enableEasterEgg(self):
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.enabled_easter_egg"))
def printToTextbox_enableTranslation(self):
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.enabled_translation"))
def printToTextbox_disableTranslation(self):