Skip to content

Commit df61226

Browse files
author
stanislav
committed
fix select component
1 parent daf0cc3 commit df61226

21 files changed

+14820
-13624
lines changed

Diff for: README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ This is a basic Diablo 2 save editor for D2 and D2R. The parser uses the TXT dat
99
* Modify waypoints
1010
* Import items (~1000 different items to import)
1111
* Modify basic stats on items
12-
* Copy item between chars (drag between browser windows)
12+
* Copy item between chars
1313

1414
### How to use on your own mod
1515

16-
1. Clone this repo or download a zip.
17-
2. Extract your MPQ data to a public/data folder in the same directory as the repo. (the tool needs TXTs, strings, pallettes, and item dc6s to work properly)
18-
3. Run
16+
1. Install Node
17+
2. Clone this repo or download a zip.
18+
3. Extract your MPQ data to a public/data folder in the same directory as the repo. (the tool needs TXTs, strings, pallettes, and item dc6s to work properly)
19+
4. On first install or version updates, in the command prompt, run the following commands to install the editor:
20+
1921
```
2022
npm install
23+
```
24+
25+
5. Run the command below to start the editor
26+
27+
```
2128
npm run serve
2229
```
23-
4. Go to http://localhost:${PORT}/ verify everything works.
30+
31+
6. Go to http://localhost:8080/ with your web browser to access the editor.

Diff for: package-lock.json

+10,903-11,376
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+23-24
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,38 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"serve": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
6+
"serve": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint" ,
77
"build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint",
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
1111
"@dschu012/d2s": "^2.0.36",
12-
"@popperjs/core": "^2.11.6",
13-
"core-js": "^3.6.5",
12+
"@popperjs/core": "^2.11.8",
13+
"@vueform/multiselect": "^2.6.6",
14+
"core-js": "^3.35.0",
15+
"node-cache": "^5.1.2",
16+
"rollup-plugin-vue": "^6.0.0",
1417
"select2": "^4.1.0-rc.0",
1518
"tippy.js": "^6.3.7",
16-
"vue": "^3.2.45"
19+
"vue": "^3.4.13",
20+
"vue-tippy": "^6.4.1",
21+
"vuex": "^4.1.0"
1722
},
1823
"devDependencies": {
19-
"@rollup/plugin-json": "^4.1.0",
20-
"@rollup/plugin-node-resolve": "^13.3.0",
21-
"@rollup/plugin-typescript": "^8.3.2",
22-
"@vue/cli-plugin-babel": "~4.5.0",
23-
"@vue/cli-plugin-eslint": "~4.5.0",
24-
"@vue/cli-plugin-pwa": "^4.5.6",
25-
"@vue/cli-service": "~4.5.0",
26-
"@vue/compiler-sfc": "^3.0.0-0",
27-
"@web/rollup-plugin-copy": "^0.3.0",
28-
"@web/rollup-plugin-html": "^1.10.3",
29-
"babel-eslint": "^10.1.0",
30-
"eslint": "^6.7.2",
31-
"eslint-plugin-vue": "^7.0.0-0",
32-
"rollup": "^2.75.4",
33-
"rollup-plugin-html": "^0.2.1",
34-
"rollup-plugin-minify-html-literals": "^1.2.6",
35-
"rollup-plugin-postcss": "^4.0.2",
36-
"rollup-plugin-serve": "^1.1.0",
37-
"rollup-plugin-summary": "^1.4.3",
38-
"rollup-plugin-terser": "^7.0.2",
24+
"@babel/eslint-parser": "^7.23.3",
25+
"@vue/cli-plugin-babel": "~5.0.8",
26+
"@vue/cli-plugin-eslint": "~5.0.8",
27+
"@vue/cli-plugin-pwa": "^5.0.8",
28+
"@vue/cli-service": "~5.0.8",
29+
"@vue/compiler-sfc": "^3.4.13",
30+
"@web/rollup-plugin-copy": "^0.5.1",
31+
"@web/rollup-plugin-html": "^2.1.2",
32+
"dotenv-webpack": "^8.0.1",
33+
"eslint": "^8.56.0",
34+
"eslint-config-prettier": "^9.1.0",
35+
"eslint-plugin-prettier": "^5.1.3",
36+
"eslint-plugin-vue": "^9.20.1",
37+
"prettier": "^3.2.2",
3938
"serve-static": "^1.15.0"
4039
},
4140
"eslintConfig": {

Diff for: public/css/app.css

+164-119
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: public/css/theme.css

+449-370
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: public/d2/constants_96.bundle.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: public/d2/constants_99.bundle.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: public/img/icons/favicon-16x16.png

688 Bytes
Loading

Diff for: public/img/icons/favicon-32x32.png

1.45 KB
Loading

Diff for: public/img/icons/favicon.png

46.3 KB
Loading

Diff for: public/img/loading.gif

70.5 KB
Loading

Diff for: public/index.html

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</script>
1212
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/darkly/bootstrap.min.css"
1313
crossorigin="anonymous">
14-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
1514
<link href="css/app.css" rel="stylesheet" />
1615
<title>d2s - Example</title>
1716
</head>
@@ -25,13 +24,12 @@
2524
crossorigin="anonymous"></script>
2625
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
2726
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
28-
crossorigin="anonymous"></script>
29-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
30-
27+
crossorigin="anonymous"></script>
3128

32-
<!--
29+
3330
<script src="./d2/constants_96.bundle.min.js"></script>
3431
<script src="./d2/constants_99.bundle.min.js"></script>
32+
<!--
3533
<script src="https://github.com/dschu012/d2s/releases/latest/download/d2s.bundle.min.js"></script>
3634
-->
3735

Diff for: rollup.config.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// Import rollup plugins
2-
import html from "@web/rollup-plugin-html";
3-
import { copy } from "@web/rollup-plugin-copy";
4-
import resolve from "@rollup/plugin-node-resolve";
5-
import { terser } from "rollup-plugin-terser";
6-
import minifyHTML from "rollup-plugin-minify-html-literals";
7-
import summary from "rollup-plugin-summary";
8-
import json from "@rollup/plugin-json";
9-
import typescript from "@rollup/plugin-typescript";
10-
import serve from "rollup-plugin-serve";
11-
import postcss from "rollup-plugin-postcss";
2+
// import html from "@web/rollup-plugin-html";
3+
// import { copy } from "@web/rollup-plugin-copy";
4+
// import resolve from "@rollup/plugin-node-resolve";
5+
// import { terser } from "rollup-plugin-terser";
6+
// import minifyHTML from "rollup-plugin-minify-html-literals";
7+
// import summary from "rollup-plugin-summary";
8+
// import json from "@rollup/plugin-json";
9+
// import typescript from "@rollup/plugin-typescript";
10+
// import serve from "rollup-plugin-serve";
11+
// import postcss from "rollup-plugin-postcss";
12+
import vue from 'rollup-plugin-vue'
1213

1314

1415
export default {
1516
process: {},
1617
input: "",
17-
plugins: [
18-
],
18+
plugins: [vue(/* options */)],
1919
output: {
2020
dir: "",
2121
}

Diff for: src/Select2.js

-17
This file was deleted.

Diff for: src/components/App.vue

+19-11
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
<Item v-if="preview" :item="preview" clazz="item-edit"></Item>
4343
</div>
4444
<label for="Item">Item</label>
45-
<select class="form-control" v-model="previewModel" @change="previewItem" v-select="'#LoadItem'">
46-
<option v-for="item in itempack" :value="item" :key="item.key">{{item.key}}</option>
47-
</select>
45+
<multiselect v-model="previewModel" :options="itempack" label="key" valueProp="value" :searchable="true" @update:model-value="previewItem"/>
4846
</div>
4947
<div class="modal-footer">
5048
<input style="display:none;" type="file" name="d2iFile" @change="onItemFileChange" id="d2iFile">
@@ -440,12 +438,18 @@
440438
this.grid = JSON.parse(localStorage.getItem('grid'));
441439
}
442440
443-
d2s.setConstantData(96, constants96);
444-
d2s.setConstantData(97, constants96);
445-
d2s.setConstantData(98, constants96);
446-
d2s.setConstantData(99, constants99);
441+
// d2s.setConstantData(96, constants96);
442+
// d2s.setConstantData(97, constants96);
443+
// d2s.setConstantData(98, constants96);
444+
// d2s.setConstantData(99, constants99);
445+
// window.constants = constants99;
446+
447+
d2s.setConstantData(96, window.constants_96.constants);
448+
d2s.setConstantData(97, window.constants_96.constants);
449+
d2s.setConstantData(98, window.constants_96.constants);
450+
d2s.setConstantData(99, window.constants_99.constants);
451+
window.constants = window.constants_99.constants;
447452
448-
window.constants = constants99;
449453
this.addItemsPackBases(window.constants.weapon_items, "Weapons");
450454
this.addItemsPackBases(window.constants.armor_items, "Armor");
451455
},
@@ -658,8 +662,10 @@
658662
utils.removeMaxDurabilityFromRunwords(this.preview);
659663
},
660664
async previewItem(e) {
661-
let bytes = utils.b64ToArrayBuffer(this.previewModel.value);
662-
this.readItem(bytes, 0x63);
665+
if (this.previewModel) {
666+
let bytes = utils.b64ToArrayBuffer(this.previewModel.base64);
667+
this.readItem(bytes, 0x63);
668+
}
663669
},
664670
async onItemFileLoad(event) {
665671
this.readItem(event.target.result, 0x60);
@@ -980,7 +986,9 @@
980986
let category = item.categories[0];
981987
this.itempack.push({
982988
key: "./Bases/"+ categoryName +"/" + category + "/" + item.type_name + '.d2i',
983-
value: base64
989+
value: {
990+
base64: base64
991+
}
984992
});
985993
}
986994
},

Diff for: src/components/Select2.vue

-40
This file was deleted.

0 commit comments

Comments
 (0)