western-world 3.0.708 → 3.0.709
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/demo-templates/index.html +0 -101
package/package.json
CHANGED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
|
6
|
-
<!-- <script src="https://unpkg.com/western-components@latest"></script> -->
|
|
7
|
-
<script src="http://localhost:9001/index.js"></script>
|
|
8
|
-
</head>
|
|
9
|
-
|
|
10
|
-
<body>
|
|
11
|
-
<button id="buy-new-firm-68">buy new firm 68</button>
|
|
12
|
-
<button id="update-firm-10">update firm 10</button>
|
|
13
|
-
<button id="update-all-firms">all firms</button>
|
|
14
|
-
|
|
15
|
-
<div style="width: calc(9087px / 3); height: calc(3918px / 3);">
|
|
16
|
-
<western-world></western-world>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<script src="index.js"></script>
|
|
20
|
-
<script>
|
|
21
|
-
fetch('http://localhost/api/admin/default-clasic-game-template')
|
|
22
|
-
.then((response) => response.json())
|
|
23
|
-
.then(({ CELLS }) => {
|
|
24
|
-
const westernWorldEl = document.querySelector('western-world');
|
|
25
|
-
const GAME_MOCK = {
|
|
26
|
-
players: { 1024: { firms: [10] } },
|
|
27
|
-
players_order: ['1024'],
|
|
28
|
-
stocks: { 10: { stars: 0 }, 68: { stars: 3 } },
|
|
29
|
-
};
|
|
30
|
-
const ALL_FIRMS = [
|
|
31
|
-
117, 65, 56, 130, 128, 11, 84, 68, 78, 29, 49, 127, 119, 116, 114, 67, 63, 61, 59, 58, 54, 53, 46, 38, 10,
|
|
32
|
-
];
|
|
33
|
-
const GAME_MOCK_ALL_FIRMS = {
|
|
34
|
-
players: { 1024: { firms: ALL_FIRMS } },
|
|
35
|
-
players_order: ['1024'],
|
|
36
|
-
stocks: ALL_FIRMS.reduce((previousValue, firmId) => ({ ...previousValue, [firmId]: { stars: 3 } }), {}),
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
westernWorldEl.others = [
|
|
40
|
-
{ fileName: 'colony-background', x: 30, y: 135, size: 1045, onTopOfCells: false },
|
|
41
|
-
{ fileName: 'colony-arrow-clon-dike', x: 485, y: 750, size: 120, onTopOfCells: true },
|
|
42
|
-
{ fileName: 'colony-fish', x: 580, y: 200, size: 50, onTopOfCells: true },
|
|
43
|
-
{ fileName: 'colony-waves', x: 700, y: 200, size: 150, onTopOfCells: true },
|
|
44
|
-
{ fileName: 'start', x: 1420, y: 880, size: 450, onTopOfCells: false },
|
|
45
|
-
{ fileName: 'desert', x: 160, y: 1050, size: 700, onTopOfCells: false },
|
|
46
|
-
{ fileName: 'forest', x: 1045, y: 115, size: 490, onTopOfCells: false },
|
|
47
|
-
{ fileName: 'industrial-progress', x: 170, y: -520, size: 1000, onTopOfCells: false },
|
|
48
|
-
{ fileName: 'tree-1', x: 890, y: 280, size: 45, onTopOfCells: false },
|
|
49
|
-
{ fileName: 'tree-2', x: 860, y: 290, size: 60, onTopOfCells: false },
|
|
50
|
-
{ fileName: 'tree-1', x: 870, y: 210, size: 35, onTopOfCells: false },
|
|
51
|
-
{ fileName: 'tree-2', x: 840, y: 190, size: 35, onTopOfCells: false },
|
|
52
|
-
{ fileName: 'cactus-1', x: 60, y: 1150, size: 100, onTopOfCells: false },
|
|
53
|
-
{ fileName: 'cactus-2', x: 660, y: 1090, size: 70, onTopOfCells: false },
|
|
54
|
-
{ fileName: 'skul', x: 80, y: 1250, size: 80, onTopOfCells: false },
|
|
55
|
-
{ fileName: 'western-main-title', x: 960, y: 50, size: 1300, onTopOfCells: false },
|
|
56
|
-
|
|
57
|
-
{ fileName: 'colony-background-top-elements-leaves', x: 317, y: 360, size: 370, onTopOfCells: true },
|
|
58
|
-
{ fileName: 'colony-arrow-travel-agency-port-yankees', x: 440, y: 145, size: 160, onTopOfCells: true },
|
|
59
|
-
{ fileName: 'colony-arrow-mutiny-on-the-ship-desert-island', x: 665, y: 508, size: 190, onTopOfCells: true },
|
|
60
|
-
{ fileName: 'colony-arrow-pirates', x: 780, y: 320, size: 170, onTopOfCells: true },
|
|
61
|
-
];
|
|
62
|
-
westernWorldEl.othersGenerate = [
|
|
63
|
-
{ arrowCoordinates: [{ x: 1000, y: 1500 }, { x: 5000, y: 1500 }, { x: 7000, y: 6000 }], key: 'test-arrow' },
|
|
64
|
-
];
|
|
65
|
-
westernWorldEl.allCells = CELLS;
|
|
66
|
-
westernWorldEl.PADDING_LEFT = 500;
|
|
67
|
-
westernWorldEl.PADDING_RIGHT = 500;
|
|
68
|
-
westernWorldEl.PADDING_TOP = 500;
|
|
69
|
-
westernWorldEl.PADDING_BOTTOM = 500;
|
|
70
|
-
|
|
71
|
-
// westernWorldEl.PADDING_LEFT = 0;
|
|
72
|
-
// westernWorldEl.PADDING_RIGHT = 0;
|
|
73
|
-
// westernWorldEl.PADDING_TOP = 0;
|
|
74
|
-
// westernWorldEl.PADDING_BOTTOM = 0;
|
|
75
|
-
westernWorldEl.showWesternBackground = true;
|
|
76
|
-
westernWorldEl.SIZE_X_QUALITY = 3;
|
|
77
|
-
westernWorldEl.language = 'en';
|
|
78
|
-
westernWorldEl.playersIconMap = window['western-utils'].getPlayersIconsMap({ game: GAME_MOCK });
|
|
79
|
-
|
|
80
|
-
westernWorldEl.game = GAME_MOCK;
|
|
81
|
-
|
|
82
|
-
document.querySelector('#buy-new-firm-68').addEventListener('click', () => {
|
|
83
|
-
const NEW_GAME_MOCK = JSON.parse(JSON.stringify(GAME_MOCK));
|
|
84
|
-
NEW_GAME_MOCK.players['1024'].firms.push(68);
|
|
85
|
-
westernWorldEl.game = NEW_GAME_MOCK;
|
|
86
|
-
});
|
|
87
|
-
document.querySelector('#update-firm-10').addEventListener('click', () => {
|
|
88
|
-
const NEW_GAME_MOCK = JSON.parse(JSON.stringify(GAME_MOCK));
|
|
89
|
-
NEW_GAME_MOCK.stocks['10'].stars = 1;
|
|
90
|
-
westernWorldEl.game = NEW_GAME_MOCK;
|
|
91
|
-
});
|
|
92
|
-
document.querySelector('#update-all-firms').addEventListener('click', () => {
|
|
93
|
-
westernWorldEl.game = GAME_MOCK_ALL_FIRMS;
|
|
94
|
-
});
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</script>
|
|
101
|
-
</body>
|