Skip to content

Commit

Permalink
fix(gallery): Improve sample relevance, add robustness
Browse files Browse the repository at this point in the history
- Remove unneeded code
  • Loading branch information
mammerla committed Aug 29, 2024
1 parent e219ac6 commit 763dd54
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 175 deletions.
4 changes: 2 additions & 2 deletions app/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
},
{
"name": "cli (create)",
"cwd": "${workspaceRoot}/debugoutput/start/",
"args": ["create", "-i", "test", "custom_name", "addonStarter", "custom_creator", "florid description"],
"cwd": "${workspaceRoot}/",
"args": ["create", "-o", "debugoutput", "custom_name", "addonStarter", "custom_creator", "florid description"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
Expand Down
58 changes: 32 additions & 26 deletions app/public/data/gallery.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"gitHubFolder": "/script-box",
"localLogo": "items/fireball.png",
"id": "createExplosion",
"codeLineStart": 0,
"codeLineStart": 1,
"type": 3
},
{
Expand All @@ -172,6 +172,7 @@
"gitHubFolder": "/script-box",
"localLogo": "blocks/barrel_bottom.png",
"id": "buttonPushEvent",
"codeLineStart": 15,
"type": 3
},
{
Expand All @@ -181,6 +182,7 @@
"gitHubFolder": "/script-box",
"localLogo": "blocks/lever.png",
"id": "leverActionEvent",
"codeLineStart": 15,
"type": 3
},
{
Expand All @@ -190,6 +192,7 @@
"gitHubFolder": "/script-box",
"localLogo": "blocks/cut_copper.png",
"id": "tripWireTripEvent",
"codeLineStart": 13,
"type": 3
},
{
Expand All @@ -208,16 +211,7 @@
"gitHubFolder": "/script-box",
"localLogo": "items/fireball.png",
"id": "createNoBlockExplosion",
"type": 3
},
{
"title": "Fire Water Explosion",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "particle/particles.png",
"logoLocation": { "x": 0, "y": 24, "width": 8, "height": 8, "imageWidth": 128 },
"id": "createFireAndWaterExplosions",
"codeLineStart": 1,
"type": 3
},
{
Expand Down Expand Up @@ -245,8 +239,8 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "blocks/structure_block_data.png",
"id": "incrementProperty",
"codeLineStart": 8,
"id": "incrementDynamicProperty",
"codeLineStart": 9,
"type": 3
},
{
Expand All @@ -255,7 +249,8 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "blocks/structure_block_data.png",
"id": "incrementPropertyInJsonBlob",
"id": "incrementDynamicPropertyInJsonBlob",
"codeLineStart": 25,
"type": 3
},
{
Expand Down Expand Up @@ -310,6 +305,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/portalBg.png",
"id": "teleport",
"codeLineStart": 2,
"type": 3
},
{
Expand All @@ -319,6 +315,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/portalBg.png",
"id": "teleportMovement",
"codeLineStart": 3,
"type": 3
},
{
Expand All @@ -328,6 +325,7 @@
"gitHubFolder": "/script-box",
"localLogo": "blocks/cut_copper.png",
"id": "bounceSkeletons",
"codeLineStart": 8,
"type": 3
},
{
Expand All @@ -337,17 +335,17 @@
"gitHubFolder": "/script-box",
"localLogo": "items/name_tag.png",
"id": "tagsQuery",
"codeLineStart": 9,
"codeLineStart": 4,
"type": 3
},
{
"title": "Run Entity Spawn Event",
"title": "Portal Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "blocks/cut_copper.png",
"id": "runEntitySpawnEvent",
"codeLineStart": 5,
"id": "logEntitySpawnEvent",
"codeLineStart": 1,
"type": 3
},
{
Expand All @@ -356,7 +354,7 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "ui/promo_bee.png",
"id": "createOldHorse",
"id": "spawnAdultHorse",
"codeLineStart": 1,
"type": 3
},
Expand All @@ -376,6 +374,7 @@
"gitHubFolder": "/script-box",
"localLogo": "items/record_cat.png",
"id": "playMusicAndSound",
"codeLineStart": 1,
"type": 3
},
{
Expand All @@ -386,6 +385,7 @@
"localLogo": "particle/particles.png",
"logoLocation": { "x": 56, "y": 0, "width": 8, "height": 8, "imageWidth": 128 },
"id": "spawnParticle",
"codeLineStart": 8,
"type": 3
},
{
Expand All @@ -403,6 +403,7 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "blocks/cut_copper.png",
"codeLineStart": 5,
"id": "updateScoreboard",
"type": 3
},
Expand All @@ -421,6 +422,7 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/script-box",
"localLogo": "ui/screenshot_frame.png",
"codeLineStart": 1,
"id": "setTitleAndSubtitle",
"type": 3
},
Expand Down Expand Up @@ -449,6 +451,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/dialog_background_opaque_overlap_bottom.png",
"id": "showTranslatedMessageForm",
"codeLineStart": 1,
"type": 3
},
{
Expand All @@ -458,6 +461,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/icon_sign.png",
"id": "addSign",
"codeLineStart": 9,
"type": 3
},
{
Expand All @@ -467,6 +471,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/icon_sign.png",
"id": "addTranslatedSign",
"codeLineStart": 9,
"type": 3
},
{
Expand All @@ -485,6 +490,7 @@
"gitHubFolder": "/script-box",
"localLogo": "ui/timer.png",
"id": "trapTick",
"codeLineStart": 1,
"type": 3
},
{
Expand Down Expand Up @@ -571,7 +577,7 @@
"gitHubFolder": "/editor-script-box",
"localLogo": "items/nether_star.png",
"id": "star-brush-shape.ts",
"codeLineStart": 15,
"codeLineStart": 17,
"tags": ["editor"],
"type": 5
},
Expand All @@ -593,7 +599,7 @@
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/farmland_wet.png",
"id": "farm-generator.ts",
"codeLineStart": 43,
"codeLineStart": 41,
"tags": ["editor"],
"type": 5
},
Expand All @@ -604,7 +610,7 @@
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "goto-mark.ts",
"codeLineStart": 100,
"codeLineStart": 96,
"tags": ["editor"],
"type": 5
},
Expand All @@ -615,7 +621,7 @@
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "portal-generator.ts",
"codeLineStart": 322,
"codeLineStart": 316,
"tags": ["editor"],
"type": 5
},
Expand All @@ -625,8 +631,8 @@
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "locate-biome.ts",
"codeLineStart": 94,
"id": "simple-locate-biome.ts",
"codeLineStart": 93,
"tags": ["editor"],
"type": 5
},
Expand All @@ -637,7 +643,7 @@
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "tree-generator.ts",
"codeLineStart": 43,
"codeLineStart": 47,
"tags": ["editor"],
"type": 5
},
Expand Down
1 change: 1 addition & 0 deletions app/src/UX/ItemGallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

.ig-notFound {
padding-top: 6px;
padding-left: 6px;
}

.ig-tabButton {
Expand Down
10 changes: 0 additions & 10 deletions app/src/UX/ProjectEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export default class ProjectEditor extends Component<IProjectEditorProps, IProje
this._handleFileDrop = this._handleFileDrop.bind(this);
this._handleFileDragOut = this._handleFileDragOut.bind(this);
this._handleFileDragOver = this._handleFileDragOver.bind(this);
this._handleConvertToBedrockClick = this._handleConvertToBedrockClick.bind(this);
this._handleModeChangeRequested = this._handleModeChangeRequested.bind(this);
this._handleActionRequested = this._handleActionRequested.bind(this);
this._handleProjectItemSelected = this._handleProjectItemSelected.bind(this);
Expand Down Expand Up @@ -1763,15 +1762,6 @@ export default class ProjectEditor extends Component<IProjectEditorProps, IProje
}
}

private async _handleConvertToBedrockClick() {
if (this.props.carto.deploymentStorage === null || this.props.project === null) {
return;
}
await this._ensurePersisted();

this.props.project.convertToBedrock();
}

private async _handleInfoItemCommand(command: InfoItemCommand, item: ProjectInfoItem | IProjectUpdaterReference) {
if (command === InfoItemCommand.itemSelect && item instanceof ProjectInfoItem && item.projectItem) {
this._handleProjectItemSelected(item.projectItem, false);
Expand Down
2 changes: 1 addition & 1 deletion app/src/UX/ProjectItemEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export default class ProjectItemEditor extends Component<IProjectItemEditorProps
file.type === "geometry" ||
file.type === "vertex" ||
file.type === "fragment" ||
file.type === ".env"
file.type === "env"
) {
interior = (
<TextEditor
Expand Down
7 changes: 0 additions & 7 deletions app/src/UX/ProjectPropertyEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
import { faDice, faBinoculars } from "@fortawesome/free-solid-svg-icons";
import ConnectToGitHub from "./ConnectToGitHub";
import Utilities from "../core/Utilities";
import Log from "../core/Log";
import GitHubManager from "../github/GitHubManager";
import AppServiceProxy from "../core/AppServiceProxy";
import { ProjectEditPreference, ProjectScriptLanguage, ProjectScriptVersion } from "../app/IProjectData";
Expand Down Expand Up @@ -377,12 +376,6 @@ export default class ProjectPropertyEditor extends Component<IProjectPropertyEdi
}

async _handleCommitToGitHub() {
if (this.tentativeCommitMessage !== undefined && this.props.project.differencesFromGitHub !== undefined) {
Log.debug("Committing updates to GitHub with commit message '" + this.tentativeCommitMessage + "'");

await this.props.project.commitToGitHub(this.tentativeCommitMessage);
}

this.forceUpdate();
}

Expand Down
Loading

0 comments on commit 763dd54

Please sign in to comment.