Commit 35525669 authored by nanahira's avatar nanahira

sokuroll

parent aea7f2fe
......@@ -40,6 +40,8 @@
<i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行</span></button>
<button *ngIf="currentApp.actions.get('network')" [disabled]="!appsService.allReady(currentApp)" (click)="runApp(currentApp,'network')" type="button" class="btn btn-primary btn-sm">
<i class="fa fa-play" aria-hidden="true"></i> <span>运行 (联机版)</span></button>
<button *ngIf="currentApp.runnable() && currentApp.id === 'th123' && currentApp.references.get('sokuroll').isReady()" (click)="runRoll(currentApp)" [disabled]="!appsService.allReady(currentApp)" type="button" class="btn btn-primary btn-sm">
<i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行 (Roll)</span></button>
<button i18n *ngIf="currentApp.runnable() && currentApp.actions.get('custom')" [disabled]="!appsService.allReady(currentApp)" (click)="custom(currentApp)" type="button" class="btn btn-secondary btn-sm">设置</button>
......
......@@ -203,6 +203,11 @@ export class AppDetailComponent implements OnInit, OnChanges {
this.appsService.runApp(app, 'custom');
}
async runRoll(app: App) {
await this.appsService.runApp(app, 'roll_main');
await this.appsService.runApp(app, 'roll');
}
async importGame(targetApp: App, option: InstallOption, referencesInstall: { [id: string]: boolean }) {
$('#import-modal').modal('hide');
let dir = path.dirname(this.import_path);
......
......@@ -767,19 +767,22 @@ export class AppsService {
const handle = await app.spawnApp(children, action_name);
handle.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
console.log(`${app.id} ${action_name} stdout: ${data}`);
});
handle.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
console.log(`${app.id} ${action_name} stderr: ${data}`);
});
handle.on('close', (code) => {
console.log(`child process exited with code ${code}`);
remote.getCurrentWindow().restore();
console.log(`${app.id} ${action_name}: child process exited with code ${code}`);
if (action_name !== 'roll') {
remote.getCurrentWindow().restore();
}
});
remote.getCurrentWindow().minimize();
if (action_name !== 'roll') {
remote.getCurrentWindow().minimize();
}
}
browse(app: App) {
......
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