mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Add BetaIntroDialog and unfinished LocalMobileExport to newIDE
This commit is contained in:
32
newIDE/app/src/Export/LocalMobileExport.js
Normal file
32
newIDE/app/src/Export/LocalMobileExport.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import React, { Component } from 'react';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import { Column, Line, Spacer } from '../UI/Grid';
|
||||
import PlaceholderMessage from '../UI/PlaceholderMessage';
|
||||
import optionalRequire from '../Utils/OptionalRequire';
|
||||
const electron = optionalRequire('electron');
|
||||
const shell = electron ? electron.shell : null;
|
||||
|
||||
export default class LocalMobileExport extends Component {
|
||||
openURL = () => {
|
||||
shell.openExternal('https://github.com/4ian/GD');
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div style={{ height: 200 }}>
|
||||
<PlaceholderMessage>
|
||||
<Column>
|
||||
<Line>This export is not available yet!</Line>
|
||||
<Line>
|
||||
<FlatButton
|
||||
onTouchTap={this.openURL}
|
||||
primary
|
||||
label="Help by contributing on GitHub"
|
||||
/>
|
||||
</Line>
|
||||
</Column>
|
||||
</PlaceholderMessage>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
42
newIDE/app/src/MainFrame/BetaIntroDialog.js
Normal file
42
newIDE/app/src/MainFrame/BetaIntroDialog.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import React, { Component } from 'react';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import { Column, Line } from '../UI/Grid';
|
||||
import optionalRequire from '../Utils/OptionalRequire';
|
||||
const electron = optionalRequire('electron');
|
||||
const shell = electron ? electron.shell : null;
|
||||
|
||||
export default class BetaIntroDialog extends Component {
|
||||
_onOpenGithub() {
|
||||
shell.openExternal('https://github.com/4ian/GD');
|
||||
}
|
||||
|
||||
render() {
|
||||
const { open, onClose } = this.props;
|
||||
const actions = [
|
||||
<FlatButton
|
||||
label="Contribute on GitHub"
|
||||
primary={false}
|
||||
onTouchTap={this._onOpenGithub}
|
||||
/>,
|
||||
<FlatButton label="Ok" primary={true} onTouchTap={onClose} />,
|
||||
];
|
||||
|
||||
return (
|
||||
<Dialog actions={actions} modal={true} open={open}>
|
||||
<div>
|
||||
<p>
|
||||
This is a
|
||||
{' '}
|
||||
<b>beta version</b>
|
||||
{' '}
|
||||
of GDevelop 5. It is unfinished and you can only edit scenes of existing games or examples.
|
||||
</p>
|
||||
<p>
|
||||
You can still export your game to upload it online in a few clicks!
|
||||
</p>
|
||||
</div>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
}
|
@@ -5,6 +5,12 @@ import ToolbarSeparator from '../UI/ToolbarSeparator';
|
||||
import IconMenu from '../UI/Menu/IconMenu';
|
||||
import Window from '../Utils/Window';
|
||||
|
||||
const styles = {
|
||||
toolbar: {
|
||||
flexShrink: 0,
|
||||
},
|
||||
};
|
||||
|
||||
export default class MainFrameToolbar extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
@@ -23,7 +29,7 @@ export default class MainFrameToolbar extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Toolbar>
|
||||
<Toolbar style={styles.toolbar}>
|
||||
<ToolbarGroup firstChild={true}>
|
||||
{this.props.showProjectIcons &&
|
||||
<ToolbarIcon
|
||||
|
@@ -44,6 +44,7 @@ export default class MainFrame extends Component {
|
||||
this.state = {
|
||||
createDialogOpen: false,
|
||||
exportDialogOpen: false,
|
||||
introDialogOpen: false,
|
||||
loadingProject: false,
|
||||
previewLoading: false,
|
||||
currentProject: null,
|
||||
@@ -55,6 +56,7 @@ export default class MainFrame extends Component {
|
||||
|
||||
componentWillMount() {
|
||||
if (!this.props.integratedEditor) this.openStartPage();
|
||||
if (this.props.introDialog) this._openIntroDialog(true);
|
||||
}
|
||||
|
||||
loadFullProject = (serializedProject, cb) => {
|
||||
@@ -319,6 +321,12 @@ export default class MainFrame extends Component {
|
||||
});
|
||||
};
|
||||
|
||||
_openIntroDialog = (open = true) => {
|
||||
this.setState({
|
||||
introDialogOpen: open,
|
||||
});
|
||||
};
|
||||
|
||||
_onChangeEditorTab = value => {
|
||||
this.setState({
|
||||
editorTabs: changeCurrentTab(this.state.editorTabs, value),
|
||||
@@ -349,7 +357,7 @@ export default class MainFrame extends Component {
|
||||
const {
|
||||
currentProject,
|
||||
} = this.state;
|
||||
const { exportDialog, createDialog } = this.props;
|
||||
const { exportDialog, createDialog, introDialog } = this.props;
|
||||
const showLoader = this.state.loadingProject ||
|
||||
this.state.previewLoading ||
|
||||
this.props.loading;
|
||||
@@ -428,6 +436,11 @@ export default class MainFrame extends Component {
|
||||
this._openFromFile(filepath);
|
||||
},
|
||||
})}
|
||||
{!!introDialog &&
|
||||
React.cloneElement(introDialog, {
|
||||
open: this.state.introDialogOpen,
|
||||
onClose: () => this._openIntroDialog(false),
|
||||
})}
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
</DragDropContextProvider>
|
||||
|
@@ -10,64 +10,64 @@ var client = new Keen({
|
||||
writeKey: 'B917F1DB50EE4C8949DBB374D2962845A22838B425AA43322A37138691A5270EB0358AEE45A4F61AFA7713B9765B4980517A1E276D4973A2E546EA851BF7757523706367ED430C041D2728A63BF61B5D1B2079C75E455DDDFAAC4324128AC2DB',
|
||||
});
|
||||
|
||||
client.extendEvents(function(){
|
||||
return {
|
||||
page: {
|
||||
title: document.title,
|
||||
url: document.location.href
|
||||
// info: {} (add-on)
|
||||
},
|
||||
referrer: {
|
||||
url: document.referrer
|
||||
// info: {} (add-on)
|
||||
},
|
||||
tech: {
|
||||
browser: Keen.helpers.getBrowserProfile(),
|
||||
// info: {} (add-on)
|
||||
ip: '${keen.ip}',
|
||||
ua: '${keen.user_agent}'
|
||||
},
|
||||
time: Keen.helpers.getDatetimeIndex(),
|
||||
visitor: {
|
||||
id: sessionCookie.get('user_id'),
|
||||
time_on_page: sessionTimer.value()
|
||||
},
|
||||
// geo: {} (add-on)
|
||||
keen: {
|
||||
timestamp: new Date().toISOString(),
|
||||
addons: [
|
||||
{
|
||||
name: 'keen:ip_to_geo',
|
||||
input: {
|
||||
ip: 'tech.ip'
|
||||
},
|
||||
output: 'geo'
|
||||
},
|
||||
{
|
||||
name: 'keen:ua_parser',
|
||||
input: {
|
||||
ua_string: 'tech.ua'
|
||||
},
|
||||
output: 'tech.info'
|
||||
},
|
||||
{
|
||||
name: 'keen:url_parser',
|
||||
input: {
|
||||
url: 'page.url'
|
||||
},
|
||||
output: 'page.info'
|
||||
},
|
||||
{
|
||||
name: 'keen:referrer_parser',
|
||||
input: {
|
||||
page_url: 'page.url',
|
||||
referrer_url: 'referrer.url'
|
||||
},
|
||||
output: 'referrer.info'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
client.extendEvents(function() {
|
||||
return {
|
||||
page: {
|
||||
title: document.title,
|
||||
url: document.location.href,
|
||||
// info: {} (add-on)
|
||||
},
|
||||
referrer: {
|
||||
url: document.referrer,
|
||||
// info: {} (add-on)
|
||||
},
|
||||
tech: {
|
||||
browser: Keen.helpers.getBrowserProfile(),
|
||||
// info: {} (add-on)
|
||||
ip: '${keen.ip}', // eslint-disable-line
|
||||
ua: '${keen.user_agent}', // eslint-disable-line
|
||||
},
|
||||
time: Keen.helpers.getDatetimeIndex(),
|
||||
visitor: {
|
||||
id: sessionCookie.get('user_id'),
|
||||
time_on_page: sessionTimer.value(),
|
||||
},
|
||||
// geo: {} (add-on)
|
||||
keen: {
|
||||
timestamp: new Date().toISOString(),
|
||||
addons: [
|
||||
{
|
||||
name: 'keen:ip_to_geo',
|
||||
input: {
|
||||
ip: 'tech.ip',
|
||||
},
|
||||
output: 'geo',
|
||||
},
|
||||
{
|
||||
name: 'keen:ua_parser',
|
||||
input: {
|
||||
ua_string: 'tech.ua',
|
||||
},
|
||||
output: 'tech.info',
|
||||
},
|
||||
{
|
||||
name: 'keen:url_parser',
|
||||
input: {
|
||||
url: 'page.url',
|
||||
},
|
||||
output: 'page.info',
|
||||
},
|
||||
{
|
||||
name: 'keen:referrer_parser',
|
||||
input: {
|
||||
page_url: 'page.url',
|
||||
referrer_url: 'referrer.url',
|
||||
},
|
||||
output: 'referrer.info',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export const sendProgramOpening = () => {
|
||||
@@ -76,11 +76,11 @@ export const sendProgramOpening = () => {
|
||||
client.recordEvent('program_opening');
|
||||
};
|
||||
|
||||
export const sendNewGameCreated = (templateName) => {
|
||||
export const sendNewGameCreated = templateName => {
|
||||
if (isDev) return;
|
||||
|
||||
client.recordEvent('new_game_creation', {
|
||||
platform: 'GDevelop JS Platform', // Hardcoded here for now
|
||||
templateName,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import MainFrame from './MainFrame';
|
||||
import BetaIntroDialog from './MainFrame/BetaIntroDialog';
|
||||
import Window from './Utils/Window';
|
||||
import ExportDialog from './Export/ExportDialog';
|
||||
import { sendProgramOpening } from './Utils/Analytics/EventSender';
|
||||
@@ -14,6 +15,7 @@ import optionalRequire from './Utils/OptionalRequire.js';
|
||||
import LocalPreviewLauncher from './Export/LocalPreviewLauncher';
|
||||
import LocalExport from './Export/LocalExport';
|
||||
import LocalS3Export from './Export/LocalS3Export';
|
||||
import LocalMobileExport from './Export/LocalMobileExport';
|
||||
import LocalCreateDialog from './ProjectCreation/LocalCreateDialog';
|
||||
const electron = optionalRequire('electron');
|
||||
|
||||
@@ -47,8 +49,13 @@ if (electron) {
|
||||
}, {
|
||||
name: 'Export to a folder',
|
||||
ExportComponent: LocalExport
|
||||
}, {
|
||||
name: 'Export to iOS/Android app',
|
||||
ExportComponent: LocalMobileExport
|
||||
}]} />}
|
||||
createDialog={<LocalCreateDialog />}
|
||||
createDialog={<LocalCreateDialog />
|
||||
}
|
||||
introDialog={<BetaIntroDialog />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import LocalCreateDialog from '../ProjectCreation/LocalCreateDialog';
|
||||
import { Tabs, Tab } from '../UI/Tabs';
|
||||
import LocalFolderPicker from '../UI/LocalFolderPicker';
|
||||
import LocalExport from '../Export/LocalExport';
|
||||
import LocalMobileExport from '../Export/LocalMobileExport';
|
||||
import LocalS3Export from '../Export/LocalS3Export';
|
||||
import Paper from 'material-ui/Paper';
|
||||
import muiDecorator from './MuiDecorator';
|
||||
@@ -87,6 +88,14 @@ storiesOf('LocalS3Export', module)
|
||||
</Paper>
|
||||
));
|
||||
|
||||
storiesOf('LocalMobileExport', module)
|
||||
.addDecorator(muiDecorator)
|
||||
.add('default', () => (
|
||||
<Paper>
|
||||
<LocalMobileExport />
|
||||
</Paper>
|
||||
));
|
||||
|
||||
storiesOf('LocalFolderPicker', module)
|
||||
.addDecorator(muiDecorator)
|
||||
.add('default', () => (
|
||||
|
@@ -52,6 +52,7 @@ app.on('ready', function() {
|
||||
}
|
||||
|
||||
mainWindow = new BrowserWindow(options);
|
||||
if (!isIntegrated) mainWindow.maximize();
|
||||
|
||||
//Expose program arguments
|
||||
global['args'] = args;
|
||||
@@ -64,7 +65,7 @@ app.on('ready', function() {
|
||||
} else {
|
||||
// Production (with npm run build)
|
||||
mainWindow.loadURL('file://' + __dirname + '/www/index.html');
|
||||
if (true || devTools) mainWindow.openDevTools();
|
||||
if (devTools) mainWindow.openDevTools();
|
||||
}
|
||||
|
||||
// Emitted when the window is closed.
|
||||
|
Reference in New Issue
Block a user