diff --git a/package.json b/package.json index 4346161cc..416d678f3 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "uuid": "^3.3.3", "vue": "^2.6.10", "vue-class-component": "^7.2.3", + "vue-color": "^2.7.1", "vue-golden-layout": "^2.0.8", "vue-property-decorator": "^8.3.0", "vue-smooth-dnd": "^0.8.1", diff --git a/src/application/index.js b/src/application/index.js index a7cad06bc..19b3a8beb 100644 --- a/src/application/index.js +++ b/src/application/index.js @@ -169,6 +169,14 @@ export default class ModV { this.store.dispatch("windows/createWindow"); }); + ipcRenderer.on("input-update", (event, { moduleId, prop, data }) => { + this.store.dispatch("modules/updateProp", { + moduleId, + prop, + data + }); + }); + this.ready = true; ipcRenderer.send("modv-ready"); ipcRenderer.send("get-media-manager-state"); diff --git a/src/background.js b/src/background.js index 9c6d01371..1a463b08d 100644 --- a/src/background.js +++ b/src/background.js @@ -27,6 +27,23 @@ let projectNames = ["default"]; let currentProject = "default"; const windowPrefs = { + colorPicker: { + devPath: "colorPicker", + prodPath: "colorPicker.html", + options: { + webPreferences: { + nodeIntegration: true + }, + transparent: true, + frame: false, + alwaysOnTop: true, + resizable: false, + skipTaskbar: true, + fullscreenable: false + }, + unique: true + }, + mainWindow: { devPath: "", prodPath: "index.html", diff --git a/src/components/Control.vue b/src/components/Control.vue index 8dd6e8bcd..d5e4aa78e 100644 --- a/src/components/Control.vue +++ b/src/components/Control.vue @@ -32,7 +32,7 @@
- +
@@ -60,6 +60,7 @@ import TweenControl from "./Controls/TweenControl"; import PaletteControl from "./Controls/PaletteControl"; import TextureControl from "./Controls/TextureControl"; import FontControl from "./Controls/FontControl"; +import ColorControl from "./Controls/ColorControl"; import hasLink from "./mixins/has-input-link"; import inputIsFocused from "./mixins/input-is-focused"; @@ -74,7 +75,8 @@ export default { TweenControl, PaletteControl, TextureControl, - FontControl + FontControl, + ColorControl }, data() { diff --git a/src/components/Controls/ColorControl.vue b/src/components/Controls/ColorControl.vue new file mode 100644 index 000000000..efba47c7d --- /dev/null +++ b/src/components/Controls/ColorControl.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/subpages/color-picker/App.vue b/src/subpages/color-picker/App.vue new file mode 100644 index 000000000..1f3c1b734 --- /dev/null +++ b/src/subpages/color-picker/App.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/subpages/color-picker/main.js b/src/subpages/color-picker/main.js new file mode 100644 index 000000000..222b7c321 --- /dev/null +++ b/src/subpages/color-picker/main.js @@ -0,0 +1,7 @@ +import Vue from "vue"; + +import App from "./App.vue"; + +window.Vue = new Vue({ + render: h => h(App) +}).$mount("#app"); diff --git a/vue.config.js b/vue.config.js index e70228a36..928226d02 100644 --- a/vue.config.js +++ b/vue.config.js @@ -9,7 +9,8 @@ const publishingOptions = { module.exports = { // https://cli.vuejs.org/config/#pages pages: { - index: "src/main.js" + index: "src/main.js", + colorPicker: "src/subpages/color-picker/main.js" }, configureWebpack: { diff --git a/yarn.lock b/yarn.lock index 88bdef9d9..f1da1e97a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2792,6 +2792,11 @@ circular-json@^0.3.1: resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== +clamp@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/clamp/-/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634" + integrity sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ= + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -7434,6 +7439,11 @@ lodash.merge@^4.6.1: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.throttle@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" + integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= + lodash.transform@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.transform/-/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0" @@ -7614,6 +7624,11 @@ matcher@^3.0.0: dependencies: escape-string-regexp "^4.0.0" +material-colors@^1.0.0: + version "1.2.6" + resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46" + integrity sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg== + mathjs-expression-parser@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/mathjs-expression-parser/-/mathjs-expression-parser-1.0.2.tgz#7f59984cad711d766a1032f0900b01755c5cbc81" @@ -11682,6 +11697,11 @@ tiny-relative-date@^1.3.0: resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== +tinycolor2@^1.1.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" + integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -12288,6 +12308,16 @@ vue-cli-plugin-electron-builder@^1.4.2: webpack-chain "^5.0.0" yargs "^14.0.0" +vue-color@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/vue-color/-/vue-color-2.7.1.tgz#ca035109ea0010f0d60b889b97d63d37ac712f2d" + integrity sha512-u3yl46B2eEej9zfAOIRRSphX1QfeNQzMwO82EIA+aoi0AKX3o1KcfsmMzm4BFkkj2ukCxLVfQ41k7g1gSI7SlA== + dependencies: + clamp "^1.0.1" + lodash.throttle "^4.0.0" + material-colors "^1.0.0" + tinycolor2 "^1.1.2" + vue-eslint-parser@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1"