Skip to content

Commit

Permalink
use cache from patchs install
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed Feb 20, 2021
1 parent 536af21 commit 38524aa
Show file tree
Hide file tree
Showing 18 changed files with 485 additions and 210 deletions.
11 changes: 6 additions & 5 deletions src/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import Steam from "./modules/steam";
import Errors from "./helpers/errors";
import Cache from "./modules/cache";
import Api from "./api";
import Patch from "./modules/patch";

class App {

Expand All @@ -64,13 +65,13 @@ class App {
WINE = new Wine(this.PREFIX, this.COMMAND, this.FILE_SYSTEM, this.UPDATE);
MONITOR = new Monitor(this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM, this.WINE);
REPLACES = new Replaces(this.PREFIX, this.SYSTEM, this.FILE_SYSTEM, this.MONITOR);
PATCHES = new Patches(this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM);
MY_PATCHES = new MyPatches(this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM, this.PATCHES);
REGISTRY = new Registry(this.PREFIX, this.FILE_SYSTEM, this.REPLACES, this.WINE);
PATCHES = new Patches(this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM, this.REGISTRY);
MY_PATCHES = new MyPatches(this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM, this.PATCHES);
SNAPSHOT = new Snapshot(this.PREFIX, this.FILE_SYSTEM, this.REPLACES, this.WINE, this.SYSTEM);
DXVK = new Dxvk(this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT);
VKD3D_PROTON = new Vkd3dProton(this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT, this.SYSTEM);
MF = new MediaFoundation(this.COMMAND, this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT);
DXVK = new Dxvk(this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT, this.PATCHES, this.MY_PATCHES);
VKD3D_PROTON = new Vkd3dProton(this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT, this.SYSTEM, this.PATCHES, this.MY_PATCHES);
MF = new MediaFoundation(this.COMMAND, this.PREFIX, this.FILE_SYSTEM, this.NETWORK, this.WINE, this.SNAPSHOT, this.PATCHES, this.MY_PATCHES);
MANGO_HUD = new MangoHud(this.PREFIX, this.FILE_SYSTEM, this.NETWORK);
VK_BASALT = new VkBasalt(this.PREFIX, this.FILE_SYSTEM, this.NETWORK);
FIXES = new Fixes(this.PREFIX, this.WINE);
Expand Down
9 changes: 6 additions & 3 deletions src/src/components/Patches/ItemPatch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
<ul class="dropdown-menu" role="menu">
<PopupCommand v-if="!patch.created && patch" :patch="patch.patch" ref="popup"/>
<PopupPatch v-if="patch" :patch="patch.patch" ref="popup"/>
<PopupShare v-if="!shared && patch && !patch.is_shared" :item="patch"/>
<PopupApply v-if="shared && patch && !patch.is_install" :item="patch"/>
<PopupShare v-if="patch.created && !shared && patch && !patch.is_shared" :item="patch"/>
<PopupInstall v-if="patch.created && shared && patch && !patch.is_install" :item="patch"/>
<PopupApply v-if="patch.created && shared && patch && !patch.is_install" :item="patch"/>
<PopupRemove v-if="patch" :item="patch"/>
</ul>
</div>
Expand All @@ -70,18 +71,20 @@ import PopupRemove from "./PopupRemove";
import Collects from "../../helpers/collects";
import PopupShare from "./PopupShare";
import PopupApply from "./PopupApply";
import PopupInstall from "./PopupInstall";
export default {
name: "ItemPatch",
components: {
PopupInstall,
PopupApply,
PopupShare,
PopupPatch,
PopupCommand,
PopupRemove,
},
props: {
patch: Object,
patch: Object,
shared: Boolean,
},
data() {
Expand Down
6 changes: 3 additions & 3 deletions src/src/components/Patches/PopupApply.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<li>
<a @click="open" onclick="return false">
{{ $t('patches.install') }}
{{ $t('patches.install-and-apply') }}
</a>

<div :id="id" class="modal-demo">
Expand All @@ -16,7 +16,7 @@
<div class="form-group m-b-30 text-center">
<h4 class="m-t-20">
<b>
{{ $t('patches.install') }}?
{{ $t('patches.install-and-apply') }}?
</b>
</h4>
</div>
Expand Down Expand Up @@ -65,7 +65,7 @@ export default {
}).open();
},
save() {
this.$store.dispatch(action.get('patches').APPEND, { item: this.item, type: 'install' }).then(() => this.cancel());
this.$store.dispatch(action.get('patches').APPEND, { item: this.item, type: 'install-and-apply' }).then(() => this.cancel());
},
cancel() {
return Custombox.modal.close();
Expand Down
4 changes: 2 additions & 2 deletions src/src/components/Patches/PopupCommand.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export default {
return {
action: 'build',
override: 'native',
patch_arch: this.patch.getPatch(),
arch: this.patch.getPatch(),
patch_arch: this.patch.getArch(),
arch: this.patch.getArch(),
registry: true,
arguments: '',
};
Expand Down
101 changes: 101 additions & 0 deletions src/src/components/Patches/PopupInstall.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<template>
<li>
<a @click="open" onclick="return false">
{{ $t('patches.install') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
<span>&times;</span><span class="sr-only">{{ $t('labels.close') }}</span>
</button>
<h4 class="custom-modal-title">
{{ item.name }} {{ item.version }} {{ getArch() }}
</h4>
<div class="custom-modal-text text-left">
<form role="form">
<div class="form-group m-b-30 text-center">
<h4 class="m-t-20">
<b>
{{ $t('patches.install') }}?
</b>
</h4>
</div>

<div class="form-group text-center m-t-40">
<button type="button" class="btn btn-default waves-effect waves-light" @click="save">
{{ $t('labels.yes') }}
</button>
<button type="button" class="btn btn-danger waves-effect waves-light m-l-10"
@click="cancel">
{{ $t('labels.cancel') }}
</button>
</div>
</form>
</div>
</div>

</li>
</template>

<script>
import action from '../../store/action';
import Collects from "../../helpers/collects";
export default {
components: {},
name: "PopupInstall",
props: {
item: Object,
},
data() {
return {
id: action.id,
};
},
methods: {
open() {
new Custombox.modal({
content: {
effect: 'fadein',
target: `#${this.id}`,
},
loader: {
active: false,
},
}).open();
},
save() {
this.$store.dispatch(action.get('patches').APPEND, { item: this.item, type: 'install' }).then(() => this.cancel());
},
cancel() {
return Custombox.modal.close();
},
getArch() {
return Collects.arch[this.item.arch];
},
},
computed: {}
}
</script>

<style lang="less" scoped>
.modal-demo {
width: 400px;
}
.custom-modal-text {
position: relative;
form {
position: relative;
}
}
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
1 change: 1 addition & 0 deletions src/src/components/Prefix/PopupEditPrefix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export default {
name: 'Media Foundation',
description: this.$t('prefix.form-prefix.mf-desc'),
type: 'bool',
relations: 'arch64:wine.arch',
required: false,
},
'libs.mangohud.install': {
Expand Down
9 changes: 5 additions & 4 deletions src/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export default {
'run-build': 'Run build?',
},
patches: {
'add': 'Add to "My patches"',
'install': 'Add to "Patches"',
'not-found': 'No patches found',
'not-found-desc': 'This is a common repository of ready-made patches between different WL assemblies that are stored in the folder : <br><code>~/.local/share/wine-launcher</code><br>Add patches here to create a collection of frequently used patches.',
'add': 'Add to "My patches"',
'install': 'Add to "Patches"',
'install-and-apply': 'Apply to "Patches"',
'not-found': 'No patches found',
'not-found-desc': 'This is a common repository of ready-made patches between different WL assemblies that are stored in the folder : <br><code>~/.local/share/wine-launcher</code><br>Add patches here to create a collection of frequently used patches.',
},
game: {
'total-time': 'Total time',
Expand Down
9 changes: 5 additions & 4 deletions src/src/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export default {
'run-build': 'Запустить сборку?',
},
patches: {
'add': 'Добавить в "Мои патчи"',
'install': 'Добавить в "Патчи"',
'not-found': 'Патчи не найдены',
'not-found-desc': 'Это общее хранилище готовых патчей между разными сборками WL которые хранятся в папке: <br><code>~/.local/share/wine-launcher</code><br>Добавляйте сюда патчи, чтобы создать коллекцию часто используемых патчей.',
'add': 'Добавить в "Мои патчи"',
'install': 'Добавить в "Патчи"',
'install-and-apply': 'Применить в "Патчи"',
'not-found': 'Патчи не найдены',
'not-found-desc': 'Это общее хранилище готовых патчей между разными сборками WL которые хранятся в папке: <br><code>~/.local/share/wine-launcher</code><br>Добавляйте сюда патчи, чтобы создать коллекцию часто используемых патчей.',
},
game: {
'total-time': 'Время в игре',
Expand Down
Loading

0 comments on commit 38524aa

Please sign in to comment.