Skip to content

Commit db3887b

Browse files
committed
Resolved merge conflict
2 parents dacdab3 + 0f47a5a commit db3887b

25 files changed

Lines changed: 2153 additions & 105 deletions

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- checkout
17-
- run:
17+
- run:
1818
name: Create firebase key file
1919
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
2020
# Download and cache dependencies

src/actions/sceneActions.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ export function loadScene(data) {
2525
export function toggleCoordSky() {
2626
return { type: types.TOGGLE_COORD_SKY };
2727
}
28+
export function toggleDefaultLight() {
29+
return { type: types.TOGGLE_DEFAULT_LIGHT };
30+
}
31+
export function toggleCastShadow() {
32+
return { type: types.TOGGLE_CAST_SHADOW };
33+
}
34+
35+
export function toggleLightIndicator(){
36+
return {type: types.TOGGLE_LIGHT_INDICATOR};
37+
}
2838

2939
export function changeSkyColor(color) {
3040
return { type: types.CHANGE_SKY_COLOR, color };
@@ -104,5 +114,8 @@ export default {
104114
addCollectionID,
105115
setDesc,
106116
setNameDesc,
107-
removeCollectionID
117+
removeCollectionID,
118+
toggleDefaultLight,
119+
toggleCastShadow,
120+
toggleLightIndicator
108121
};

src/components/editor/customCompleter.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import myrReference from "../../myr/reference.js";
2+
import myrTextures from "../structural/Textures.js";
23

34
export const customCompleter = {
45
getCompletions: function (editor, session, pos, prefix, callback) {
@@ -34,10 +35,16 @@ export const customCompleter = {
3435
"static"
3536
];
3637

38+
let texture = myrTextures();
39+
let Texture = [...texture.TexturePack.map(obj => obj.title),
40+
"group()"
41+
];
42+
3743
let reference = myrReference();
3844
let keyWords = [...reference.geometry.map(obj => obj.name + "()"),
3945
...reference.transformations.map(obj => obj.name + "()"),
4046
...reference.animations.map(obj => obj.name + "()"),
47+
...reference.lights.map(obj=>obj.name+"()"),
4148
"group()"
4249
];
4350

@@ -218,6 +225,15 @@ export const customCompleter = {
218225
score: 0
219226
};
220227
}));
228+
229+
callback(null, Texture.map(function (word) {
230+
return {
231+
caption: word,
232+
value: word,
233+
meta: "texture",
234+
score: 3
235+
};
236+
}));
221237
}
222238
};
223239

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from "react";
2+
import Header from "../structural/header/Header";
3+
import Footer from "../structural/Footer";
4+
import TextureReferencePage from "../reference/TextureReferencePage";
5+
6+
import * as layoutTypes from "../../constants/LayoutTypes.js";
7+
8+
export const TextureReference = ({ editor, editorActions, user, authActions, scene, sceneActions, projectActions, courseActions, projects, courses, match, collectionActions, collections }) => (
9+
<div className="App">
10+
<Header
11+
logging={authActions}
12+
sceneActions={sceneActions}
13+
actions={editorActions}
14+
user={user}
15+
scene={scene}
16+
text={editor.text}
17+
message={editor.message}
18+
projectId={match.params.id}
19+
match={match}
20+
projectActions={projectActions}
21+
courseActions={courseActions}
22+
projects={projects}
23+
courses={courses}
24+
collectionActions={collectionActions}
25+
collections={collections}
26+
layoutType={layoutTypes.TEXTURE_REFERENCE}
27+
/>
28+
<div className="row no-gutters">
29+
<TextureReferencePage />
30+
</div>
31+
<Footer />
32+
</div>
33+
);
34+
35+
export default TextureReference;

src/components/reference/Reference.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ export default class Reference extends React.Component {
196196
</Hidden>
197197
}
198198
value='d' />
199+
<Tab
200+
icon={<Icon className="material-icons geometry">highlight</Icon>}
201+
label={
202+
<Hidden xsDown>
203+
<div>LIGHT</div>
204+
</Hidden>
205+
}
206+
value='e' />
199207
{/*<Tab
200208
style={{ background: "green", color: "white" }}
201209
icon={<Icon className="material-icons">open_in_new</Icon>}
@@ -238,6 +246,10 @@ export default class Reference extends React.Component {
238246
<div style={{ marginTop: 0, overflow: "scroll" }}>
239247
{this.TableEx("groups")}
240248
</div>}
249+
{this.state.value === "e" &&
250+
<div style={{ marginTop: 0, overflow: "scroll" }}>
251+
{this.TableEx("lights")}
252+
</div>}
241253
</Drawer>
242254
</React.Fragment> : null}
243255
</div>

src/components/reference/ReferencePage.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ export default class Reference extends React.Component {
135135
</Hidden>
136136
}
137137
value='d' />
138+
<Tab
139+
icon={<Icon className="material-icons geometry">highlights</Icon>}
140+
label={
141+
<Hidden xsDown>
142+
<div>LIGHTS</div>
143+
</Hidden>
144+
}
145+
value='e' />
138146
</Tabs>
139147
{<div style={{ margin: 5 }}>
140148
<p style={{ fontSize: "80%" }}> Key: <span className="array">array </span>
@@ -160,6 +168,10 @@ export default class Reference extends React.Component {
160168
<div style={{ marginTop: 0 }}>
161169
{this.TableEx("groups")}
162170
</div>}
171+
{this.state.value === "e" &&
172+
<div style={{ marginTop: 0 }}>
173+
{this.TableEx("lights")}
174+
</div>}
163175
</div>
164176
);
165177
}
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
import React from "react";
2+
import myrReference from "../../myr/textureReference";
3+
4+
import * as layoutTypes from "../../constants/LayoutTypes";
5+
6+
import {
7+
Tabs,
8+
Tab,
9+
IconButton,
10+
Drawer,
11+
Icon,
12+
Table,
13+
TableBody,
14+
TableHead,
15+
TableRow,
16+
TableCell,
17+
Tooltip,
18+
Hidden
19+
} from "@material-ui/core";
20+
21+
const exitBtnStyle = {
22+
//paddingbottom: 100,
23+
position: "fixed",
24+
top: 0,
25+
right: 10,
26+
};
27+
const newTabStyle = {
28+
position: "fixed",
29+
top: 0,
30+
right: 50,
31+
};
32+
export default class TextureReference extends React.Component {
33+
34+
constructor(props) {
35+
super(props);
36+
this.state = {
37+
value: "a",
38+
};
39+
this.tableData = myrReference();
40+
}
41+
42+
handleChange = (event, value) => {
43+
this.setState({ value });
44+
};
45+
46+
TableEx = (category) => {
47+
48+
return (
49+
<Table >
50+
<TableHead >
51+
<TableRow>
52+
<TableCell>Name</TableCell>
53+
<TableCell>Description</TableCell>
54+
<TableCell className='refExample'>Example</TableCell>
55+
</TableRow>
56+
</TableHead>
57+
<TableBody >
58+
{this.tableData[category].map((row, index) => (
59+
<TableRow key={index}>
60+
<TableCell >{row.name}</TableCell>
61+
<TableCell >{row.description}</TableCell>
62+
<TableCell >{this.exampleHelper(row.example)}</TableCell>
63+
</TableRow>
64+
))}
65+
</TableBody>
66+
</Table>
67+
);
68+
};
69+
70+
render() {
71+
const style = {
72+
margin: 2,
73+
padding: 0,
74+
color: "#fff",
75+
};
76+
const isDisabled = this.props.layoutType === layoutTypes.REFERENCE;
77+
return (
78+
<div>
79+
{!isDisabled ?
80+
<React.Fragment>
81+
<Tooltip title="Reference" placement="bottom-start">
82+
<IconButton
83+
id="ref-btn"
84+
className="header-btn d-none d-md-block"
85+
aria-haspopup="true"
86+
onClick={this.props.handleReferenceToggle}
87+
style={style}>
88+
<Icon style={{ color: "#fff" }} className="material-icons">help</Icon>
89+
</IconButton>
90+
</Tooltip>
91+
<Drawer
92+
style={{ position: "relative", zIndex: 100 }}
93+
anchor="right"
94+
id="reference-drawer"
95+
variant="persistent"
96+
className={!this.props.referenceOpen ? "d-none" : ""}
97+
open={this.props.referenceOpen}>
98+
99+
<div>
100+
<h3 className="border-bottom" style={{ padding: 10, fontWeight: 400 }}>MYR API - Reference</h3>
101+
<IconButton
102+
color="default"
103+
style={exitBtnStyle}
104+
onClick={() => {
105+
this.props.handleReferenceToggle();
106+
this.setState({ value: "a" });
107+
}}>
108+
<Icon className="material-icons">close</Icon>
109+
</IconButton>
110+
<IconButton
111+
color="default"
112+
style={newTabStyle}
113+
onClick={this.handleOpen}>
114+
<Icon className="material-icons">open_in_new</Icon>
115+
</IconButton>
116+
</div>
117+
118+
<div>
119+
<Tabs
120+
id="textureReference-tabs"
121+
fullWidth={true}
122+
value={this.state.value}
123+
onChange={this.handleChange}
124+
variant="scrollable">
125+
<Tab
126+
icon={<Icon className="material-icons geometry">category</Icon>}
127+
label={
128+
<Hidden xsDown>
129+
<div>GEOMETRY</div>
130+
</Hidden>
131+
}
132+
value='a' />
133+
<Tab
134+
icon={<Icon className="material-icons color-change">bubble_chart</Icon>}
135+
label={
136+
<Hidden xsDown>
137+
<div>TRANSFORMATIONS</div>
138+
</Hidden>
139+
}
140+
value='b' />
141+
<Tab
142+
icon={<Icon className="material-icons animation-ref">zoom_out_map</Icon>} //swap_horiz control_camera category
143+
label={
144+
<Hidden xsDown>
145+
<div>ANIMATIONS</div>
146+
</Hidden>
147+
}
148+
value='c' />
149+
<Tab
150+
icon={<Icon className="material-icons geometry">widgets</Icon>}
151+
label={
152+
<Hidden xsDown>
153+
<div>GROUPS</div>
154+
</Hidden>
155+
}
156+
value='d' />
157+
{/*<Tab
158+
style={{ background: "green", color: "white" }}
159+
icon={<Icon className="material-icons">open_in_new</Icon>}
160+
label="OPEN IN NEW TAB"
161+
value='n'
162+
onClick={this.handleOpen} />
163+
<Tab
164+
style={{ background: "red", color: "white" }}
165+
icon={<Icon className="material-icons">close</Icon>}
166+
label="CLOSE"
167+
value='x'
168+
onClick={() => {
169+
this.props.handleReferenceToggle();
170+
this.setState({ value: "a" });
171+
}} />*/}
172+
</Tabs>
173+
</div>
174+
175+
{<div style={{ margin: 7, overflow: "hidden" }}>
176+
<p style={{ fontSize: "80%" }}> Key: <span className="array">array </span>
177+
<span className="bool">bool </span>
178+
<span className="number">number </span>
179+
<span className="string">string </span>
180+
<span className="group">group </span>
181+
<span className="data">data</span></p>
182+
</div>}
183+
{this.state.value === "a" &&
184+
<div style={{ marginTop: 0, overflow: "scroll" }}>
185+
{this.TableEx("geometry")}
186+
</div>}
187+
{this.state.value === "b" &&
188+
<div style={{ marginTop: 0, overflow: "scroll" }}>
189+
{this.TableEx("transformations")}
190+
</div>}
191+
{this.state.value === "c" &&
192+
<div style={{ marginTop: 0, overflow: "scroll" }}>
193+
{this.TableEx("animations")}
194+
</div>}
195+
{this.state.value === "d" &&
196+
<div style={{ marginTop: 0, overflow: "scroll" }}>
197+
{this.TableEx("groups")}
198+
</div>}
199+
</Drawer>
200+
</React.Fragment> : null}
201+
</div>
202+
);
203+
}
204+
}

0 commit comments

Comments
 (0)