Skip to content

Commit 29671d9

Browse files
authored
Merge pull request #64 from PoglyApp/0.2.2-beta
0.2.2-release
2 parents b183930 + ff8fad7 commit 29671d9

Some content is hidden

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

42 files changed

+1135
-98
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
First off, thank you for considering contributing to Pogly Standalone! It's people like you who make this project a great tool for streamers.
44

5-
If you have any questions regarding development, feel free to join our [Discord server](https://discord.gg/uPQsBaVdB7)!
5+
If you have any questions regarding development, feel free to join our [Discord server](https://discord.gg/pogly)!
66

77
## How Can I Contribute?
88

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
 
2424
<a href="https://github.com/clockworklabs/spacetimedb"><img src="https://img.shields.io/badge/powered_by-SpacetimeDB-000000.svg?style=flat-square" /></a>
2525
&nbsp;
26-
<img src="https://img.shields.io/badge/version-v0.1.3_beta-9f9f9f.svg?style=flat-square" />
26+
<img src="https://img.shields.io/github/v/release/poglyapp/pogly-standalone?color=9f9f9f&include_prereleases&label=version&sort=semver&style=flat-square" />
2727
&nbsp;
2828
<a href="https://github.com/PoglyApp/pogly-standalone/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-50C878.svg?style=flat-square" /></a>
2929
</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pogly-standalone",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"private": true,
55
"dependencies": {
66
"@clockworklabs/spacetimedb-sdk": "^0.11.1",

public/assets/notlikethis.png

27.3 KB
Loading

server/Lib.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,10 @@ public static void ClearRefreshOverlayRequests(ReducerContext ctx)
150150
Log("Encountered an error clearing overlay requests: " + e.Message, LogLevel.Error);
151151
}
152152
}
153+
154+
[SpacetimeDB.Reducer]
155+
public static void PingHeartbeat(ReducerContext ctx)
156+
{
157+
//do nothing - haha smile! :3
158+
}
153159
}

src/App.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import { LayoutContext } from "./Contexts/LayoutContext";
3232
import ConnectReducer from "./module_bindings/connect_reducer";
3333
import AuthenticateReducer from "./module_bindings/authenticate_reducer";
3434
import { DebugLogger } from "./Utility/DebugLogger";
35+
import { StartHeartbeat } from "./Utility/PingHeartbeat";
36+
import { Error } from "./Pages/Error";
3537

3638
export const App: React.FC = () => {
3739
const { closeModal } = useContext(ModalContext);
@@ -138,6 +140,7 @@ export const App: React.FC = () => {
138140
<Route
139141
path="/"
140142
element={<Header activePage={activePage} setActivePage={setActivePage} onlineVersion={versionNumber} />}
143+
errorElement={<Error />}
141144
>
142145
{/*TODO: Home page*/}
143146
{/*<Route index element={<Home />} />*/}
@@ -309,9 +312,11 @@ export const App: React.FC = () => {
309312
if (timeout) clearTimeout(timeout);
310313
}
311314

312-
// Step 5) Redo final subscriptions ONLY ONCE
315+
// Step 5) Redo final subscriptions ONLY ONCE && Start client heartbeat
313316
if (!stdbInitialized) {
314317
if (stdbInitialized || stdbSubscriptions) return <Loading text="Loading data..." />;
318+
DebugLogger("Starting Client->Server heartbeat!");
319+
StartHeartbeat();
315320
DebugLogger("Redoing subscriptions");
316321
SetSubscriptions(spacetime.Client, setStdbSubscriptions);
317322
}

src/Components/Containers/StreamContainer.tsx

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,31 @@ import { useState, useEffect, useContext } from "react";
22
import Config from "../../module_bindings/config";
33
import { TwitchPlayerNonInteractive } from "react-twitch-embed";
44
import { ConfigContext } from "../../Contexts/ConfigContext";
5+
import { useSpacetimeContext } from "../../Contexts/SpacetimeContext";
56

67
export const StreamContainer = () => {
78
const config: Config = useContext(ConfigContext);
9+
const { Runtime } = useSpacetimeContext();
10+
11+
const [streamOverride, setStreamOverride] = useState<string | null>(null);
12+
13+
useEffect(() => {
14+
const streamOverrides = localStorage.getItem("streamOverride");
15+
if (!streamOverrides || !Runtime) return;
16+
17+
const overrideJson = JSON.parse(streamOverrides);
18+
const currentOverride = overrideJson.find((obj: any) => obj.module === Runtime.module);
19+
20+
if (!currentOverride) return;
21+
22+
console.log(currentOverride.override);
23+
24+
setStreamOverride(currentOverride.override);
25+
}, [Runtime]);
826

927
return (
1028
<>
11-
{config.streamingPlatform === "twitch" && (
29+
{config.streamingPlatform === "twitch" && !streamOverride && (
1230
<TwitchPlayerNonInteractive
1331
style={{ zIndex: 0, pointerEvents: "none" }}
1432
height="100%"
@@ -19,7 +37,8 @@ export const StreamContainer = () => {
1937
muted
2038
/>
2139
)}
22-
{config.streamingPlatform === "youtube" && (
40+
41+
{config.streamingPlatform === "youtube" && !streamOverride && (
2342
<iframe
2443
style={{ zIndex: 0, pointerEvents: "none", border: "none" }}
2544
height="100%"
@@ -30,7 +49,8 @@ export const StreamContainer = () => {
3049
title="YoutubeStream"
3150
/>
3251
)}
33-
{config.streamingPlatform === "kick" && (
52+
53+
{config.streamingPlatform === "kick" && !streamOverride && (
3454
<iframe
3555
style={{ zIndex: 0, pointerEvents: "none", border: "none" }}
3656
height="100%"
@@ -41,6 +61,18 @@ export const StreamContainer = () => {
4161
title="KickStream"
4262
/>
4363
)}
64+
65+
{streamOverride && (
66+
<iframe
67+
style={{ zIndex: 0, pointerEvents: "none", border: "none" }}
68+
height="100%"
69+
width="100%"
70+
id="stream"
71+
src={streamOverride}
72+
allowFullScreen
73+
title="KickStream"
74+
/>
75+
)}
4476
</>
4577
);
4678
};

src/Components/ElementSelectionMenu/ElementSelectionMenuFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const ElementSelectionMenuFooter = () => {
127127
<path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" />
128128
</SvgIcon>
129129
<Link
130-
href="https://discord.gg/uPQsBaVdB7"
130+
href="https://discord.gg/pogly"
131131
target="_blank"
132132
underline="always"
133133
sx={{ paddingTop: "3px", paddingLeft: "5px", color: "#ffffffa6" }}

src/Components/Elements/ContextMenus/ElementContextMenu.tsx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import PermissionLevel from "../../../module_bindings/permission_level";
2828
import InfoOutlineIcon from "@mui/icons-material/InfoOutlined";
2929
import VisibilityIcon from "@mui/icons-material/Visibility";
3030
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
31+
import { UpdateElementSourceModal } from "../../Modals/UpdateElementSourceModal";
3132

3233
interface IProps {
3334
contextMenu: any;
@@ -111,6 +112,14 @@ export const ElementContextMenu = (props: IProps) => {
111112
}
112113
};
113114

115+
const openUpdateSourceModal = () => {
116+
DebugLogger("Opening update source modal");
117+
setModals((oldModals: any) => [
118+
...oldModals,
119+
<UpdateElementSourceModal key="textCreation_modal" selectedElement={selectedElement!} />,
120+
]);
121+
};
122+
114123
if (!selectedElement) return <></>;
115124

116125
return (
@@ -342,7 +351,7 @@ export const ElementContextMenu = (props: IProps) => {
342351
<StyledMenuItem onClick={() => setShowExamine((showExamine) => !showExamine)}>Show details</StyledMenuItem>
343352

344353
{showExamine && element && (
345-
<>
354+
<div>
346355
{element.element.tag === "ImageElement" && element.element.value.imageElementData.tag === "ElementDataId" && (
347356
<Paper variant="outlined" sx={{ color: "#ffffffa6", padding: "5px", margin: "5px" }}>
348357
Image: {ElementData.findById(element.element.value.imageElementData.value)?.name || ""}
@@ -363,10 +372,24 @@ export const ElementContextMenu = (props: IProps) => {
363372
<Paper variant="outlined" sx={{ color: "#ffffffa6", padding: "5px", margin: "5px" }}>
364373
Added by: {element.placedBy}
365374
</Paper>
366-
</>
375+
</div>
367376
)}
368377

369378
<Divider component="li" variant="fullWidth" sx={{ border: "solid 1px #001529e6" }} />
379+
{selectedElement.element.tag === "ImageElement" && (
380+
<>
381+
{strictMode && !permissions ? (
382+
<Tooltip title="Strict mode is enabled and preventing you from updating the source. Ask the instance owner!">
383+
<StyledDisabledMenuItem>
384+
<InfoOutlineIcon sx={{ fontSize: 16, color: "orange", alignSelf: "center", paddingRight: "5px" }} />
385+
Update source
386+
</StyledDisabledMenuItem>
387+
</Tooltip>
388+
) : (
389+
<StyledMenuItem onClick={openUpdateSourceModal}>Update source</StyledMenuItem>
390+
)}
391+
</>
392+
)}
370393

371394
{strictMode && !permissions ? (
372395
<Tooltip title="Strict mode is enabled and preventing you from deleting elements. Ask the instance owner!">
@@ -423,6 +446,17 @@ const StyledDisabledDeleteMenuItem = styled(MenuItem)`
423446
cursor: not-allowed;
424447
`;
425448

449+
const StyledDisabledMenuItem = styled(MenuItem)`
450+
color: #ffffff75;
451+
452+
margin-left: 5px;
453+
margin-right: 5px;
454+
455+
padding-left: 5px;
456+
457+
cursor: not-allowed;
458+
`;
459+
426460
const StyledSelect = styled(Select)`
427461
color: #ffffffa6;
428462
margin-left: 0px;

src/Components/General/CursorComponent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export const CursorComponent = (props: IProp) => {
3131
parseFloat(positionX) * state.scale,
3232
parseFloat(positionY) * state.scale,
3333
0,
34+
false,
35+
false,
3436
null,
3537
null
3638
);

0 commit comments

Comments
 (0)