Skip to content

Commit d0a84e6

Browse files
authored
Move shared folder locally (#16)
Also fixes prize display
1 parent 8a309f0 commit d0a84e6

File tree

402 files changed

+8592
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+8592
-119
lines changed

.github/workflows/build.yml

+33-32
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,38 @@ jobs:
5757
run: |
5858
git merge --no-commit ${{ inputs.base_branch || 'master' }}
5959
60-
# Do the 2nd part of the merge. This will ignore the branch's "shared" submodule stuff.
61-
# This can "error" if the merge commit is empty but we want to continue regardless.
62-
# Will only run if the checkout step was successful.
63-
- name: Merge base into build (2)
64-
if: ${{ steps.checkout.outcome == 'success' }}
65-
continue-on-error: true
66-
run: |
67-
rm -rf shared~${{ inputs.base_branch || 'master' }}
68-
git rm --ignore-unmatch --cached -r shared~${{ inputs.base_branch || 'master' }}
69-
git reset HEAD shared
70-
git commit -m "Merge branch '${{ inputs.base_branch || 'master' }}' into ${{ inputs.build_branch || 'build' }}"
71-
72-
# Returns the submodule back so we can get the latest files to build from that.
73-
# Will only run if the checkout step was successful.
74-
- name: Re-add esa-layouts-shared submodule
75-
if: ${{ steps.checkout.outcome == 'success' }}
76-
run: |
77-
rm -rf shared
78-
git rm --ignore-unmatch --cached -r shared
79-
git checkout ${{ inputs.base_branch || 'master' }} shared
80-
git commit -m "Re-add submodule" -a --allow-empty
81-
82-
# Converts the esa-layouts-shared submodule into a normal directory of files.
83-
# This is done as we want to freeze the build at a point in time and this works well.
84-
- name: Convert esa-layouts-shared submodule to regular directory
85-
run: |
86-
git submodule update --init
87-
git rm --cached shared
88-
git config -f .git/config --remove-section submodule.shared
89-
rm -rf shared/.git
90-
git add shared
60+
# TODO: remove if everything works fine
61+
# # Do the 2nd part of the merge. This will ignore the branch's "shared" submodule stuff.
62+
# # This can "error" if the merge commit is empty but we want to continue regardless.
63+
# # Will only run if the checkout step was successful.
64+
# - name: Merge base into build (2)
65+
# if: ${{ steps.checkout.outcome == 'success' }}
66+
# continue-on-error: true
67+
# run: |
68+
# rm -rf shared~${{ inputs.base_branch || 'master' }}
69+
# git rm --ignore-unmatch --cached -r shared~${{ inputs.base_branch || 'master' }}
70+
# git reset HEAD shared
71+
# git commit -m "Merge branch '${{ inputs.base_branch || 'master' }}' into ${{ inputs.build_branch || 'build' }}"
72+
#
73+
# # Returns the submodule back so we can get the latest files to build from that.
74+
# # Will only run if the checkout step was successful.
75+
# - name: Re-add esa-layouts-shared submodule
76+
# if: ${{ steps.checkout.outcome == 'success' }}
77+
# run: |
78+
# rm -rf shared
79+
# git rm --ignore-unmatch --cached -r shared
80+
# git checkout ${{ inputs.base_branch || 'master' }} shared
81+
# git commit -m "Re-add submodule" -a --allow-empty
82+
#
83+
# # Converts the esa-layouts-shared submodule into a normal directory of files.
84+
# # This is done as we want to freeze the build at a point in time and this works well.
85+
# - name: Convert esa-layouts-shared submodule to regular directory
86+
# run: |
87+
# git submodule update --init
88+
# git rm --cached shared
89+
# git config -f .git/config --remove-section submodule.shared
90+
# rm -rf shared/.git
91+
# git add shared
9192

9293
# Setup some Node stuff
9394
- name: Node.js setup
@@ -131,7 +132,7 @@ jobs:
131132
- name: Commit built files (1)
132133
run: |
133134
git add -f dashboard graphics extension
134-
git add -f ':(glob)./shared/extension/*/dist/**'
135+
git add -f ':(glob)./zoton_shared/extension/*/dist/**'
135136
git commit -m "Built files" -a --allow-empty
136137
137138
# Squash the previous 2 commits down for convenience and create the final build commit.

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "shared"]
2-
path = shared
3-
url = https://github.com/esamarathon/esa-layouts-shared

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"eslint.workingDirectories": [
3-
"shared",
3+
"zoton_shared",
44
"streamdeck-plugin",
55
"companion-plugin\\companion-module-esa"
66
],
77
"typescript.tsdk": "node_modules\\typescript\\lib"
8-
}
8+
}

README.md

+10-35
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Next, clone the `build` branch of this repository into the NodeCG `bundles` fold
1717
> cd bundles
1818
> git clone https://github.com/bsgmarathon/esa-layouts.git --branch build
1919
> cd esa-layouts
20-
> npm install --production
20+
> pnpm install --frozen-lockfile
2121
> ```
2222
2323
You will probably also want a default configuration you can fill in, which can be created using:
@@ -28,7 +28,7 @@ Then, to get the most recent changes for [nodecg-speedcontrol](https://github.co
2828
> cd ..
2929
> git clone https://github.com/speedcontrol/nodecg-speedcontrol.git --branch build
3030
> cd nodecg-speedcontrol
31-
> npm install --production
31+
> pnpm install --frozen-lockfile
3232
> ```
3333
3434
In addition, to have the `videos` assets automatically audio normalised, you must have `python` (v3), `ffmpeg`, and [`ffmpeg-normalize`](https://github.com/slhck/ffmpeg-normalize) available in your system's `PATH`. If you don't have all of these, the check will fail and videos will just not be touched. For Windows, `python` (v3) should be automatically installed when you install Node.js built tools, if you chose to do that.
@@ -43,15 +43,13 @@ This bundle also heavily relies on information from a RabbitMQ server, and an in
4343
4444
### Stream Deck Plugin
4545
46+
Deprecated in favor of companion plugin.
47+
4648
Included with this bundle is a plugin for the Elgato Stream Deck software that can be used by various crew members during events. Once you have the Stream Deck software installed, you can install the plugin by running the file `com.esamarathon.streamdeck.streamDeckPlugin` in the `streamdeck-plugin/Release` directory. Currently, you need to set the actions up yourself in the software, so it can easily be customised on the fly.
4749
4850
### FlagCarrier Configuration
4951
50-
You will need to install the [speedcontrol-flagcarrier](https://github.com/speedcontrol/speedcontrol-flagcarrier) bundle to use this part, along with using one of the FlagCarrier applications to set them.
51-
52-
**Hosts (the ones on camera):**
53-
- group_id: `hosts`
54-
- positions: `left,midleft,middle,midright,right`
52+
While this bundle still contains something called FlagCarrier, it has been repurposed for something else internally
5553
5654
### Text-To-Speech Donations
5755
@@ -61,33 +59,9 @@ This can be enabled via the config, controlled via Stream Deck buttons available
6159
6260
This bundle can interface with [foobar2000](https://www.foobar2000.org/) using the [beefweb](https://github.com/hyperblast/beefweb) plugin. Set up foobar2000 however you want it to play music (we use a long playlist on shuffle, and set a fade in/out on pause), make sure the correct username/password are set in the configuration file, and this bundle with automatically play music when needed. It will only play if the scene name ends in `[M]`, for example, `Intermission [M]`.
6361
64-
## Other Information
62+
Alternatively, you can use [DeaDBeeF](https://deadbeef.sourceforge.io/) with the same beefweb plugin if you are using linux.
6563
66-
### Events Used For
67-
68-
Here's a list of events this bundle has been used at so far, most recent first.
69-
70-
* UKSG Autumn 2021
71-
* ESA Summer 2021
72-
* UKSG Summer 2021
73-
* UKSG Spring 2021
74-
* ESA Winter 2021
75-
* UKSG Winter 2021
76-
* UKSG Autumn 2020
77-
* ESA Summer 2020
78-
* UKSG Summer 2020
79-
* ESA Corona Relief
80-
* ESA Together
81-
* UKSG Spring 2020
82-
* ESA Winter 2020
83-
* UKSG Winter 2020
84-
* ESA @ Malmö Vinterspelen 2019
85-
* ESA @ DreamHack Winter 2019
86-
* UKSG Autumn 2019
87-
* ESA Summer 2019 (including some streams on [SpeedGaming](https://www.twitch.tv/speedgaming) during the event).
88-
* UKSG Summer 2019
89-
* All BSG's from BSG @Home 2020 onwards (Aug 2020)
90-
* All Hekathon events from 2021 onwards
64+
## Other Information
9165
9266
### Credits
9367
@@ -96,11 +70,12 @@ Here's a list of events this bundle has been used at so far, most recent first.
9670
* https://calculateaspectratio.com/ for helping me (duncte) wiht some math
9771
9872
## Development
99-
To get this bundle set-up for development run the following commands
73+
To get this bundle set-up for development run the following commands.
74+
***Make sure to install speedcontrol!***
10075
> ```
10176
> cd bundles
10277
> git clone https://github.com/bsgmarathon/esa-layouts.git
10378
> cd esa-layouts
10479
> git submodule update --init --recursive
105-
> npm install --production
80+
> pnpm install
10681
> ```

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"watch": "run-p watch:*",
2929
"watch:browser": "webpack -w",
3030
"watch:extension": "tsc -b tsconfig.extension.json -w",
31-
"postinstall": "cd shared && node postinstall.js"
31+
"postinstall": "cd zoton_shared && node postinstall.js"
3232
},
3333
"dependencies": {
3434
"@esamarathon/mq-events": "^1.0.1",
@@ -362,7 +362,7 @@
362362
],
363363
"mount": [
364364
{
365-
"directory": "shared/flags",
365+
"directory": "zoton_shared/flags",
366366
"endpoint": "flags"
367367
},
368368
{

schemas/capturePositions.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"allOf": [
44
{
5-
"$ref": "../shared/schemas/capturePositions.json"
5+
"$ref": "../zoton_shared/schemas/capturePositions.json"
66
}
77
]
8-
}
8+
}

schemas/countdown.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"allOf": [
44
{
5-
"$ref": "../shared/schemas/countdown.json"
5+
"$ref": "../zoton_shared/schemas/countdown.json"
66
}
77
]
8-
}
8+
}

schemas/mediaBox.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"allOf": [
44
{
5-
"$ref": "../shared/schemas/mediaBox.json"
5+
"$ref": "../zoton_shared/schemas/mediaBox.json"
66
}
77
]
8-
}
8+
}

schemas/musicData.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"allOf": [
44
{
5-
"$ref": "../shared/schemas/musicData.json"
5+
"$ref": "../zoton_shared/schemas/musicData.json"
66
}
77
]
8-
}
8+
}

schemas/prizes.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"allOf": [
44
{
5-
"$ref": "../shared/schemas/prizes.json"
5+
"$ref": "../zoton_shared/schemas/prizes.json"
66
}
77
]
8-
}
8+
}

shared

-1
This file was deleted.

src/extension/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// This must go first so we can use module aliases!
44
/* eslint-disable import/first */
55
require('module-alias').addAlias('@esa-layouts', require('path').join(__dirname, '.'));
6-
require('module-alias').addAlias('@shared', require('path').join(__dirname, '../shared'));
6+
require('module-alias').addAlias('@shared', require('path').join(__dirname, '../zoton_shared'));
77

88
import { ExtensionReturn } from '@esa-layouts/types';
99
import type { Configschema } from '@esa-layouts/types/schemas/configschema';

src/extension/tracker/prizes.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ const refreshTime = 60 * 1000; // Get prizes every 60s.
1212

1313
// Processes the response from the API above.
1414
function processRawPrizes(rawPrizes: Tracker.Prize[]): Tracker.FormattedPrize[] {
15-
return rawPrizes.filter((prize) => prize.fields.state === 'ACCEPTED').map((prize) => {
15+
// Somehow the the state is gone LMAO
16+
return rawPrizes/* .filter((prize) => prize.fields.state === 'ACCEPTED') */.map((prize) => {
1617
const startTime = prize.fields.startrun__starttime || prize.fields.starttime;
1718
const endTime = prize.fields.endrun__endtime || prize.fields.endtime;
1819
return {
1920
id: prize.pk,
2021
name: prize.fields.name,
2122
provided: prize.fields.provider || undefined,
2223
minimumBid: parseFloat(prize.fields.minimumbid),
23-
image: prize.fields.image || undefined,
24+
image: prize.fields.altimage || prize.fields.image || undefined,
2425
startTime: startTime ? Date.parse(startTime) : undefined,
2526
endTime: endTime ? Date.parse(endTime) : undefined,
2627
};
@@ -60,7 +61,8 @@ async function updatePrizes(): Promise<void> {
6061
// eslint-disable-next-line import/prefer-default-export
6162
export function setup(): void {
6263
if (!useTestData) {
63-
updatePrizes();
64+
updatePrizes()
65+
.catch((e) => nodecg().log.error('Failed to update prizes:', e));
6466
} else {
6567
// Test Data
6668
prizes.value = [
@@ -69,7 +71,8 @@ export function setup(): void {
6971
name: 'Test Prize Name (Old)',
7072
provided: 'Anonymous',
7173
minimumBid: Math.floor(Math.random() * 50),
72-
image: 'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
74+
// eslint-disable-next-line max-len
75+
image: 'https://web.archive.org/web/20100620045843/https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
7376
startTime: Date.now() - 43200000, // Now - 12 hours
7477
endTime: Date.now() - 21600000, // Now + 6 hours
7578
},
@@ -78,7 +81,8 @@ export function setup(): void {
7881
name: 'Test Prize Name (Active)',
7982
provided: 'Anonymous',
8083
minimumBid: Math.floor(Math.random() * 50),
81-
image: 'https://homepages.cae.wisc.edu/~ece533/images/cat.png',
84+
// eslint-disable-next-line max-len
85+
image: 'https://web.archive.org/web/20100620045843/https://homepages.cae.wisc.edu/~ece533/images/cat.png',
8286
startTime: Date.now(),
8387
endTime: Date.now() + 21600000, // Now + 6 hours
8488
},
@@ -87,7 +91,8 @@ export function setup(): void {
8791
name: 'Test Prize Name (Future)',
8892
provided: 'Anonymous',
8993
minimumBid: Math.floor(Math.random() * 50),
90-
image: 'https://homepages.cae.wisc.edu/~ece533/images/tulips.png',
94+
// eslint-disable-next-line max-len
95+
image: 'https://web.archive.org/web/20100620045843/https://homepages.cae.wisc.edu/~ece533/images/tulips.png',
9196
startTime: Date.now() + 21600000, // Now + 6 hours
9297
endTime: Date.now() + 43200000, // Now + 12 hours
9398
},

src/graphics/game-layout/16x9-1p.vue

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
>
7979
<flashing-lights-warning/>
8080
<media-box-box
81+
vertical
8182
line-right
8283
:style="{
8384
width: '469px',

src/graphics/game-layout/16x9-3p.vue

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
>
125125
<flashing-lights-warning/>
126126
<media-box-box
127+
vertical
127128
line-right
128129
line-left
129130
:style="{

src/graphics/game-layout/3dsv-1p.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,20 @@
8080
left: '0px',
8181
top: '732px',
8282
width: '574px',
83-
height: '101px',
83+
height: '106px',
8484
}"
8585
>
86-
<timer line-right/>
86+
<timer line-right line-bottom/>
8787
</div>
8888

8989
<!-- Media Box -->
9090
<div
9191
class="Fixed FlexColumn"
9292
:style="{
9393
left: '0px',
94-
top: '825px',
94+
top: '838px',
9595
width: '574px',
96-
height: '176px',
96+
height: '160px',
9797
}"
9898
>
9999
<flashing-lights-warning class="Flex" style="align-self: flex-end" />

src/types/ExtensionReturn.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DeepReadonly } from 'ts-essentials';
2-
import type OBS from '../../shared/extension/obs'; // eslint-disable-line import/no-relative-packages
2+
import type OBS from '../../zoton_shared/extension/obs'; // eslint-disable-line import/no-relative-packages
33
import { Configschema } from './schemas';
44

55
export interface ExtensionReturn {

0 commit comments

Comments
 (0)