Skip to content

Commit

Permalink
Merge pull request #37 from triwinds/dev
Browse files Browse the repository at this point in the history
PR for 0.3.7
  • Loading branch information
triwinds authored Mar 25, 2023
2 parents 345770d + 6192f8c commit 8a7c65b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 29 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.3.7
- 修复 Ryujinx 固件安装失败时会删除原有固件的问题 (#36)
- 一些样式调整

## 0.3.6
- 对于一些不经常发生变更的数据使用持久化缓存
- 更新 ffhome 的链接
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sys


current_version = '0.3.6'
current_version = '0.3.7'
user_agent = f'ns-emu-tools/{current_version}'


Expand Down
30 changes: 16 additions & 14 deletions module/ryujinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,23 @@ def install_firmware_to_ryujinx(firmware_version=None):
send_notify(f'当前的 固件 就是 [{firmware_version}], 跳过安装.')
return
firmware_path = get_ryujinx_user_folder().joinpath(r'bis\system\Contents\registered')
shutil.rmtree(firmware_path, ignore_errors=True)
firmware_path.mkdir(parents=True, exist_ok=True)
tmp_dir = firmware_path.joinpath('tmp/')
from module.firmware import install_firmware
new_version = install_firmware(firmware_version, tmp_dir)
if new_version:
for path in tmp_dir.glob('*.nca'):
name = path.name[:-9] + '.nca' if path.name.endswith('.cnmt.nca') else path.name
nca_dir = firmware_path.joinpath(name)
nca_dir.mkdir()
path.rename(nca_dir.joinpath('00'))
tmp_dir = firmware_path.parent.joinpath('tmp/')
try:
from module.firmware import install_firmware
new_version = install_firmware(firmware_version, tmp_dir)
if new_version:
shutil.rmtree(firmware_path, ignore_errors=True)
firmware_path.mkdir(parents=True, exist_ok=True)
for path in tmp_dir.glob('*.nca'):
name = path.name[:-9] + '.nca' if path.name.endswith('.cnmt.nca') else path.name
nca_dir = firmware_path.joinpath(name)
nca_dir.mkdir()
path.rename(nca_dir.joinpath('00'))
config.ryujinx.firmware = new_version
dump_config()
send_notify(f'固件 [{firmware_version}] 安装成功,请安装相应的 key 至 Ryujinx.')
finally:
shutil.rmtree(tmp_dir, ignore_errors=True)
config.ryujinx.firmware = new_version
dump_config()
send_notify(f'固件 [{firmware_version}] 安装成功,请安装相应的 key 至 Ryujinx.')


def clear_ryujinx_folder(ryujinx_path: Path):
Expand Down
2 changes: 1 addition & 1 deletion ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main(port=0, mode=None, dev=False):
mode = 'edge'
else:
mode = 'user default'
size = (1440, 850)
size = (1280, 850)
logger.info(f'browser mode: {mode}')
if port == 0:
from utils.network import get_available_port
Expand Down
2 changes: 1 addition & 1 deletion ui_webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main():
port = get_available_port()
url = f'http://localhost:{port}/{default_page}'
logger.info(f'start webview with url: {url}')
webview.create_window('NS EMU TOOLS', url, width=1440, height=850, text_select=True)
webview.create_window('NS EMU TOOLS', url, width=1280, height=850, text_select=True)
webview.start(func=start_eel)


Expand Down
8 changes: 4 additions & 4 deletions vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@
</v-container>
</v-app-bar>

<v-main>
<v-container fluid style="height: 100%">
<v-row class="child-flex" style="height: 100%">
<v-col style="height: 100%">
<v-main style="overflow-y: hidden">
<v-container fluid style="height: 100%; padding: 0; margin-top: 5px">
<v-row class="child-flex" style="height: 100%; margin-bottom: 0">
<v-col style="height: 100%; padding-bottom: 0">
<router-view style="height: 100%"/>
</v-col>
</v-row>
Expand Down
10 changes: 5 additions & 5 deletions vue/src/components/SimplePage.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<v-container style="overflow-y: auto" ref="page-container">
<v-row style="height: 100%">
<v-container style="overflow-y: auto; padding-bottom: 0" ref="page-container">
<v-row style="height: 100%; margin-bottom: 0">
<v-spacer v-show="$vuetify.breakpoint.mdAndUp"></v-spacer>
<v-col md="10" lg="8" xl="7">
<v-col md="11" lg="9" xl="8" style="padding-bottom: 0">
<slot></slot>
</v-col>
<v-spacer v-show="$vuetify.breakpoint.mdAndUp"></v-spacer>
Expand All @@ -14,9 +14,9 @@
export default {
name: "SimplePage",
mounted() {
this.$refs["page-container"].style.maxHeight = `${window.innerHeight - 80}px`
this.$refs["page-container"].style.maxHeight = `${window.innerHeight - 70}px`
window.onresize = () => {
this.$refs["page-container"].style.maxHeight = `${window.innerHeight - 80}px`
this.$refs["page-container"].style.maxHeight = `${window.innerHeight - 70}px`
}
},
destroyed() {
Expand Down
4 changes: 2 additions & 2 deletions vue/src/pages/CloudflareST.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<v-container>
<v-row>
<v-col>
<v-btn block outlined x-large color="success" @click="optimizeCloudflareHosts()">测速并应用至 hosts</v-btn>
<v-btn block outlined color="success" @click="optimizeCloudflareHosts()">测速并应用至 hosts</v-btn>
</v-col>
<v-col>
<v-btn block outlined x-large color="error" @click="removeCloudflareHosts()">移除添加的配置</v-btn>
<v-btn block outlined color="error" @click="removeCloudflareHosts()">移除添加的配置</v-btn>
</v-col>
</v-row>
</v-container>
Expand Down
2 changes: 1 addition & 1 deletion vue/src/pages/YuzuCheatsManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default {
return []
},
updateCheatItemBoxHeight() {
this.cheatItemBoxHeight = window.innerHeight - 440
this.cheatItemBoxHeight = window.innerHeight - 390
},
concatFolderItemName(item) {
let gameName = item.game_name ? item.game_name : this.gameDataInited ? '未知游戏' : '游戏信息加载中...'
Expand Down

0 comments on commit 8a7c65b

Please sign in to comment.