Skip to content

Commit

Permalink
Merge branch 'master' into refactor/fit-text
Browse files Browse the repository at this point in the history
* master:
  走者カメラをデフォルトでONにする (#678)
  寄付有無を設定可能にした (#679)
  feat(tracker): make websocket optional (#676)
  • Loading branch information
Hoishin committed Apr 27, 2023
2 parents 007ad72 + a7b1d50 commit 21c8ff2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
5 changes: 3 additions & 2 deletions configschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"tracker": {
"type": "object",
"additionalProperties": false,
"required": ["domain", "event", "websocket", "secure"],
"required": ["domain", "event", "secure"],
"properties": {
"domain": {"type": "string"},
"event": {"type": "number"},
Expand Down Expand Up @@ -103,6 +103,7 @@
"items": {
"type": "string"
}
}
},
"donationEnabled": {"type": "boolean", "default": true}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"name": "credit-control",
"title": "エンドロール操作",
"file": "credit-control.html",
"width": 1,
"width": 2,
"headerColor": "#00BEBE",
"workspace": "2-misc"
},
Expand Down
30 changes: 17 additions & 13 deletions src/browser/graphics/views/omnibar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -711,19 +711,23 @@ const Omnibar = () => {
</div>
</Row>

<img
src={lineImage}
style={{gridColumn: "3 / 4", gridRow: "1 / 2"}}
></img>

<div style={{width: "15px"}}></div>

<DonationTotal></DonationTotal>

<img
src={sponsorAssets?.[0]?.url}
style={{gridColumn: "5 / 6", gridRow: "1 / 2"}}
></img>
{nodecg.bundleConfig.donationEnabled && (
<>
<img
src={lineImage}
style={{gridColumn: "3 / 4", gridRow: "1 / 2"}}
></img>

<div style={{width: "15px"}}></div>

<DonationTotal></DonationTotal>

<img
src={sponsorAssets?.[0]?.url}
style={{gridColumn: "5 / 6", gridRow: "1 / 2"}}
></img>
</>
)}
</div>
);
};
Expand Down
9 changes: 8 additions & 1 deletion src/extension/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const tracker = (nodecg: NodeCG) => {
twitch: runner?.fields.twitch,
nico: runner?.fields.nico,
twitter: runner?.fields.twitter,
camera: false,
camera: true,
};
}),
commentators: commentators
Expand Down Expand Up @@ -254,6 +254,13 @@ export const tracker = (nodecg: NodeCG) => {
}, 10 * 1000);

const connectWebSocket = () => {
if (!trackerConfig.websocket) {
log.warn(
"`websocket` config is empty. NodeCG will not connect to donation tracker's WebSocket.",
);
return;
}

const schema = trackerConfig.secure ? "wss" : "ws";
const url = new URL(
trackerConfig.websocket,
Expand Down

0 comments on commit 21c8ff2

Please sign in to comment.