From 48938fc99b5c520f6a5af20c44ced8c6c6f29fa9 Mon Sep 17 00:00:00 2001 From: LordTocs Date: Sun, 30 May 2021 00:30:26 -0400 Subject: [PATCH 1/9] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d862c30..2c8d7ac1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "castmate", "version": "0.0.3", "private": "true", - "description": "", + "description": "CastMate is a broadcaster tool that allows Twitch viewers to interact with a broadcasters stream components through Chat Commands, Channel Point rewards, and more.", "author": "LordTocs & FitzBro", "scripts": { "serve": "vue-cli-service serve", From e0f1a24f666de49a9d65177ff65445ec8928e02a Mon Sep 17 00:00:00 2001 From: LordTocs Date: Mon, 31 May 2021 17:09:11 -0400 Subject: [PATCH 2/9] Add dialogs for adding triggers and sequences --- src/components/dialogs/NamedItemModal.vue | 68 +++++++++++++++ src/components/profiles/NewProfileModal.vue | 85 ------------------ src/views/Profiles.vue | 95 ++++++++++++++++++--- 3 files changed, 149 insertions(+), 99 deletions(-) create mode 100644 src/components/dialogs/NamedItemModal.vue delete mode 100644 src/components/profiles/NewProfileModal.vue diff --git a/src/components/dialogs/NamedItemModal.vue b/src/components/dialogs/NamedItemModal.vue new file mode 100644 index 00000000..8df34640 --- /dev/null +++ b/src/components/dialogs/NamedItemModal.vue @@ -0,0 +1,68 @@ + + + + + \ No newline at end of file diff --git a/src/components/profiles/NewProfileModal.vue b/src/components/profiles/NewProfileModal.vue deleted file mode 100644 index 1a22e52e..00000000 --- a/src/components/profiles/NewProfileModal.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/Profiles.vue b/src/views/Profiles.vue index cd8e43d4..7149fc48 100644 --- a/src/views/Profiles.vue +++ b/src/views/Profiles.vue @@ -69,9 +69,48 @@ - + + + + - + + + + mdi-plus +
Sequence
+
+ + mdi-plus +
Trigger
+
+ + mdi-plus +
Profile
+
+
+ + @@ -91,22 +130,21 @@ import fs from "fs"; import path from "path"; import YAML from "yaml"; -import NewProfileModal from "../components/profiles/NewProfileModal.vue"; import { mapGetters } from "vuex"; +import NamedItemModal from "../components/dialogs/NamedItemModal.vue"; export default { components: { - NewProfileModal, + NamedItemModal, }, computed: { ...mapGetters("ipc", ["paths"]), }, data() { return { - newProfileName: null, - profilePop: false, profiles: [], triggers: [], sequences: [], + fabOpen: false, }; }, methods: { @@ -137,9 +175,7 @@ export default { name: path.basename(f, ".yaml"), })); }, - async createProfile() { - this.profilePop = false; - + async createNewProfile(name) { let newYaml = YAML.stringify({ triggers: {}, variables: {}, @@ -147,10 +183,31 @@ export default { }); await fs.promises.writeFile( - path.join( - this.paths.userFolder, - `profiles/${this.newProfileName}.yaml` - ), + path.join(this.paths.userFolder, `profiles/${name}.yaml`), + newYaml, + "utf-8" + ); + + await this.getFiles(); + }, + + async createNewSequence(name) { + let newYaml = YAML.stringify([]); + + await fs.promises.writeFile( + path.join(this.paths.userFolder, `sequences/${name}.yaml`), + newYaml, + "utf-8" + ); + + await this.getFiles(); + }, + + async createNewTriggersFile(name) { + let newYaml = YAML.stringify({}); + + await fs.promises.writeFile( + path.join(this.paths.userFolder, `triggers/${name}.yaml`), newYaml, "utf-8" ); @@ -176,4 +233,14 @@ export default { position: absolute; margin: 0 0 16px 16px; } + +.fab-label { + position: absolute; + right: 50px; + background-color: rgba(0, 0, 0, 0.5); + padding: 10px; + box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), + 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12); + border-radius: 2px; +} \ No newline at end of file From 00ab6f55e4cec3f8d557d029a24bc94d65a013ae Mon Sep 17 00:00:00 2001 From: LordTocs Date: Fri, 4 Jun 2021 10:22:52 -0400 Subject: [PATCH 3/9] Major Refactor, clean up UI code. Fix imports to be a pseudo-action --- .../{profiles => actions}/ActionEditor.vue | 0 .../AddActionPopover.vue | 0 src/components/commands/CommandCard.vue | 30 +++ src/components/commands/CommandEditor.vue | 35 ++++ src/components/data/DataView.vue | 1 + src/components/profiles/CommandEditor.vue | 54 ----- src/components/profiles/RewardsEditor.vue | 2 +- src/components/profiles/TriggerEditor.vue | 189 ------------------ src/components/profiles/TriggersEditor.vue | 2 +- .../AddRewardPopover.vue | 0 .../SequenceEditor.vue} | 10 +- .../SequenceItem.vue} | 59 ++---- .../triggers/MultiCommandTrigger.vue | 106 ++++++++++ .../triggers/SingleCommandTrigger.vue | 35 ++++ src/components/triggers/TriggerEditor.vue | 51 +++++ src/components/triggers/TriggerImports.vue | 46 +++++ src/store/ipc.js | 7 + src/views/Plugin.vue | 1 - src/views/SequenceEditor.vue | 8 +- src/views/TriggersEditor.vue | 39 +++- 20 files changed, 372 insertions(+), 303 deletions(-) rename src/components/{profiles => actions}/ActionEditor.vue (100%) rename src/components/{profiles => actions}/AddActionPopover.vue (100%) create mode 100644 src/components/commands/CommandCard.vue create mode 100644 src/components/commands/CommandEditor.vue delete mode 100644 src/components/profiles/CommandEditor.vue delete mode 100644 src/components/profiles/TriggerEditor.vue rename src/components/{profiles => rewards}/AddRewardPopover.vue (100%) rename src/components/{profiles/ActionsListEditor.vue => sequences/SequenceEditor.vue} (84%) rename src/components/{profiles/ActionListItem.vue => sequences/SequenceItem.vue} (58%) create mode 100644 src/components/triggers/MultiCommandTrigger.vue create mode 100644 src/components/triggers/SingleCommandTrigger.vue create mode 100644 src/components/triggers/TriggerEditor.vue create mode 100644 src/components/triggers/TriggerImports.vue diff --git a/src/components/profiles/ActionEditor.vue b/src/components/actions/ActionEditor.vue similarity index 100% rename from src/components/profiles/ActionEditor.vue rename to src/components/actions/ActionEditor.vue diff --git a/src/components/profiles/AddActionPopover.vue b/src/components/actions/AddActionPopover.vue similarity index 100% rename from src/components/profiles/AddActionPopover.vue rename to src/components/actions/AddActionPopover.vue diff --git a/src/components/commands/CommandCard.vue b/src/components/commands/CommandCard.vue new file mode 100644 index 00000000..4509ed18 --- /dev/null +++ b/src/components/commands/CommandCard.vue @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/src/components/commands/CommandEditor.vue b/src/components/commands/CommandEditor.vue new file mode 100644 index 00000000..08cee78a --- /dev/null +++ b/src/components/commands/CommandEditor.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/src/components/data/DataView.vue b/src/components/data/DataView.vue index 323c7d9e..7aa5e305 100644 --- a/src/components/data/DataView.vue +++ b/src/components/data/DataView.vue @@ -32,6 +32,7 @@ export default { props: { schema: {}, value: {}, + label: {} }, }; diff --git a/src/components/profiles/CommandEditor.vue b/src/components/profiles/CommandEditor.vue deleted file mode 100644 index b9a88dd6..00000000 --- a/src/components/profiles/CommandEditor.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/profiles/RewardsEditor.vue b/src/components/profiles/RewardsEditor.vue index b1969a2e..542b35ed 100644 --- a/src/components/profiles/RewardsEditor.vue +++ b/src/components/profiles/RewardsEditor.vue @@ -34,7 +34,7 @@ import { mapGetters } from "vuex"; //import RewardSelector from "@/components/data/RewardSelector.vue"; import RewardCard from "../rewards/RewardCard.vue"; -import AddRewardPopover from "./AddRewardPopover.vue"; +import AddRewardPopover from "../rewards/AddRewardPopover.vue"; export default { components: { RewardCard, diff --git a/src/components/profiles/TriggerEditor.vue b/src/components/profiles/TriggerEditor.vue deleted file mode 100644 index c5b1bf25..00000000 --- a/src/components/profiles/TriggerEditor.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/profiles/TriggersEditor.vue b/src/components/profiles/TriggersEditor.vue index c5ff78f6..e2e66176 100644 --- a/src/components/profiles/TriggersEditor.vue +++ b/src/components/profiles/TriggersEditor.vue @@ -14,7 +14,7 @@ diff --git a/src/components/profiles/ActionListItem.vue b/src/components/sequences/SequenceItem.vue similarity index 58% rename from src/components/profiles/ActionListItem.vue rename to src/components/sequences/SequenceItem.vue index 59449221..d9f22407 100644 --- a/src/components/profiles/ActionListItem.vue +++ b/src/components/sequences/SequenceItem.vue @@ -2,31 +2,29 @@
- {{ firstAction.name }} + {{ actionDefinition.name }}
- - Import - + Import @@ -41,7 +39,7 @@ \ No newline at end of file diff --git a/src/components/triggers/SingleCommandTrigger.vue b/src/components/triggers/SingleCommandTrigger.vue new file mode 100644 index 00000000..06e91236 --- /dev/null +++ b/src/components/triggers/SingleCommandTrigger.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/src/components/triggers/TriggerEditor.vue b/src/components/triggers/TriggerEditor.vue new file mode 100644 index 00000000..41d3ab5b --- /dev/null +++ b/src/components/triggers/TriggerEditor.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/src/components/triggers/TriggerImports.vue b/src/components/triggers/TriggerImports.vue new file mode 100644 index 00000000..ec2089e8 --- /dev/null +++ b/src/components/triggers/TriggerImports.vue @@ -0,0 +1,46 @@ + + + + + \ No newline at end of file diff --git a/src/store/ipc.js b/src/store/ipc.js index 2fb401a1..090f1aac 100644 --- a/src/store/ipc.js +++ b/src/store/ipc.js @@ -32,6 +32,7 @@ export default { { Object.assign(result, plugin.actions) } + //Special Injected Actions, these don't map to a plugin action. result.delay = { name: "Delay (After)", data: { type: "Number" }, @@ -42,6 +43,12 @@ export default { data: { type: "Number" }, description: "Puts a delay before the current action", }; + result.import = { + name: "Import Sequence", + data: { type: "String" }, + description: "Imports a sequence.", + color: "#7C4275" + } result.timestamp = { name: "Timestamp", data: { type: "Number" }, diff --git a/src/views/Plugin.vue b/src/views/Plugin.vue index 1333499e..8f8e3f8c 100644 --- a/src/views/Plugin.vue +++ b/src/views/Plugin.vue @@ -72,7 +72,6 @@ import { mapGetters } from "vuex"; import DataInput from "../components/data/DataInput.vue"; import Level from "@/components/layout/Level.vue"; import fs from "fs"; - import YAML from "yaml"; export default { diff --git a/src/views/SequenceEditor.vue b/src/views/SequenceEditor.vue index d39fa67c..987a2b4b 100644 --- a/src/views/SequenceEditor.vue +++ b/src/views/SequenceEditor.vue @@ -2,7 +2,7 @@ - + @@ -31,8 +31,8 @@ diff --git a/src/views/Profiles.vue b/src/views/Profiles.vue index 7149fc48..9b6554fa 100644 --- a/src/views/Profiles.vue +++ b/src/views/Profiles.vue @@ -26,19 +26,19 @@ - Triggers + Command Files -