Commit e0a6502e authored by 神楽坂玲奈's avatar 神楽坂玲奈

th123

parent 54220677
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
value="{{currentApp.status.progress}}" max="{{currentApp.status.total}}"></progress> value="{{currentApp.status.progress}}" max="{{currentApp.status.total}}"></progress>
<div *ngIf="currentApp.status.status==='ready' && (currentApp.id != 'ygopro')"> <div *ngIf="currentApp.status.status==='ready' && (currentApp.id != 'ygopro')">
<button (click)="runApp(currentApp)" type="button" class="btn btn-primary">运行</button> <button (click)="runApp(currentApp)" type="button" class="btn btn-primary">运行</button>
<button *ngIf="currentApp.actions.get('custom')" (click)="custom(currentApp)" type="button" class="btn btn-secondary">设置</button> <button *ngIf="currentApp.actions.get('custom')" (click)="custom(currentApp)" type="button"
<!--<button (click)="appsService.browse(currentApp)" type="button" class="btn btn-secondary">游览本地文件</button>--> class="btn btn-secondary">设置
</button>
<div id="network" *ngIf="currentApp.network && currentApp.network.protocol == 'maotama'"> <div id="network" *ngIf="currentApp.network && currentApp.network.protocol == 'maotama'">
<div class="input-group"> <div class="input-group">
...@@ -114,56 +115,12 @@ ...@@ -114,56 +115,12 @@
<div *ngIf="currentApp.isInstalled()"> <div *ngIf="currentApp.isInstalled()">
<h2>本地文件</h2> <h2>本地文件</h2>
<button (click)="appsService.browse(currentApp)" type="button" class="btn btn-secondary">浏览本地文件</button> <button (click)="appsService.browse(currentApp)" type="button" class="btn btn-secondary">浏览本地文件</button>
<button type="button" class="btn btn-secondary">校验完整性</button>
<button (click)="uninstall(currentApp)" type="button" class="btn btn-secondary"> <button (click)="uninstall(currentApp)" type="button" class="btn btn-secondary">
{{'uninstall'|translate}} {{'uninstall'|translate}}
</button> </button>
</div> </div>
<!--<div class="modal fade" id="settings-modal" tabindex="-1">-->
<!--<div class="modal-dialog" role="document">-->
<!--<div class="modal-content">-->
<!--<div class="modal-header">-->
<!--<button type="button" class="close" data-dismiss="modal" aria-label="Close">-->
<!--<span aria-hidden="true">&times;</span>-->
<!--</button>-->
<!--<h4 class="modal-title">{{'settings'|translate}}</h4>-->
<!--<ul class="nav nav-tabs">-->
<!--<li class="nav-item">-->
<!--<a class="nav-link active" data-toggle="tab" href="#general"> {{'general'|translate}} </a>-->
<!--</li>-->
<!--<li class="nav-item">-->
<!--<a class="nav-link" data-toggle="tab" href="#updates"> {{'updates'|translate}} </a>-->
<!--</li>-->
<!--<li class="nav-item">-->
<!--<a class="nav-link" data-toggle="tab" href="#local-files"> {{'local files'|translate}} </a>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<!--<div class="modal-body">-->
<!--<div class="tab-content">-->
<!--<div id="general" role="tabpanel" class="tab-pane fade active">-->
<!--</div>-->
<!--<div id="updates" role="tabpanel" class="tab-pane fade">-->
<!--</div>-->
<!--<div id="local-files" role="tabpanel" class="tab-pane fade">-->
<!--<div class="list-inline">-->
<!--<button type="button" [disabled]="!currentApp.isInstalled()" (click)="uninstall()">-->
<!--{{'uninstall'|translate}}-->
<!--</button>-->
<!--<i *ngIf="uninstalling" class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>-->
<!--<span class="sr-only">Loading...</span>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>&lt;!&ndash; Modal &ndash;&gt;-->
<div class="modal fade" id="install-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" <div class="modal fade" id="install-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
*ngIf="installConfig"> *ngIf="installConfig">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
......
...@@ -122,7 +122,7 @@ export class AppsService { ...@@ -122,7 +122,7 @@ export class AppsService {
return children; return children;
} }
async runApp(app: App, action_name='main') { async runApp(app: App, action_name = 'main') {
let children = this.findChildren(app); let children = this.findChildren(app);
let cwd = (<AppLocal>app.local).path; let cwd = (<AppLocal>app.local).path;
let action: Action = <Action>app.actions.get(action_name); let action: Action = <Action>app.actions.get(action_name);
...@@ -137,10 +137,26 @@ export class AppsService { ...@@ -137,10 +137,26 @@ export class AppsService {
} }
} }
let execute = path.join(cwd, action.execute); let execute = path.join(cwd, action.execute);
if(app.id == 'th123'){ if (app.id == 'th123') {
let th105 = <App>app.references.get('th105'); let th105 = <App>app.references.get('th105');
if(th105.isInstalled()){ if (th105.isInstalled()) {
const config_file = path.join((<AppLocal>app.local).path, 'np21nt.ini'); const config_file = path.join((<AppLocal>app.local).path, 'configex123.ini');
let config = await new Promise((resolve, reject) => {
fs.readFile(config_file, {encoding: 'utf-8'}, (error, data) => {
if (error) return reject(error);
resolve(ini.parse(data));
});
});
config['th105path'] = {path: (<AppLocal>th105.local).path};
await new Promise((resolve, reject) => {
fs.writeFile(config_file, ini.stringify(config), (error) => {
if (error) {
reject(error)
} else {
resolve()
}
})
});
} }
} }
...@@ -166,7 +182,7 @@ export class AppsService { ...@@ -166,7 +182,7 @@ export class AppsService {
windtype: '0' windtype: '0'
}; };
config['NekoProject21'] = Object.assign({}, default_config, config['NekoProject21']); config['NekoProject21'] = Object.assign({}, default_config, config['NekoProject21']);
config['NekoProject21']['HDD1FILE'] = path.win32.join((process.platform == 'win32' ? '' : 'Z:'), (<AppLocal>app.local).path, action.execute); config['NekoProject21']['HDD1FILE'] = path.win32.join(process.platform == 'win32' ? '' : 'Z:', (<AppLocal>app.local).path, action.execute);
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
fs.writeFile(config_file, ini.stringify(config), (error) => { fs.writeFile(config_file, ini.stringify(config), (error) => {
if (error) { if (error) {
......
...@@ -1416,9 +1416,11 @@ ...@@ -1416,9 +1416,11 @@
}, },
"references": { "references": {
"win32": [ "win32": [
"th105",
"th123-lang-zh-CN" "th123-lang-zh-CN"
], ],
"darwin": [ "darwin": [
"th105",
"th123-lang-zh-CN" "th123-lang-zh-CN"
] ]
}, },
...@@ -2318,7 +2320,9 @@ ...@@ -2318,7 +2320,9 @@
"main": { "main": {
"execute": "bin/wine.bin", "execute": "bin/wine.bin",
"args": [], "args": [],
"env": {} "env": {
"WINEDEBUG": "-all"
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment