Skip to content

Commit 5648ffa

Browse files
committed
undo all of those reverted changes from new server
1 parent 4bcc4d4 commit 5648ffa

38 files changed

+1953
-276
lines changed

favicon.png

8.78 KB
Loading

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
"protobufjs": "^7.3.2",
6464
"query-string": "^5.1.1",
6565
"raw-loader": "^0.5.1",
66-
"react": "^16.0.0",
66+
"react": "^16.14.0",
6767
"react-contextmenu": "2.9.4",
68-
"react-dom": "^16.0.0",
68+
"react-dom": "^16.14.0",
6969
"react-draggable": "3.0.5",
7070
"react-ga": "2.5.3",
7171
"react-intl": "2.9.0",

src/addons/addons/editor-extra-keys/userscript.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ export default async function ({ addon, msg }) {
7878
return keys;
7979
}
8080

81-
for (const opcode of ["sensing_keyoptions", "event_whenkeypressed"]) {
81+
for (const opcode of ["sensing_keyoptions", "event_whenkeypressed", "event_whenkeyhit"]) {
8282
const block = ScratchBlocks.Blocks[opcode];
8383
const originalInit = block.init;
8484
block.init = function (...args) {
8585
const originalJsonInit = this.jsonInit;
8686
this.jsonInit = function (obj) {
87-
appendKeys(obj.args0[0].options, opcode === "event_whenkeypressed");
87+
appendKeys(obj.args0[0].options, opcode === "event_whenkeypressed" || opcode === "event_whenkeyhit");
8888
return originalJsonInit.call(this, obj);
8989
};
9090
return originalInit.call(this, ...args);
@@ -97,7 +97,7 @@ export default async function ({ addon, msg }) {
9797
if (workspace && flyout) {
9898
const allBlocks = [...workspace.getAllBlocks(), ...flyout.getWorkspace().getAllBlocks()];
9999
for (const block of allBlocks) {
100-
if (block.type !== "event_whenkeypressed" && block.type !== "sensing_keyoptions") {
100+
if (block.type !== "event_whenkeypressed" && block.type !== "event_whenkeyhit" && block.type !== "sensing_keyoptions") {
101101
continue;
102102
}
103103
const input = block.inputList[0];
@@ -110,7 +110,7 @@ export default async function ({ addon, msg }) {
110110
}
111111
field.menuGenerator_ = appendKeys(
112112
defaultKeys ? [...defaultKeys] : field.menuGenerator_,
113-
block.type === "event_whenkeypressed"
113+
block.type === "event_whenkeypressed" || block.type === "event_whenkeyhit"
114114
);
115115
}
116116
}

src/addons/addons/gamepad/userscript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default async function ({ addon, console, msg }) {
3535
const result = new Set();
3636
for (const blocks of allBlocks) {
3737
for (const block of Object.values(blocks._blocks)) {
38-
if (block.opcode === "event_whenkeypressed" || block.opcode === "sensing_keyoptions") {
38+
if (block.opcode === "event_whenkeypressed" || block.opcode === "event_whenkeyhit" || block.opcode === "sensing_keyoptions") {
3939
// For blocks like "key (my variable) pressed?", the sensing_keyoptions still exists but has a null parent.
4040
if (block.opcode === "sensing_keyoptions" && !block.parent) {
4141
continue;

src/components/custom-procedures/custom-procedures.jsx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Modal from '../../containers/modal.jsx';
44
import Box from '../box/box.jsx';
55
import { defineMessages, injectIntl, intlShape, FormattedMessage } from 'react-intl';
66

7-
import plusIcon from './icon--plus.svg';
7+
import dropperIcon from './icon--dropper.svg';
88

99
import booleanInputIcon from './icon--boolean-input.svg';
1010
import textInputIcon from './icon--text-input.svg';
@@ -153,7 +153,7 @@ const BlockColorSection = props => (
153153
onChange={props.onBlockColorChange}
154154
/>
155155
<img
156-
src={plusIcon}
156+
src={dropperIcon}
157157
className={styles.customPlus}
158158
/>
159159
</div>
@@ -224,6 +224,32 @@ const CustomProcedures = props => (
224224
/>
225225
</div>
226226
</div>
227+
<div
228+
className={styles.optionCard}
229+
role="button"
230+
tabIndex="0"
231+
onClick={props.onAddCommand}
232+
style={{display: "none"}} //shhh
233+
>
234+
<img
235+
className={styles.optionIcon}
236+
src={stackBlockIcon}
237+
/>
238+
<div className={styles.optionTitle}>
239+
<FormattedMessage
240+
defaultMessage="Add an input"
241+
description="Label for button to add a command input"
242+
id="gui.customProcedures.addAnInputCommand"
243+
/>
244+
</div>
245+
<div className={styles.optionDescription}>
246+
<FormattedMessage
247+
defaultMessage="command"
248+
description="Description of the command input type"
249+
id="gui.customProcedures.commandType"
250+
/>
251+
</div>
252+
</div>
227253
<div
228254
className={styles.optionCard}
229255
role="button"
@@ -396,6 +422,7 @@ CustomProcedures.propTypes = {
396422
componentRef: PropTypes.func.isRequired,
397423
intl: intlShape,
398424
onAddBoolean: PropTypes.func.isRequired,
425+
onAddCommand: PropTypes.func.isRequired,
399426
onAddLabel: PropTypes.func.isRequired,
400427
onAddTextNumber: PropTypes.func.isRequired,
401428
onCancel: PropTypes.func.isRequired,
Lines changed: 8 additions & 0 deletions
Loading

src/components/custom-procedures/icon--plus.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/library-item/library-item.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,28 @@
3434
padding: 0.25rem;
3535
padding-bottom: 0;
3636
}
37-
.library-item-new {
37+
.library-item-sound.library-item-new {
38+
/*
39+
we have to use hue-rotate,
40+
since the waveforms have their color baked in by design
41+
& the play button styling would be annoying
42+
*/
3843
filter: hue-rotate(60deg);
3944
}
4045
.library-item-new-badge {
4146
border-radius: 1024px;
4247
color: white;
4348
font-size: 10px;
4449
font-weight: bold;
45-
background-color: $sound-primary;
50+
background-color: #EB6566;
4651
padding: 1px 5px;
4752
position: absolute;
4853
left: -8px;
4954
top: -8px;
5055
}
56+
.library-item-sound .library-item-new-badge {
57+
background-color: $sound-primary;
58+
}
5159

5260
.library-item-extension {
5361
align-self: stretch;
@@ -60,6 +68,12 @@
6068
.library-item-sound:hover {
6169
border-color: $sound-primary;
6270
}
71+
.library-item-new:hover {
72+
border-color: #EB6566;
73+
}
74+
.library-item-new.library-item-sound:hover {
75+
border-color: $sound-primary;
76+
}
6377

6478
.library-item-favorite {
6579
background: transparent;

src/components/menu-bar/share-button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ShareButton extends React.Component {
6161
}
6262
async handleMessageEvent(e) {
6363
if (!e.origin.startsWith(`https://penguinmod.com`)) {
64-
//return; // BTODO: uncomment this line for prod (also change the link)
64+
return;
6565
}
6666

6767
if (!e.data.p4) {

src/components/tw-custom-extension-modal/custom-extension-modal.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,20 @@ const CustomExtensionModal = props => (
181181
/>
182182
</p>
183183
)}
184-
<p>
185-
<FormattedMessage
186-
// eslint-disable-next-line max-len
187-
defaultMessage="Your browser may not allow PenguinMod to access certain sites. If this is causing issues for you, try loading from a file or text instead."
188-
description="Message that appears in custom extension prompt"
189-
id="pm.customExtensionModal.corsProblem"
190-
/>
191-
</p>
192184
</React.Fragment>
193185
)}
194186

187+
{props.type === 'url' && (
188+
<p>
189+
<FormattedMessage
190+
// eslint-disable-next-line max-len
191+
defaultMessage="Your browser may not allow PenguinMod to access certain sites. If this is causing issues for you, try loading from a file or text instead."
192+
description="Message that appears in custom extension prompt"
193+
id="pm.customExtensionModal.corsProblem"
194+
/>
195+
</p>
196+
)}
197+
195198
<label className={styles.checkboxContainer}>
196199
<FancyCheckbox
197200
className={styles.basicCheckbox}

0 commit comments

Comments
 (0)