diff --git a/README.md b/README.md index b3ee9529..f290f823 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This bundle doesn't come with any graphics, you will need to create them yoursel ## Installation -You will need [Node.js](https://nodejs.org) (10.x LTS tested) and [git](https://git-scm.com/) installed to install NodeCG, then see the [NodeCG documentation](http://nodecg.dev/) on how to install that. I also suggest installing `nodecg-cli`; information on that is also on the documentation just linked. +You will need [Node.js](https://nodejs.org) (14.x LTS tested) and [git](https://git-scm.com/) installed to install NodeCG, then see the [NodeCG documentation](http://nodecg.dev/) on how to install that. I also suggest installing `nodecg-cli`; information on that is also on the documentation just linked. - `nodecg install speedcontrol/nodecg-speedcontrol` to install the latest version of nodecg-speedcontrol @@ -78,12 +78,12 @@ Once you have done the above, make sure to turn the auto-sync on in the panel, o Alongside the main bundle, there are some extra bundles that we maintain that you may also want to use for speedrunning marathons. See their GitHub pages for more detailed information on how to use them. Be warned they are somewhat undocumented as of now. -To easily install: `nodecg install speedcontrol/BUNDLE-NAME` -- [speedcontrol-tiltify](https://github.com/speedcontrol/speedcontrol-tiltify): Adds a frequently updating donation total amount for a Tiltify campaign you can use in layouts. -- [speedcontrol-srcomtracker](https://github.com/speedcontrol/speedcontrol-srcomtracker): Adds frequently updating donation total/goals/bidwars and messages for new donations for a marathon on [speedrun.com](https://www.speedrun.com) if they are enabled, that you can use in your layouts. -- [speedcontrol-flagcarrier](https://github.com/speedcontrol/speedcontrol-flagcarrier): Adds a server and replicants that can receive requests from ESA's [FlagCarrier android app](https://play.google.com/store/apps/details?id=de.oromit.flagcarrier) so this information can be used in your layouts. -- [speedcontrol-layouts](https://github.com/nicnacnic/speedcontrol-layouts): A base pack of layouts for anyone to customize. Includes Tiltify support for donation totals, incentives, and prizes, layout Photoshop files, and detailed documentation for all your customization needs. -- [speedcontrol-tweetr](https://github.com/nicnacnic/speedcontrol-tweetr): Control Twitter right from your NodeCG dashboard! +To easily install: `nodecg install BUNDLE`, where `BUNDLE` is the full name below. +- [speedcontrol/speedcontrol-tiltify](https://github.com/speedcontrol/speedcontrol-tiltify): Adds a frequently updating donation total amount for a Tiltify campaign you can use in layouts. +- [speedcontrol/speedcontrol-srcomtracker](https://github.com/speedcontrol/speedcontrol-srcomtracker): Adds frequently updating donation total/goals/bidwars and messages for new donations for a marathon on [speedrun.com](https://www.speedrun.com) if they are enabled, that you can use in your layouts. +- [speedcontrol/speedcontrol-flagcarrier](https://github.com/speedcontrol/speedcontrol-flagcarrier): Adds a server and replicants that can receive requests from ESA's [FlagCarrier android app](https://play.google.com/store/apps/details?id=de.oromit.flagcarrier) so this information can be used in your layouts. +- [nicnacnic/speedcontrol-layouts](https://github.com/nicnacnic/speedcontrol-layouts): A base pack of layouts for anyone to customize. Includes Tiltify support for donation totals, incentives, and prizes, layout Photoshop files, and detailed documentation for all your customization needs. +- [nicnacnic/speedcontrol-tweetr](https://github.com/nicnacnic/speedcontrol-tweetr): Control Twitter right from your NodeCG dashboard! ## Where has this bundle been used before? diff --git a/READMES/API/Our-Messages.md b/READMES/API/Our-Messages.md index a2855cb1..ba2c8d01 100644 --- a/READMES/API/Our-Messages.md +++ b/READMES/API/Our-Messages.md @@ -23,7 +23,7 @@ speedcontrol.sendMessage('changeActiveRun', 'f926048c-3527-4d2f-96f6-680b81bf06e These are also available typed if you use TypeScript. -*Types available in [./types/ExtensionReturn.d.ts](../../types/ExtensionReturn.d.ts) and [./types/Events.d.ts](../../types/Events.d.ts)* +*Types available in [./src/types/ExtensionReturn.d.ts](../../src/types/ExtensionReturn.d.ts) and [./types/Events.d.ts](../../src/types/Events.d.ts)* You can use the `ExtensionReturn` interface to properly type what the extension returns, although due to an issue with NodeCG's own typings (correct as of `1.6.0`), you must convert the expression to `unknown` first: ```typescript diff --git a/READMES/API/Replicants.md b/READMES/API/Replicants.md index 4a0472fe..701e28c2 100644 --- a/READMES/API/Replicants.md +++ b/READMES/API/Replicants.md @@ -13,7 +13,7 @@ ## runDataArray -*Types available in [./types/RunData.d.ts](../../types/RunData.d.ts)* +*Types available in [./src/types/RunData.d.ts](../../src/types/RunData.d.ts)* ### Data - *[`array`[`object`]]* An array of `runData` objects (relevant link: [`runData` Object Structure](./RunData.md)). @@ -38,7 +38,7 @@ All of the runs that have been imported/added. This is the same thing that is us ## runDataActiveRun -*Types available in [./types/RunData.d.ts](../../types/RunData.d.ts)* +*Types available in [./src/types/RunData.d.ts](../../src/types/RunData.d.ts)* ### Data - *[`object` or `undefined`]* Either a `runData` object or `undefined` if no active run is set (relevant link: [`runData` Object Structure](./RunData.md)). @@ -61,7 +61,7 @@ Currently active run as set by the *Run Player* panel (or similar). ## runDataActiveRunSurrounding -*Types available in [./schemas/runDataActiveRunSurrounding.d.ts](../../schemas/runDataActiveRunSurrounding.d.ts)* +*Types available in [./src/types/schemas/runDataActiveRunSurrounding.d.ts](../../src/types/schemas/runDataActiveRunSurrounding.d.ts)* ### Data - *[`object`]* @@ -89,7 +89,7 @@ A reference for the previous/current/next run's IDs, if available. These are rec ## timer -*Types available in [./types/Timer.d.ts](../../types/Timer.d.ts)* +*Types available in [./src/types/Timer.d.ts](../../src/types/Timer.d.ts)* ### Data - *[`object`]* @@ -146,7 +146,7 @@ The default object state: ## runFinishTimes -*Types available in [./types/Timer.d.ts](../../types/Timer.d.ts)* +*Types available in [./src/types/Timer.d.ts](../../src/types/Timer.d.ts)* ### Data - *[`object`]* Keyed by run ID, with `timer` object clones. @@ -172,7 +172,7 @@ A keyed object; the keys are run IDs, the values are copies of the `timer` objec ## timerChangesDisabled -*Types available in [./schemas/timerChangesDisabled.d.ts](../../schemas/timerChangesDisabled.d.ts)* +*Types available in [./src/types/schemas/timerChangesDisabled.d.ts](../../src/types/schemas/timerChangesDisabled.d.ts)* ### Data `timerChangesDisabled` *[`boolean`]* If the timer can be changed, either programatically or by a user. @@ -196,7 +196,7 @@ A `boolean` that can be set by you, which is used to disable any changes of the ## twitchCommercialTimer -*Types available in [./schemas/twitchCommercialTimer.d.ts](../../schemas/twitchCommercialTimer.d.ts)* +*Types available in [./src/types/schemas/twitchCommercialTimer.d.ts](../../src/types/schemas/twitchCommercialTimer.d.ts)* ### Data - *[`object`]* diff --git a/READMES/API/RunData.md b/READMES/API/RunData.md index d22872cf..339860a1 100644 --- a/READMES/API/RunData.md +++ b/READMES/API/RunData.md @@ -1,6 +1,6 @@ # API Documentation: runData Object Structure -*Types available in [./types/RunData.d.ts](../../types/RunData.d.ts)* +*Types available in [./src/types/RunData.d.ts](../../src/types/RunData.d.ts)* Various places in this bundle store information in the format we refer to as the "`runData` object". @@ -33,6 +33,9 @@ Various places in this bundle store information in the format we refer to as the pronouns: "He/Him", social: { twitch: "esamarathon" + }, + customData: { + otherData: "Some String" } } ] @@ -49,6 +52,9 @@ Various places in this bundle store information in the format we refer to as the pronouns: "She/Her", social: { twitch: "monstercat" + }, + customData: { + otherData: "Some String" } } ] @@ -100,3 +106,4 @@ The `players` array in "`team` objects" will contain (if anything) "`player` obj - `pronouns` *[`string`]* List of the player's preferred pronouns, usually pulled from [speedrun.com](https://www.speedrun.com), and if so, can also be a comma separated list of each option they allow to be selected. - `social` *[`object`]* Contains information on this player's social media references. - `twitch` *[`string`]* Username of this player on [twitch.tv](https://www.twitch.tv). +- `customData` *[`object`]* Contains keyed strings, with the key(s) from your configuration for *player based* custom data; this will always be an object even if no data is contained within it. diff --git a/READMES/Configuration.md b/READMES/Configuration.md index 884f8df8..b08ec02b 100644 --- a/READMES/Configuration.md +++ b/READMES/Configuration.md @@ -47,6 +47,14 @@ Below is an example configuration file contents with everything that is availabl "defaultMarathon": "SHORTNAME", "useJapanese": false, "disableSpeedrunComLookup": false + }, + "customData": { + "player": [ + { + "name": "Other Data", + "key": "otherData" + } + ] } } ``` @@ -136,7 +144,7 @@ There is also another optional parameter, `additionalScopes`, which is an array - `defaultURL` is a URL to the schedule on Horaro that will be pre-filled on the dashboard; usually you will only be using your setup for 1 marathon so this means you don't need to keep entering it every time you want to do a (re)import. - `ignoreGamesWhileImporting` is an array of strings of games on your schedule that will be ignored on import; for example you may have setup blocks you don't want importing. This does partial matches ("Setup Block" will be matched by "Setup"). - `disableSpeedrunComLookup` is a boolean (defaults to `false`) that can be enabled, which will skip the speedrun.com look-ups during schedule import; by default the import will try to find the player's Twitch username, country and preferred pronouns from speedrun.com, but if you do not need this you can disable it to speed up the import. -- `customData` (*for advanced users*) is an array of objects; this is for adding custom data to the run data on import. Once set here, you will be able to select an appropriate column on import for where this data is stored in your schedule. All of this is stored within an objected called `customData` within the run's data object. +- `customData` (*for advanced users*) is an array of objects; this is for adding custom data to the run data on import. Once set here, you will be able to select an appropriate column on import for where this data is stored in your schedule. All of this is stored within an object called `customData` within the run's data object. - `name` is the formatted name that will appear in the Speedcontrol UI. - `key` is the key that will be used in the `customData` in the run data. - `ignoreMarkdown` is a boolean (defaults to `false`) which if true, will tell the Horaro import to not attempt to strip any markdown in the column's data for that run. @@ -157,3 +165,27 @@ There is also another optional parameter, `additionalScopes`, which is an array - `defaultMarathon` is the marathon's shortname on Oengus that will be pre-filled on the dashboard; this is the part of the URL *after* `oengus.io/marathon/`. - `useJapanese` is a boolean (defaults to `false`) which if true, will tell the import to use the Japanese names of players on import instead of the international ones. This setting can also be toggled from the dashboard itself. - `disableSpeedrunComLookup` is a boolean (defaults to `false`) that can be enabled, which will skip the speedrun.com look-ups during schedule import; by default the import will try to find the player's Twitch username (if not already linked via Oengus) and country from speedrun.com, but if you do not need this you can disable it to speed up the import. + + +### Custom Data + +```json +{ + "customData": { + "player": [ + { + "name": "Other Data", + "key": "otherData" + } + ] + } +} +``` + +*For advanced users!* + +This is the part where you configure "custom data" that will also be able to be added/edited alongside any data the bundle can already handle. Currently, this part of the configuration is only used for custom *player* data; custom *run* data is still handled in the Horaro configuration ([see above](#horaro-schedule)). + +- `player` is where the custom *player* data is configured; this is an array of objects. Anything configured here has the chance to appear within an object called `customData` within the player's data object *inside* of the run data object. This is not automatically imported from anywhere as of yet and can only be added/edited via the dashboard. + - `name` is the formatted name that will appear in the Speedcontrol UI. + - `key` is the key that will be used in the `customData` in the player data. diff --git a/package-lock.json b/package-lock.json index b3e02f83..7566ef9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "nodecg-speedcontrol", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "2.2.0", + "version": "2.3.0", "license": "MIT", "dependencies": { "@types/needle": "^2.5.1", @@ -70,7 +70,7 @@ "vue-style-loader": "^4.1.3", "vue-template-compiler": "^2.6.14", "vuedraggable": "^2.24.3", - "vuetify": "^2.5.3", + "vuetify": "^2.5.4", "vuetify-loader": "^1.7.2", "vuex": "^3.6.2", "vuex-class": "^0.3.2", diff --git a/package.json b/package.json index 5cec84f0..1ab5b281 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodecg-speedcontrol", - "version": "2.2.0", + "version": "2.3.0", "description": "NodeCG bundle to help facilitate the running of speedrunning marathons, including overlays.", "homepage": "https://github.com/speedcontrol/nodecg-speedcontrol#readme", "bugs": { @@ -97,7 +97,7 @@ "vue-style-loader": "^4.1.3", "vue-template-compiler": "^2.6.14", "vuedraggable": "^2.24.3", - "vuetify": "^2.5.3", + "vuetify": "^2.5.4", "vuetify-loader": "^1.7.2", "vuex": "^3.6.2", "vuex-class": "^0.3.2", diff --git a/src/dashboard/_misc/common.css b/src/dashboard/_misc/common.css index d0bca815..ce25fd71 100644 --- a/src/dashboard/_misc/common.css +++ b/src/dashboard/_misc/common.css @@ -1,11 +1,20 @@ +/* Remove NodeCG's default margin added to the body. +This is because otherwise v-tooltip position is broken since Vuetify v2.5.2 with it. */ +body { + margin: 0; +} + /* So the always has a transparent background, otherwise it looks odd in the NodeCG dashboard panels. */ .v-application { background-color: transparent !important; } -/* So the doesn't take up 100% height which breaks -in the NodeCG dashboard panels anyway. */ .v-application--wrap { + /* So the doesn't take up 100% height which breaks + in the NodeCG dashboard panels anyway. */ min-height: 0 !important; + + /* Re-add the margin from above to this wrapper instead. */ + margin: 15px; } \ No newline at end of file diff --git a/src/dashboard/horaro-schedule-import/RunDataOptions.ts b/src/dashboard/horaro-schedule-import/RunDataOptions.ts index 22f11edc..3e7a3a0e 100644 --- a/src/dashboard/horaro-schedule-import/RunDataOptions.ts +++ b/src/dashboard/horaro-schedule-import/RunDataOptions.ts @@ -35,6 +35,7 @@ const options: RunDataOption[] = [ predict: [ 'system', 'platform', + 'console', ], }, {