Skip to content

Commit

Permalink
Merge pull request #456 from engaging-computing/dev
Browse files Browse the repository at this point in the history
v2.2.0 | Lights and textures
  • Loading branch information
kdvalin authored Mar 5, 2021
2 parents 812b44d + b1d217f commit e646918
Show file tree
Hide file tree
Showing 30 changed files with 2,194 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- checkout
- run:
- run:
name: Create firebase key file
command: mkdir ~/MYR/src/keys && touch ~/MYR/src/keys/firebase.js && echo -e "export const firebaseKey = \"$FIREBASE_KEY\";\nexport default firebaseKey;" > src/keys/firebase.js
# Download and cache dependencies
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ The Engaging Computing Group develops new technologies to enable learners—yout
## Status
[![CircleCI](https://circleci.com/gh/engaging-computing/MYR.svg?style=shield)](https://circleci.com/gh/engaging-computing/MYR)

## Change Log - 2.1.0 -> 2.1.1
- Updates Material UI to 4.11.2
- Add esdoc for code documentation
- Adds a dependabot configuration file so it will make usable pull requests
## Change Log - 2.1.1 -> 2.2.0
- Adds Lighting features to MYR
- Adds Texture features to MYR
- Updates copyright in the footer to be in the form `2018 - <current year>`


## Acknowledgments
Expand Down
24 changes: 9 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myr",
"version": "2.1.0",
"version": "2.2.0",
"private": false,
"engines": {
"node": "12.18.2"
Expand Down
3 changes: 3 additions & 0 deletions src/actions/courseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function fetchCourse(courseId) {
}

dispatch(loadLesson(json.lessons[0] || ""));
dispatch(sceneActions.loadSettings(json.lessons[0].settings || {}));
dispatch(render(json.lessons[0].code || ""));
dispatch(updateSavedText(json.lessons[0].code || ""));
dispatch(sceneActions.setNameDesc(
Expand Down Expand Up @@ -96,6 +97,8 @@ export function loadCourse(course) {
export function fetchLesson(json) {
return (dispatch) => {
dispatch(loadLesson(json));
dispatch(sceneActions.resetSettings());
dispatch(sceneActions.loadSettings(json.settings || {}));
dispatch(render(json.code || ""));
dispatch(updateSavedText(json.code || ""));
dispatch(sceneActions.nameScene(json.name));
Expand Down
26 changes: 22 additions & 4 deletions src/actions/sceneActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ export function loadScene(data) {
export function toggleCoordSky() {
return { type: types.TOGGLE_COORD_SKY };
}
export function toggleDefaultLight() {
return { type: types.TOGGLE_DEFAULT_LIGHT };
}
export function toggleCastShadow() {
return { type: types.TOGGLE_CAST_SHADOW };
}

export function toggleLightIndicator(){
return {type: types.TOGGLE_LIGHT_INDICATOR};
}

export function changeSkyColor(color) {
return { type: types.CHANGE_SKY_COLOR, color };
Expand Down Expand Up @@ -62,8 +72,12 @@ export function loadSettings(payload) {
return { type: types.LOAD_SETTINGS, payload };
}

export function changeSetting(payload) {
return { type: types.LOAD_SETTINGS, payload };
export function changeSettings(payload) {
return { type: types.CHANGE_SETTINGS, payload };
}

export function resetSettings() {
return { type: types.RESET_SETTINGS };
}

export function addCollectionID(payload) {
Expand Down Expand Up @@ -95,9 +109,13 @@ export default {
toggleFly,
toggleFloor,
loadSettings,
changeSetting,
changeSettings,
resetSettings,
addCollectionID,
setDesc,
setNameDesc,
removeCollectionID
removeCollectionID,
toggleDefaultLight,
toggleCastShadow,
toggleLightIndicator
};
16 changes: 16 additions & 0 deletions src/components/editor/customCompleter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import myrReference from "../../myr/reference.js";
import myrTextures from "../structural/Textures.js";

export const customCompleter = {
getCompletions: function (editor, session, pos, prefix, callback) {
Expand Down Expand Up @@ -34,10 +35,16 @@ export const customCompleter = {
"static"
];

let texture = myrTextures();
let Texture = [...texture.TexturePack.map(obj => obj.title),
"group()"
];

let reference = myrReference();
let keyWords = [...reference.geometry.map(obj => obj.name + "()"),
...reference.transformations.map(obj => obj.name + "()"),
...reference.animations.map(obj => obj.name + "()"),
...reference.lights.map(obj=>obj.name+"()"),
"group()"
];

Expand Down Expand Up @@ -218,6 +225,15 @@ export const customCompleter = {
score: 0
};
}));

callback(null, Texture.map(function (word) {
return {
caption: word,
value: word,
meta: "texture",
score: 3
};
}));
}
};

Expand Down
35 changes: 35 additions & 0 deletions src/components/layouts/TextureReference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react";
import Header from "../structural/header/Header";
import Footer from "../structural/Footer";
import TextureReferencePage from "../reference/TextureReferencePage";

import * as layoutTypes from "../../constants/LayoutTypes.js";

export const TextureReference = ({ editor, editorActions, user, authActions, scene, sceneActions, projectActions, courseActions, projects, courses, match, collectionActions, collections }) => (
<div className="App">
<Header
logging={authActions}
sceneActions={sceneActions}
actions={editorActions}
user={user}
scene={scene}
text={editor.text}
message={editor.message}
projectId={match.params.id}
match={match}
projectActions={projectActions}
courseActions={courseActions}
projects={projects}
courses={courses}
collectionActions={collectionActions}
collections={collections}
layoutType={layoutTypes.TEXTURE_REFERENCE}
/>
<div className="row no-gutters">
<TextureReferencePage />
</div>
<Footer />
</div>
);

export default TextureReference;
12 changes: 12 additions & 0 deletions src/components/reference/Reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ export default class Reference extends React.Component {
</Hidden>
}
value='d' />
<Tab
icon={<Icon className="material-icons geometry">highlight</Icon>}
label={
<Hidden xsDown>
<div>LIGHT</div>
</Hidden>
}
value='e' />
{/*<Tab
style={{ background: "green", color: "white" }}
icon={<Icon className="material-icons">open_in_new</Icon>}
Expand Down Expand Up @@ -238,6 +246,10 @@ export default class Reference extends React.Component {
<div style={{ marginTop: 0, overflow: "scroll" }}>
{this.TableEx("groups")}
</div>}
{this.state.value === "e" &&
<div style={{ marginTop: 0, overflow: "scroll" }}>
{this.TableEx("lights")}
</div>}
</Drawer>
</React.Fragment> : null}
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/components/reference/ReferencePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ export default class Reference extends React.Component {
</Hidden>
}
value='d' />
<Tab
icon={<Icon className="material-icons geometry">highlights</Icon>}
label={
<Hidden xsDown>
<div>LIGHTS</div>
</Hidden>
}
value='e' />
</Tabs>
{<div style={{ margin: 5 }}>
<p style={{ fontSize: "80%" }}> Key: <span className="array">array </span>
Expand All @@ -160,6 +168,10 @@ export default class Reference extends React.Component {
<div style={{ marginTop: 0 }}>
{this.TableEx("groups")}
</div>}
{this.state.value === "e" &&
<div style={{ marginTop: 0 }}>
{this.TableEx("lights")}
</div>}
</div>
);
}
Expand Down
Loading

0 comments on commit e646918

Please sign in to comment.