Skip to content

Commit

Permalink
Merge branch 'develop' into new-api-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianyourgod committed Jun 22, 2024
2 parents 9e98d9a + 31ab4f8 commit cd86afb
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scratch-gui modified for use in [TurboWarp](https://turbowarp.org/) then modified for use in [PenguinMod](https://penguinmod.github.io/penguinmod.github.io/) 😀
scratch-gui modified for use in [TurboWarp](https://turbowarp.org/) then modified for use in [PenguinMod](https://studio.penguinmod.com) 😀
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/PenguinMod/penguinmod.github.io/)
## Setup

Expand Down
18 changes: 0 additions & 18 deletions src/addons/addons/mediarecorder/userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,24 +323,6 @@ export default async ({ addon, console, msg }) => {
vm.runtime.audioEngine.inputNode.connect(mediaStreamDestination);
const audioSource = ctx.createMediaStreamSource(mediaStreamDestination.stream);
audioSource.connect(dest);
// extended audio should be recorded
if ("ext_jgExtendedAudio" in vm.runtime) {
const extension = vm.runtime.ext_jgExtendedAudio;
const helper = extension.helper;
// audio context might not be created, make it for him
if (!helper.audioContext) helper.audioContext = new AudioContext();
// gain node for volume slidor might not be created, make it for him
if (!helper.audioGlobalVolumeNode) {
helper.audioGlobalVolumeNode = helper.audioContext.createGain();
helper.audioGlobalVolumeNode.gain.value = vm.runtime.audioEngine.inputNode.gain.value;
helper.audioGlobalVolumeNode.connect(helper.audioContext.destination);
}
// create media stream
const mediaStreamDestination = helper.audioContext.createMediaStreamDestination();
helper.audioGlobalVolumeNode.connect(mediaStreamDestination);
const audioSource = ctx.createMediaStreamSource(mediaStreamDestination.stream);
audioSource.connect(dest);
}
// literally any other extension
for (const audioData of vm.runtime._extensionAudioObjects.values()) {
if (audioData.audioContext && audioData.gainNode) {
Expand Down
30 changes: 0 additions & 30 deletions src/addons/addons/vol-slider/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@ const callbacks = [];
export const setVolume = (newVolume) => {
if (gainNode) {
gainNode.value = newVolume;
// extended audio
if ("ext_jgExtendedAudio" in globalVm.runtime) {
const extension = globalVm.runtime.ext_jgExtendedAudio;
const helper = extension.helper;
// audio context might not be created, make it for him
if (!helper.audioContext) helper.audioContext = new AudioContext();
// gain node for volume slidor might not be created, make it for him
if (!helper.audioGlobalVolumeNode) {
helper.audioGlobalVolumeNode = helper.audioContext.createGain();
helper.audioGlobalVolumeNode.gain.value = gainNode.value;
helper.audioGlobalVolumeNode.connect(helper.audioContext.destination);
} else {
helper.audioGlobalVolumeNode.gain.value = gainNode.value;
}
}
// literally any other extension
for (const audioData of globalVm.runtime._extensionAudioObjects.values()) {
if (audioData.gainNode) {
Expand Down Expand Up @@ -73,21 +58,6 @@ const gotAudioEngine = (audioEngine) => {
}
gainNode = audioEngine.inputNode.gain;
gainNode.value = volumeBeforeFinishSetup;
// extended audio
if ("ext_jgExtendedAudio" in globalVm.runtime) {
const extension = globalVm.runtime.ext_jgExtendedAudio;
const helper = extension.helper;
// audio context might not be created, make it for him
if (!helper.audioContext) helper.audioContext = new AudioContext();
// gain node for volume slidor might not be created, make it for him
if (!helper.audioGlobalVolumeNode) {
helper.audioGlobalVolumeNode = helper.audioContext.createGain();
helper.audioGlobalVolumeNode.gain.value = gainNode.value;
helper.audioGlobalVolumeNode.connect(helper.audioContext.destination);
return;
}
helper.audioGlobalVolumeNode.gain.value = gainNode.value;
}
// literally any other extension
for (const audioData of globalVm.runtime._extensionAudioObjects.values()) {
if (audioData.gainNode) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tw-studioview/studioview.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ StudioView.prototype.onselect = function (id, el) { };
StudioView.prototype.onpageload = function () { };
StudioView.prototype.onend = function () { };

StudioView.STUDIO_API = 'http://localhost:8080/api/v1';
StudioView.STUDIO_API = 'https://projects.penguinmod.com/api/v1';

// The URL to download thumbnails from.
// $id is replaced with the project's ID.
StudioView.THUMBNAIL_SRC = 'http://localhost:8080/api/v1/projects/getproject?projectID=$id&requestType=thumbnail';
StudioView.THUMBNAIL_SRC = 'https://projects.penguinmod.com/api/v1/projects/getproject?projectID=$id&requestType=thumbnail';

// The URL for project pages.
// $id is replaced with the project ID.
Expand Down
6 changes: 3 additions & 3 deletions src/components/variables-tab/variables-tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Input from '../forms/input.jsx';
import Box from '../box/box.jsx';
import styles from './variables-tab.css';

class ShareButton extends React.Component {
class VariablesTab extends React.Component {
constructor(props) {
super(props);
bindAll(this, [
Expand Down Expand Up @@ -104,7 +104,7 @@ class ShareButton extends React.Component {
}
}

ShareButton.propTypes = {
VariablesTab.propTypes = {
localVariables: PropTypes.any,
globalVariables: PropTypes.any,
showLargeValue: PropTypes.any,
Expand All @@ -121,4 +121,4 @@ ShareButton.propTypes = {
onTypeVariableValue: PropTypes.func.isRequired,
};

export default injectIntl(ShareButton);
export default injectIntl(VariablesTab);
2 changes: 1 addition & 1 deletion src/containers/home-communication.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {connect} from 'react-redux';
import {setUsername, setUsernameInvalid, setUsernameLoggedIn} from '../reducers/tw';

let origin = "https://penguinmod.com";
// origin = 'http://localhost:5173';
// origin = 'https://penguinmod-home-git-new-backend-live-penguinmod.vercel.app/';

class HomeCommunication extends React.Component {
constructor (props) {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/tw-security-manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const isTrustedExtension = url => (
url.startsWith('http://localhost:8000') ||
url.startsWith('http://localhost:6000') || // Launcher Home
url.startsWith('http://localhost:6001') || // Launcher Extensions
url.startsWith('http://localhost:5173') || // Local Home or Extensions
url.startsWith('https://penguinmod-home-git-new-backend-live-penguinmod.vercel.app/') || // Local Home or Extensions
url.startsWith('http://localhost:5174') || // Local Home or Extensions

extensionsTrustedByUser.has(url)
Expand Down
28 changes: 20 additions & 8 deletions src/lib/libraries/extensions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ import sharkpoolGalleryIcon from './penguinmod/sharkpool-library.svg';
import turboBuilderIcon from './penguinmod/turbobuilder.png';
import turboBuilderDevIcon from './penguinmod/turbobuilder-dev.png';

import filesExtensionIcon from './penguinmod/extensions/files.png';
import filesExtensionIcon from './penguinmod/extensions/files.svg';
import jgJSONExtensionIcon from './penguinmod/extensions/json.png';
import jgTailgatingExtensionIcon from './penguinmod/extensions/tailgating.png';
import jgRuntimeExtensionIcon from './penguinmod/extensions/runtime.png';
import jgRuntimeExtensionIcon from './penguinmod/extensions/runtime.svg';
import jgPrismExtensionIcon from './penguinmod/extensions/prism.png';

import jwProtoExtensionIcon from './penguinmod/extensions/proto.png';
import jwProtoExtensionIcon from './penguinmod/extensions/proto.svg';
import jwUniteExtensionIcon from './penguinmod/extensions/Unite.png';
import jwXmlExtensionIcon from './penguinmod/extensions/xml.png';

Expand All @@ -94,14 +94,14 @@ import griffpatchPhysicsIcon from './penguinmod/extensions/griffpatch_physicsIco
import gp from './penguinmod/extensions/gamepad.svg';
import clippingblending from './penguinmod/extensions/clippingblending.svg';

import pointerlockThumb from './penguinmod/extensions/pointerlock.svg';
import pointerlockThumb from './penguinmod/extensions/pointerlock.png';
import cursorThumb from './penguinmod/extensions/cursor.svg';

// LilyMakesThings 🙏
// import lmsMcUtilsIcon from './penguinmod/extensions/mcutils.png';

// more icons so they arent just red when the extension color is not red
import gsaTempVariablesExtensionIcon from './penguinmod/extensions/tempvariables.png';
import gsaTempVariablesExtensionIcon from './penguinmod/extensions/tempvariables.svg';
import gsaColorUtilExtensionIcon from './penguinmod/extensions/colorutil.png';
import jgIframeExtensionIcon from './penguinmod/extensions/iframe.png';
import jgExtendedAudioExtensionIcon from './penguinmod/extensions/extendedaudio.png';
Expand All @@ -128,12 +128,12 @@ import fr3dPhysicsInsetExtensionIcon from './penguinmod/extensions/3d_physics_ic
import jgVrExtensionIcon from './penguinmod/extensions/vr_extension.png';

import theshovelCustomStylesIcon from './penguinmod/orgtw/CustomStyles.svg';
import theshovelCanvasEffectsIcon from './penguinmod/extensions/canvas_effects.png';
import theshovelCanvasEffectsIcon from './penguinmod/extensions/canvas_effects.svg';
import theshovelLzCompressIcon from './penguinmod/orgtw/lz-compress2.svg';
import theshovelColorPickerIcon from './penguinmod/orgtw/ColorPicker.svg';

// sharkpool
import sharkpoolPrintingIcon from './penguinmod/extensions/printing.png';
import sharkpoolPrintingIcon from './penguinmod/extensions/printing.svg';
import jgScriptsExtensionIcon from './penguinmod/extensions/scripts.svg';

// events
Expand Down Expand Up @@ -379,7 +379,7 @@ const menuItems = [
tags: ['penguinmod', 'categoryexpansion'],
description: 'More control blocks for animations, complex systems or cleaner one-time use blocks.',
featured: true,
credits: '"new thread" by CubesterYT, CST1229'
credits: '"new thread" by CubesterYT, CST1229, SharkPool'
},
{
name: 'Sensing Expansion',
Expand Down Expand Up @@ -1070,6 +1070,18 @@ const menuItems = [
}
];

/*
----------------------------------------------
### NOTE TO PENGUINMOD FORKS: ###
Please DO NOT make the extensions below accessible in the editor without livetests!
They are NOT fully developed for people to use and create full projects with!
These extensions could have missing features, cause random errors, broken projects, or even crash the editor!
Moving these into the main extension list will cause people who use your fork to assume they are ready for them to use!
Please keep these in livetests to reduce bug reports on your fork! :)
----------------------------------------------
*/
if (IsLocal || IsLiveTests) {
const extras = [
{
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cd86afb

Please sign in to comment.