Skip to content

Commit

Permalink
合并拉取请求 #48
Browse files Browse the repository at this point in the history
增加崩溃日志弹窗,修复资源文件非图片时导致的程序崩溃,修复光标启用刷新以及重启程序后按钮颜色不对,优化服务器列表警告文本,修复首页数据读取cfg中如果分身\本体名字丢失导致玩家名全为默认,优化README,增加软件截图
  • Loading branch information
XCWQW1 authored Aug 26, 2024
2 parents 359980c + 9c518f7 commit 9d3951d
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 9 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ English | <a href="README_zh.md">简体中文</a>
- [PyQt-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets) - A fluent design widgets library based on C++ Qt/PyQt/PySide.
- Realyn//UnU - Created a logo for this project

### Software Screenshots

![front_page](images/home.png)
![sidebar](images/home_tab.png)
![cfg_management](images/cfg.png)
![resource_management](images/resouces.png)
![server_list_management](images/server_list.png)
![setting](images/settings.png)
9 changes: 9 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@

- [PyQt-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets) - 基于 C++ Qt/PyQt/PySide 的流畅设计小部件库。
- Realyn//UnU - 为本项目制作了logo

### 软件截图

![首页](images/home.png)
![侧栏](images/home_tab.png)
![cfg管理](images/cfg.png)
![资源管理](images/resouces.png)
![服务器列表管理](images/server_list.png)
![设置](images/settings.png)
7 changes: 1 addition & 6 deletions app/view/home_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,7 @@ def __init__(self, parent=None):
self.hBoxLayout = QHBoxLayout()

self.vBoxLayout.addLayout(self.hBoxLayout, Qt.AlignTop)

try:
self.TEECARD(GlobalsVal.ddnet_setting_config["player_name"], GlobalsVal.ddnet_setting_config["dummy_name"])
except:
self.TEECARD("nameless tee", "[D] nameless te")

self.TEECARD(GlobalsVal.ddnet_setting_config.get("player_name", "nameless tee"), GlobalsVal.ddnet_setting_config.get("dummy_name", "[D] nameless te"))
self.vBoxLayout.addWidget(FriendList(), Qt.AlignCenter)

if cfg.get(cfg.DDNetCheckUpdate):
Expand Down
4 changes: 3 additions & 1 deletion app/view/resource_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self, file, card_type, parent=None):
if file == self.select_cursor:
self.button.setText('禁用')
button_select = self.button
button_select.setChecked(True)

self.vBoxLayout.addWidget(self.label, 0, Qt.AlignCenter)

Expand All @@ -128,11 +129,12 @@ def __button_clicked(self, checked): # gui_cursor.png
if checked:
self.button.setText('禁用')
button_select = self.button
cfg.set(cfg.DDNetCheckUpdate, self.file)
cfg.set(cfg.DDNetAssetsCursor, self.file)

shutil.copy(self.file, f"{ddnet_folder}/gui_cursor.png")
else:
self.button.setText('启用')
cfg.set(cfg.DDNetAssetsCursor, f"{ddnet_folder}/gui_cursor.png")
os.remove(f"{ddnet_folder}/gui_cursor.png")

def __on_clicked(self):
Expand Down
4 changes: 2 additions & 2 deletions app/view/server_list_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def Button_clicked(self, text):
parent=self
)
elif text == "重置":
w = MessageBox("警告", "该操作将会覆盖本地文件中的所有内容", self)
w = MessageBox("警告", "该操作将会覆盖现有服务器列表中的所有内容", self)
if w.exec():
with open(f'{GlobalsVal.ddnet_folder}/ddnet-serverlist-urls.cfg', 'w', encoding='utf-8') as f:
f.write('https://master1.ddnet.org/ddnet/15/servers.json\nhttps://master2.ddnet.org/ddnet/15/servers.json\nhttps://master3.ddnet.org/ddnet/15/servers.json\nhttps://master4.ddnet.org/ddnet/15/servers.json')
Expand All @@ -179,7 +179,7 @@ def Button_clicked(self, text):
parent=self
)
elif text == "一键加速":
w = MessageBox("警告", "该操作将会覆盖本地文件中的所有内容", self)
w = MessageBox("警告", "该操作将会覆盖现有服务器列表中的所有内容", self)
if w.exec():
with open(f'{GlobalsVal.ddnet_folder}/ddnet-serverlist-urls.cfg', 'w', encoding='utf-8') as f:
f.write('https://master1.ddnet.org/ddnet/15/servers.json\nhttps://master2.ddnet.org/ddnet/15/servers.json\nhttps://master3.ddnet.org/ddnet/15/servers.json\nhttps://master4.ddnet.org/ddnet/15/servers.json\nhttps://xc.null.red:8043/api/ddnet/get_ddnet_server_list\nhttps://midnight-1312303898.cos.ap-nanjing.myqcloud.com/server-list.json')
Expand Down
Binary file added images/cfg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/home_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/resouces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/server_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d3951d

Please sign in to comment.