Repository navigation
Expand file tree
/
Copy pathcubemapModal.js
More file actions
57 lines (51 loc) · 1.95 KB
/
Copy pathcubemapModal.js
File metadata and controls
57 lines (51 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'use strict'
const customTitlebar = require('custom-electron-titlebar');
const { ipcRenderer } = require('electron');
let titlebar;
let leftSide;
let rightSide;
let frontSide;
let backSide;
let topSide;
let bottomSide
if(process.platform === "darwin") {
titlebar = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#212121'),
maximizable: false,
shadow: false,
titleHorizontalAlignment: "center",
enableMnemonics: true,
icon: "resources/icons/icon.png"
})
} else {
titlebar = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#000000'),
maximizable: false,
shadow: true,
titleHorizontalAlignment: "left",
enableMnemonics: true,
icon: "resources/icons/icon.png"
})
}
function setPath(element) {
let path = ipcRenderer.sendSync('open-file-dialog');
if(path !== undefined) {
window[element.id + 'Side'] = path;
$("label[for='" + $(element).attr('id') + "']").html('<p>' + element.id.charAt(0).toUpperCase() + element.id.slice(1) + ' side ' + '<i class="fas fa-check ml-2" style="color: green;"></i></p>');
if (window.leftSide !== undefined && window.rightSide !== undefined && window.frontSide !== undefined && window.backSide !== undefined && window.topSide !== undefined && window.bottomSide !== undefined) {
$('#open-btn').attr('disabled', false);
}
} else {
$("label[for='" + $(element).attr('id') + "']").html('<p>' + element.id.charAt(0).toUpperCase() + element.id.slice(1) + ' side ' + '<i class="fas fa-times ml-2" style="color: red;"></i></p>');
}
}
function openCubemap() {
let sides = [];
sides.push(window.leftSide);
sides.push(window.frontSide);
sides.push(window.rightSide);
sides.push(window.backSide);
sides.push(window.topSide);
sides.push(window.bottomSide);
ipcRenderer.send('close-cubemap-modal', sides);
}