Skip to content

Commit

Permalink
add Eureka support :0
Browse files Browse the repository at this point in the history
  • Loading branch information
nmsderp authored Mar 8, 2024
1 parent 7fdcb33 commit 358875e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/containers/blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import DragConstants from '../lib/drag-constants';
import defineDynamicBlock from '../lib/define-dynamic-block';
import AddonHooks from '../addons/hooks';
import LoadScratchBlocksHOC from '../lib/tw-load-scratch-blocks-hoc.jsx';
import eurekaloader from './bp-eureka-loader.js';

import {connect} from 'react-redux';
import {updateToolbox} from '../reducers/toolbox';
Expand Down Expand Up @@ -167,6 +168,7 @@ class Blocks extends React.Component {
for (const category of this.props.vm.runtime._blockInfo) {
this.handleExtensionAdded(category);
}
eurekaloader.load();
}
shouldComponentUpdate (nextProps, nextState) {
return (
Expand Down
17 changes: 17 additions & 0 deletions src/containers/bp-eureka-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// this was made by dumo i yoinked it from https://github.com/thepython555/ba4x-player

let injected = false;

const load = () => {
if (injected) return;
injected = true;

const script = document.createElement('script');
script.src = `/Eureka-7.js`;

document.head.appendChild(script);
};

export default {
load
}
33 changes: 33 additions & 0 deletions static/Eureka-7.js

Large diffs are not rendered by default.

0 comments on commit 358875e

Please sign in to comment.