Skip to content

Commit

Permalink
Merge pull request #134 from fa0311/develop-v5
Browse files Browse the repository at this point in the history
v5.7.0
  • Loading branch information
fa0311 authored Jun 6, 2024
2 parents c131a73 + 029e13f commit faa96db
Show file tree
Hide file tree
Showing 21 changed files with 2,339 additions and 253 deletions.
23 changes: 23 additions & 0 deletions DMMGamePlayerFastLauncher/DMMGamePlayerFastLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import os
import sys
import time
from tkinter import font

import customtkinter as ctk
import i18n
from app import App
from coloredlogs import ColoredFormatter
from component.logger import LoggingHandlerMask, StyleScheme, TkinkerLogger
from customtkinter import ThemeManager
from launch import GameLauncher, GameLauncherUac, LanchLauncher
from lib.DGPSessionV2 import DgpSessionV2
from models.setting_data import AppConfig
Expand Down Expand Up @@ -72,6 +74,27 @@ def loder(master: LanchLauncher):
DgpSessionV2.PROXY["https"] = AppConfig.DATA.dmm_proxy_all.get()

ctk.set_default_color_theme(str(AssetsPathConfig.THEMES.joinpath(AppConfig.DATA.theme.get()).with_suffix(".json")))

additional_theme = {
"MenuComponent": {"text_color": ["#000000", "#ffffff"]},
"LabelComponent": {"fg_color": ["#F9F9FA", "#343638"], "required_color": ["red", "red"]},
"CheckBoxComponent": {"checkbox_width": 16, "checkbox_height": 16, "border_width": 2},
}
for key, value in additional_theme.items():
ThemeManager.theme[key] = value

if AppConfig.DATA.theme_font.get() == "i18n":
i18n_font = i18n.t("app.font.main")
if i18n_font not in font.families():
logging.warning(f"Font {i18n_font} not found")
ThemeManager.theme["CTkFont"]["family"] = i18n_font
elif AppConfig.DATA.theme_font.get() == "os":
os_default_font = font.nametofont("TkDefaultFont").config()
if os_default_font is None:
logging.warning(f"Font {os_default_font} not found")
else:
ThemeManager.theme["CTkFont"]["family"] = os_default_font["family"]

ctk.set_appearance_mode(AppConfig.DATA.appearance_mode.get())

try:
Expand Down
3 changes: 2 additions & 1 deletion DMMGamePlayerFastLauncher/component/variable_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ def to_dict(self) -> dict[str, str]:

@classmethod
def from_dict(cls, obj: dict[str, str]):
item = [(k, v(value=obj.get(k))) for k, v in cls.__annotations__.items()]
default = cls().__dict__
item = [(k, v(value=obj.get(k, default[k].get()))) for k, v in cls.__annotations__.items()]
return cls(**dict(item))
4 changes: 2 additions & 2 deletions DMMGamePlayerFastLauncher/lib/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def search(self, name: str) -> int:


def get_sid() -> str:
desc = win32security.GetFileSecurity(".", win32security.OWNER_SECURITY_INFORMATION)
sid = desc.GetSecurityDescriptorOwner()
username = os.getlogin()
sid, domain, type = win32security.LookupAccountName("", username)
sidstr = win32security.ConvertSidToStringSid(sid)
return sidstr

Expand Down
1 change: 1 addition & 0 deletions DMMGamePlayerFastLauncher/models/setting_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SettingData(VariableBase):
dmm_proxy_all: StringVar = field(default_factory=StringVar)
lang: StringVar = field(default_factory=lambda: StringVar(value=get_default_locale()[0]))
theme: StringVar = field(default_factory=lambda: StringVar(value="blue"))
theme_font: StringVar = field(default_factory=lambda: StringVar(value="i18n"))
appearance_mode: StringVar = field(default_factory=lambda: StringVar(value="dark"))
window_scaling: DoubleVar = field(default_factory=lambda: DoubleVar(value=1.0))
debug_window: BooleanVar = field(default_factory=lambda: BooleanVar(value=False))
Expand Down
2 changes: 1 addition & 1 deletion DMMGamePlayerFastLauncher/static/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class Env(Dump):
VERSION = "v5.6.1"
VERSION = "v5.7.0"
RELEASE_VERSION = requests.get(UrlConfig.RELEASE_API).json().get("tag_name", VERSION)

DEVELOP: bool = os.environ.get("ENV") == "DEVELOP"
Expand Down
2 changes: 1 addition & 1 deletion DMMGamePlayerFastLauncher/static/loder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def config_loder():

def config_migrate():
if AppConfig.DATA.last_version.get() != Env.VERSION:
version = Version(AppConfig.DATA.last_version.get() or "v0.0.0")
version = Version(AppConfig.DATA.last_version.get())
logging.info(f"Migration from {version} to {Env.VERSION}")

if version < Version("v5.5.2"):
Expand Down
3 changes: 3 additions & 0 deletions DMMGamePlayerFastLauncher/tab/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def create(self):
OptionMenuComponent(self, text=i18n.t("app.setting.theme"), values=self.theme, variable=self.data.theme).create()
OptionMenuComponent(self, text=i18n.t("app.setting.appearance"), values=["light", "dark", "system"], variable=self.data.appearance_mode).create()

text = i18n.t("app.setting.font_preset")
OptionMenuComponent(self, text=text, tooltip=i18n.t("app.setting.font_preset_tooltip"), values=["i18n", "os", "theme"], variable=self.data.theme_font).create()

text = i18n.t("app.setting.proxy_all")
EntryComponent(self, text=text, tooltip=i18n.t("app.setting.proxy_all_tooltip"), variable=self.data.proxy_all).create()
text = i18n.t("app.setting.dmm_proxy_all")
Expand Down
7 changes: 5 additions & 2 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ DMM Game Player Fast Launcher for secure and fast start-up

[Detailed instructions(Japanese)](/docs/README-advance.md)

[Tutorial Video](https://github.com/fa0311/DMMGamePlayerFastLauncher/issues/135)

## Features

- **One click to launch the game**
Expand Down Expand Up @@ -46,8 +48,9 @@ If you find a bug, please report it in [Issues](https://github.com/fa0311/DMMGam

## Source

[Lutwidse/priconner_launch.py](https://gist.github.com/Lutwidse/82d8e7a20c96296bc0318f1cb6bf26ee)
[kira-96/Inno-Setup-Chinese-Simplified-Translation](https://github.com/kira-96/Inno-Setup-Chinese-Simplified-Translation)
- [Lutwidse/priconner_launch.py](https://gist.github.com/Lutwidse/82d8e7a20c96296bc0318f1cb6bf26ee)
- [kira-96/Inno-Setup-Chinese-Simplified-Translation](https://github.com/kira-96/Inno-Setup-Chinese-Simplified-Translation)
- [@takafi CustomTkinter 簡易カスタムテーマ作成ツール](https://qiita.com/takafi/items/90c17b7888263100cbbc)

## License

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン

[詳しい使い方](/docs/README-advance.md)

[チュートリアル動画](https://github.com/fa0311/DMMGamePlayerFastLauncher/issues/135)

## 特徴

- **ワンクリックでゲームを起動**
Expand Down Expand Up @@ -46,8 +48,9 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン

## 典拠

[Lutwidse/priconner_launch.py](https://gist.github.com/Lutwidse/82d8e7a20c96296bc0318f1cb6bf26ee)
[kira-96/Inno-Setup-Chinese-Simplified-Translation](https://github.com/kira-96/Inno-Setup-Chinese-Simplified-Translation)
- [Lutwidse/priconner_launch.py](https://gist.github.com/Lutwidse/82d8e7a20c96296bc0318f1cb6bf26ee)
- [kira-96/Inno-Setup-Chinese-Simplified-Translation](https://github.com/kira-96/Inno-Setup-Chinese-Simplified-Translation)
- [@takafi CustomTkinter 簡易カスタムテーマ作成ツール](https://qiita.com/takafi/items/90c17b7888263100cbbc)

## ライセンス

Expand Down
10 changes: 10 additions & 0 deletions assets/i18n/app.en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ en_US:
title: DMMGamePlayer Fast Launcher
language: English

font:
main: "Segoe UI"

tab:
home: Home
shortcut: Shortcut
Expand Down Expand Up @@ -144,6 +147,13 @@ en_US:
theme: Theme
appearance: Appearance

font_preset: Font Preset
font_preset_tooltip: |-
Select a font preset.
i18n: Optimized fonts for each language will be selected.
os: The default font of the operating system will be selected.
theme: Fonts matching the theme will be selected.
proxy_all: Proxy
proxy_all_tooltip: |-
Set up the game's proxy.
Expand Down
10 changes: 10 additions & 0 deletions assets/i18n/app.ja_JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ ja_JP:
title: DMMGamePlayer Fast Launcher
language: 日本語

font:
main: "Yu Gothic UI"

tab:
home: ホーム
shortcut: ショートカット
Expand Down Expand Up @@ -141,6 +144,13 @@ ja_JP:
theme: テーマ
appearance: 外観

font_preset: フォントプリセット
font_preset_tooltip: |-
フォントプリセットを選択します。
i18n: 言語ごとに最適化されたフォントが選択されます。
os: OSのデフォルトフォントが選択されます。
theme: テーマに合わせたフォントが選択されます。
proxy_all: プロキシ
proxy_all_tooltip: |-
ゲームのプロキシを設定します。
Expand Down
10 changes: 10 additions & 0 deletions assets/i18n/app.zh_CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ zh_CN:
title: DMMGamePlayer Fast Launcher
language: 简体中文

font:
main: "Microsoft YaHei UI"

tab:
home: 主页
shortcut: 快捷方式
Expand Down Expand Up @@ -143,6 +146,13 @@ zh_CN:
theme: 主题
appearance: 外观

font_preset: 字体预设
font_preset_tooltip: |-
选择字体预设。
i18n: 将选择针对每种语言优化的字体。
os: 将选择操作系统的默认字体。
theme: 将选择与主题匹配的字体。
proxy_all: 代理
proxy_all_tooltip: |-
设置游戏的代理。
Expand Down
10 changes: 10 additions & 0 deletions assets/i18n/app.zh_TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ zh_TW:
title: DMMGamePlayer Fast Launcher
language: 繁體中文

font:
main: "Microsoft JhengHei UI"

tab:
home: 首頁
shortcut: 快捷方式
Expand Down Expand Up @@ -142,6 +145,13 @@ zh_TW:
theme: 主題
appearance: 外貌

font_preset: 字型預設
font_preset_tooltip: |-
選擇字型預設。
i18n: 將選擇針對每種語言優化的字型。
os: 將選擇操作系統的預設字型。
theme: 將選擇與主題匹配的字型。
proxy_all: 代理
proxy_all_tooltip: |-
設定遊戲的代理。
Expand Down
Loading

0 comments on commit faa96db

Please sign in to comment.