Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Added browse button when the game is running
Browse files Browse the repository at this point in the history
  • Loading branch information
ZudoB committed Feb 14, 2019
1 parent 0f2ad5c commit c04cc6c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
"running_cover": {
"title_running": "DDLC is running",
"title_crashed": "Something went wrong",
"button_browse": "Open Game Folder",
"button_close": "OK",
"description_running": "Close the game to make changes to your mods.",
"install_missing": "The install could not be found.",
Expand Down
6 changes: 4 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function launchInstall(folderName): void {
display: true,
dismissable: false,
title: lang.translate("main.running_cover.title_running"),
description: lang.translate("main.running_cover.description_running")
description: lang.translate("main.running_cover.description_running"),
folder_path: joinPath(Config.readConfigValue("installFolder"), "installs", folderName)
});
InstallLauncher.launchInstall(folderName, richPresence).then(() => {
appWindow.restore(); // show DDMM again
Expand All @@ -114,7 +115,8 @@ function launchInstall(folderName): void {
display: true,
dismissable: true,
title: lang.translate("main.running_cover.title_crashed"),
description: err
description: err,
folder_path: joinPath(Config.readConfigValue("installFolder"), "installs", folderName)
});
});
}
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<div class="cover" v-if="running_cover.display" :style="{'background-image': backgroundImageStyle}">
<h1>{{running_cover.title}}</h1>
<p>{{running_cover.description}}</p>
<template v-if="!running_cover.dismissable">
<br>
<p><button class="primary" @click="showFile(running_cover.folder_path)"><i class="fas fa-folder fa-fw"></i> {{_("main.running_cover.button_browse")}}</button></p>
</template>
<br>
<p><button v-if="running_cover.dismissable" @click="running_cover.display = false" class="primary"><i class="fas fa-times fa-fw"></i> {{_("main.running_cover.button_close")}}</button></p>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const app = new Vue({
"windowMinimise": ddmm.window.minimise,
"openURL": ddmm.app.openURL,
"downloadUpdate": ddmm.app.downloadUpdate,
"showFile": ddmm.app.showFile,
"setBackground": function (image) {
this.background_image = image;
},
Expand Down Expand Up @@ -154,6 +155,7 @@ ddmm.on("running cover", cover => {
app.running_cover.title = cover.title;
app.running_cover.description = cover.description;
app.running_cover.dismissable = cover.dismissable;
app.running_cover.folder_path = cover.folder_path;
});

ddmm.on("error", error => {
Expand Down

0 comments on commit c04cc6c

Please sign in to comment.