Merge pull request #347 from 4ian/new-ide

Experimental new IDE (scene editor only) based on React, Emscripten, Electron and Pixi.js
This commit is contained in:
Florian Rival
2017-06-03 19:21:23 +02:00
committed by GitHub
325 changed files with 21483 additions and 1500 deletions

1
.gitignore vendored
View File

@@ -56,6 +56,7 @@ Binaries/Packaging/logs
/Binaries/**/JsPlatform/Runtime
/Binaries/**/JsPlatform/*.dll
/Binaries/**/JsPlatform/*.dll.a
/Binaries/Output/Release_Windows/newIDE
*.autosave
/Binaries/Output/libGD.js/Release
/Binaries/Output/libGD.js/Debug

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

View File

@@ -261,18 +261,12 @@ gd::String EventsCodeGenerator::GenerateConditionCode(gd::Instruction & conditio
&& find_if(scene.GetObjectGroups().begin(), scene.GetObjectGroups().end(), bind2nd(gd::GroupHasTheSameName(), objectInParameter) ) == scene.GetObjectGroups().end()
&& find_if(project.GetObjectGroups().begin(), project.GetObjectGroups().end(), bind2nd(gd::GroupHasTheSameName(), objectInParameter) ) == project.GetObjectGroups().end() )
{
cout << "Bad object (" << objectInParameter << ") in a parameter of a condition " << condition.GetType() << endl;
condition.SetParameter(pNb, gd::Expression(""));
condition.SetType("");
}
else if ( !instrInfos.parameters[pNb].supplementaryInformation.empty()
&& gd::GetTypeOfObject(project, scene, objectInParameter) != instrInfos.parameters[pNb].supplementaryInformation )
{
cout << "Bad object type in a parameter of a condition " << condition.GetType() << endl;
cout << "Condition wanted " << instrInfos.parameters[pNb].supplementaryInformation << endl;
cout << "Condition wanted " << instrInfos.parameters[pNb].supplementaryInformation << " of type " << instrInfos.parameters[pNb].supplementaryInformation << endl;
cout << "Condition has received " << objectInParameter << " of type " << gd::GetTypeOfObject(project, scene, objectInParameter) << endl;
condition.SetParameter(pNb, gd::Expression(""));
condition.SetType("");
}
@@ -407,17 +401,12 @@ gd::String EventsCodeGenerator::GenerateActionCode(gd::Instruction & action, Eve
&& find_if(scene.GetObjectGroups().begin(), scene.GetObjectGroups().end(), bind2nd(gd::GroupHasTheSameName(), objectInParameter) ) == scene.GetObjectGroups().end()
&& find_if(project.GetObjectGroups().begin(), project.GetObjectGroups().end(), bind2nd(gd::GroupHasTheSameName(), objectInParameter) ) == project.GetObjectGroups().end() )
{
cout << "Bad object (" << objectInParameter << ") in a parameter of an action " << action.GetType() << endl;
action.SetParameter(pNb, gd::Expression(""));
action.SetType("");
}
else if ( !instrInfos.parameters[pNb].supplementaryInformation.empty()
&& gd::GetTypeOfObject(project, scene, objectInParameter) != instrInfos.parameters[pNb].supplementaryInformation )
{
cout << "Bad object type in parameter "+gd::String::From(pNb)+" of an action " << action.GetType() << endl;
cout << "Action wanted " << instrInfos.parameters[pNb].supplementaryInformation << " of type " << instrInfos.parameters[pNb].supplementaryInformation << endl;
cout << "Action has received " << objectInParameter << " of type " << gd::GetTypeOfObject(project, scene, objectInParameter) << endl;
action.SetParameter(pNb, gd::Expression(""));
action.SetType("");
}

View File

@@ -46,7 +46,7 @@ size_t ExpressionParser::GetMaximalParametersNumber(const std::vector < gd::Para
}
/**
* Add blank parameters when code-only parameters are excepted.
* Add blank parameters when code-only parameters are expected.
* \param Parameters information
* \param vector of parameters without code only parameters.
*/
@@ -100,7 +100,7 @@ bool ExpressionParser::ValidSyntax(const gd::String & str)
{
if ( requestNumber )
{
firstErrorStr = _("Number excepted");
firstErrorStr = _("Number expected");
return false;
}
@@ -165,7 +165,7 @@ bool ExpressionParser::ValidSyntax(const gd::String & str)
{
if ( requestNumber )
{
firstErrorStr = _("Number excepted");
firstErrorStr = _("Number expected");
return false;
}
@@ -206,7 +206,7 @@ bool ExpressionParser::ValidSyntax(const gd::String & str)
{
if ( requestNumber )
{
firstErrorStr = _("Number excepted");
firstErrorStr = _("Number expected");
return false;
}
@@ -241,7 +241,7 @@ bool ExpressionParser::ValidSyntax(const gd::String & str)
{
if ( requestNumber )
{
firstErrorStr = _("Number excepted");
firstErrorStr = _("Number expected");
return false;
}
@@ -283,7 +283,7 @@ bool ExpressionParser::ValidSyntax(const gd::String & str)
}
else if ( requestNumber )
{
firstErrorStr = _("Number excepted");
firstErrorStr = _("Number expected");
return false;
}
@@ -452,7 +452,7 @@ bool ExpressionParser::ParseMathExpression(const gd::Platform & platform, const
firstErrorPos = functionNameEnd;
firstErrorStr = _("Incorrect number of parameters");
firstErrorStr += " ";
firstErrorStr += _("Excepted ( maximum ) :");
firstErrorStr += _("Expected (maximum) :");
firstErrorStr += gd::String::From(GetMaximalParametersNumber(instructionInfos.parameters));
return false;

View File

@@ -161,6 +161,7 @@ void EventsListSerialization::UpdateInstructionsFromGD2x(gd::Project & project,
void EventsListSerialization::UnserializeEventsFrom(gd::Project & project, EventsList & list, const SerializerElement & events)
{
list.Clear();
events.ConsiderAsArrayOf("event", "Event");
for(std::size_t i = 0; i<events.GetChildrenCount(); ++i)
{

View File

@@ -66,7 +66,23 @@ public:
*/
bool HasNoDirections() const;
bool useMultipleDirections;
/**
* \brief Return true if the animation is composed of more than one direction.
*
* By default, an animation is composed of a single direction, and the sprite
* is rotated.
*/
bool UseMultipleDirections() const { return useMultipleDirections; }
/**
* \brief Set if the animation is using more than one direction.
*
* By default, an animation is composed of a single direction, and the sprite
* is rotated.
*/
void SetUseMultipleDirections(bool enable) { useMultipleDirections = enable; }
bool useMultipleDirections; ///< deprecated This should be moved to class private members
private:
std::vector < Direction > directions;

View File

@@ -0,0 +1,70 @@
/*
* GDevelop Core
* Copyright 2008-2015 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#include <wx/utils.h>
#include <wx/process.h>
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Serialization/Serializer.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/IDE/AbstractFileSystem.h"
#include "GDCore/IDE/Dialogs/ExternalEditor/ExternalEditorBridge.h"
#include "GDCore/IDE/Dialogs/ExternalEditor/ExternalEditor.h"
#include "GDCore/Tools/Localization.h"
#include "GDCore/Tools/Log.h"
namespace gd {
gd::String GetExternalGDevelopIDEExecutable()
{
#if defined(WINDOWS)
return "\"./newIDE/GDevelop IDE.exe\" .";
#elif defined(MACOS)
return "\"./newIDE/GDevelop IDE.app/Contents/MacOS/GDevelop IDE\" .";
#elif defined(LINUX)
return "\"./newIDE/GDevelop IDE\" .";
#endif
return "";
}
bool ExternalEditor::Launch(const gd::String & editorName, const gd::String editedElementName)
{
unsigned int port = editorBridge.Start();
if (port == 0)
{
LogError(_("Unable to launch the external events editor (unable to start the internal server)."));
return false;
}
String cmd = GetExternalGDevelopIDEExecutable();
// Uncomment and adapt to launch a local development version of the GDevelop IDE:
// cmd = "/Users/florian/Projects/F/GD/newIDE/electron-app/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron /Users/florian/Projects/F/GD/newIDE/electron-app/app";
cmd += " --mode=integrated";
if (editorName != "") cmd += " --editor " + editorName;
if (editedElementName != "") cmd += " --edited-element-name \"" + editedElementName + "\"";
if (launchWidth != 0 && launchHeight != 0)
{
cmd += " --x " + String::From(launchX) + " --y " + String::From(launchY)
+ " --width " + String::From(launchWidth) + " --height " + String::From(launchHeight);
}
std::cout << cmd << std::endl;
externalEditorPid = wxExecute(cmd + " --server-port " + String::From(port), wxEXEC_ASYNC);
if (externalEditorPid == 0 || externalEditorPid == -1)
{
LogError(_("Unable to launch the external editor."));
return false;
}
// The external editor is launched and can now connect to this editor using the given port
std::cout << "External editor launched with PID: " << externalEditorPid << std::endl;
return true;
}
}
#endif

View File

@@ -0,0 +1,156 @@
/*
* GDevelop Core
* Copyright 2008-2015 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#ifndef GDCORE_EXTNERALEDITOR_H
#define GDCORE_EXTNERALEDITOR_H
#include <wx/utils.h>
#include <wx/process.h>
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Serialization/Serializer.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/IDE/AbstractFileSystem.h"
#include "GDCore/IDE/Dialogs/ExternalEditor/ExternalEditorBridge.h"
namespace gd {
class GD_CORE_API ExternalEditor {
public:
ExternalEditor() :
externalEditorPid(0),
launchX(0),
launchY(0),
launchWidth(0),
launchHeight(0),
dirty(true),
hasReceivedFirstMessage(false)
{
editorBridge.OnReceive([this](gd::String cmd, gd::SerializerElement object, gd::String scope) {
if (!hasReceivedFirstMessage)
{
hasReceivedFirstMessage = true;
if (onLaunchedCb) onLaunchedCb();
}
if (cmd == "update")
{
if (onUpdateReceivedCb) onUpdateReceivedCb(object, scope);
}
else if (cmd == "requestUpdate")
SendUpdate(scope);
else if (cmd == "requestForcedUpdate")
SendUpdate(scope, true);
else if (cmd == "requestPreview") {
if (onLaunchPreviewCb) onLaunchPreviewCb();
} else if (cmd == "editObject") {
if (onEditObjectCb) onEditObjectCb(object.GetValue().GetString());
} else
std::cout << "Received message with unknown command: \"" << cmd << "\"" << std::endl;
});
}
~ExternalEditor()
{
if (externalEditorPid != 0 && externalEditorPid != 1) {
wxProcess::Kill(externalEditorPid);
}
}
void OnUpdateReceived(std::function<void(SerializerElement object, gd::String scope)> cb)
{
onUpdateReceivedCb = cb;
}
void OnSendUpdate(std::function<SerializerElement(gd::String scope)> cb)
{
onSendUpdateCb = cb;
}
void OnLaunchPreview(std::function<void()> cb)
{
onLaunchPreviewCb = cb;
}
void OnEditObject(std::function<void(const gd::String & objectName)> cb)
{
onEditObjectCb = cb;
}
void OnLaunched(std::function<void()> cb)
{
onLaunchedCb = cb;
}
bool Launch(const gd::String & editorName, const gd::String editedElementName);
void Hide(bool forceHide = false)
{
gd::SerializerElement payload;
payload.AddChild("forceHide").SetValue(forceHide);
editorBridge.Send("hide", payload);
}
void Show()
{
gd::SerializerElement emptyPayload;
editorBridge.Send("show", emptyPayload);
}
void SetBounds(int x, int y, int width, int height)
{
gd::SerializerElement bounds;
bounds.SetAttribute("x", x);
bounds.SetAttribute("y", y);
bounds.SetAttribute("width", width);
bounds.SetAttribute("height", height);
editorBridge.Send("setBounds", bounds);
}
void SetLaunchBounds(int x, int y, int width, int height)
{
launchX = x;
launchY = y;
launchWidth = width;
launchHeight = height;
}
bool IsLaunchedAndConnected() {
return editorBridge.IsConnected();
}
void SetDirty() { dirty = true; }
private:
bool SendUpdate(gd::String scope = "", bool forcedUpdate = false)
{
if (!onSendUpdateCb) return false;
if (!dirty && !forcedUpdate) return true;
dirty = false;
return editorBridge.Send("update", onSendUpdateCb(scope), scope);
}
ExternalEditorBridge editorBridge;
int externalEditorPid;
std::function<void(SerializerElement object, gd::String scope)> onUpdateReceivedCb;
std::function<SerializerElement(gd::String scope)> onSendUpdateCb;
std::function<void()> onLaunchPreviewCb;
std::function<void(const gd::String & objectName)> onEditObjectCb;
std::function<void()> onLaunchedCb;
int launchX;
int launchY;
int launchWidth;
int launchHeight;
bool dirty;
bool hasReceivedFirstMessage;
};
}
#endif
#endif

View File

@@ -0,0 +1,238 @@
/*
* GDevelop Core
* Copyright 2008-2015 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#ifndef GDCORE_EXTNERALEDITORBRIDGE_H
#define GDCORE_EXTNERALEDITORBRIDGE_H
#include <queue>
#include <wx/utils.h>
#include <wx/process.h>
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Serialization/Serializer.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/IDE/AbstractFileSystem.h"
#include <SFML/Network.hpp>
namespace gd {
class GD_CORE_API ExternalEditorBridge : public wxEvtHandler {
public:
ExternalEditorBridge() :
connected(false),
acceptConnections(true)
{
Connect(wxID_ANY, wxEVT_THREAD, (wxObjectEventFunction)&ExternalEditorBridge::Receive);
}
~ExternalEditorBridge()
{
Disconnect();
}
unsigned int Start()
{
Disconnect();
std::cout << "Starting bridge server to connect to the external editor..." << std::endl;
unsigned int port = LaunchListener();
if (port == 0)
{
std::cout << "Unable to launch a listener for the bridge server." << std::endl;
return 0;
}
acceptConnections = true;
serverThread = std::shared_ptr<sf::Thread>(
new sf::Thread(&ExternalEditorBridge::RunServer, this));
serverThread->launch();
return port;
}
bool Send(const gd::String & cmd, const gd::SerializerElement & payloadObject, const gd::String & scope = "")
{
sf::Lock lock(outMessagesMutex);
gd::SerializerElement object;
object.AddChild("command").SetValue(cmd);
object.AddChild("scope").SetValue(scope);
object.AddChild("payload") = payloadObject;
std::string message = gd::Serializer::ToJSON(object).ToLocale();
outMessages.push(message);
return true;
}
void OnReceive(std::function<void(gd::String cmd, gd::SerializerElement object, gd::String scope)> cb)
{
onReceiveCb = cb;
}
bool IsConnected() {
return connected;
}
private:
void Receive(wxThreadEvent & event)
{
sf::Lock lock(inMessagesMutex);
while (!inMessages.empty())
{
gd::String message = gd::String::FromLocale(inMessages.front());
inMessages.pop();
std::cout << "Message passed to the main thread: " << message << std::endl;
gd::SerializerElement object = gd::Serializer::FromJSON(message);
if (onReceiveCb)
{
onReceiveCb(
object.GetChild("command").GetValue().GetString(),
object.GetChild("payload"),
object.GetChild("scope").GetValue().GetString());
}
}
}
void Disconnect()
{
std::cout << "Disconnecting an external editor..." << std::endl;
connected = false; //Set connected to false to let RunServer finish.
acceptConnections = false; //Don't allow to listen to new connections.
serverThread.reset(); //sf::Thread destructor will wait for RunServer to finish.
std::cout << "External editor disconnected." << std::endl;
}
unsigned int LaunchListener()
{
serverListener.close();
//Launch the listener socket on a free port.
unsigned int serverPort = 50000;
while (serverPort < 55555)
{
if (serverListener.listen(serverPort) == sf::Socket::Done)
return serverPort;
serverPort++;
}
return 0;
}
void ReceiveChunk(std::string & data, char * buffer, std::size_t bufferSize)
{
size_t pos = 0;
while (pos < bufferSize) {
if (buffer[pos] == '\0')
{
sf::Lock lock(inMessagesMutex);
wxThreadEvent evt;
this->QueueEvent(evt.Clone());
std::cout << "Message (size: "
<< data.size()
<< ") queued, to be passed to main thread." << std::endl;
inMessages.push(data);
data.clear();
} else {
data += buffer[pos];
}
pos++;
}
}
void RunServer()
{
std::cout << "Running server for external editor on "
<< serverListener.getLocalPort() << "..."<< std::endl;
serverListener.setBlocking(false);
while (acceptConnections)
{
sf::TcpSocket client;
client.setBlocking(false);
if (serverListener.accept(client) == sf::Socket::Done)
{
std::cout << "Etablished TCP connection with client " << client.getRemotePort() << std::endl;
connected = true;
std::string data;
while (connected)
{
//Receive messages
char buffer[1024];
std::size_t receivedSize = 0;
sf::Socket::Status status = client.receive(buffer, sizeof(buffer), receivedSize);
if (status == sf::Socket::Done)
{
std::cout << "Server received " << receivedSize
<< " bytes from client " << client.getRemotePort() << std::endl;
ReceiveChunk(data, buffer, receivedSize);
}
else if (status == sf::Socket::Disconnected)
{
std::cout << "Connection ended with " << client.getRemotePort() << std::endl;
connected = false;
}
else
{
// Give some rest to the thread to avoid 100% of
// CPU usage while waiting for messages.
// Note that this is not done if a message was received, as
// other chunks could be received just after.
sf::sleep(sf::milliseconds(75));
}
//Send messages
if (connected)
{
sf::Lock lock(outMessagesMutex);
if (!outMessages.empty())
{
client.setBlocking(true);
std::string message = outMessages.front();
sf::Socket::Status status = client.send(message.c_str(), message.size() + 1);
if (status == sf::Socket::Done)
{
std::cout << "Message sent to " << client.getRemotePort() << std::endl;
outMessages.pop();
}
else
{
std::cout << "Failed to send a message to " << client.getRemotePort() << std::endl;
}
client.setBlocking(false);
}
}
}
}
}
}
std::queue<std::string> inMessages; ///< Messages received from the external editor.
sf::Mutex inMessagesMutex; ///< The mutex to use anytime inMessages is modified/accessed.
std::queue<std::string> outMessages; ///< Messages to be sent to the external editor.
sf::Mutex outMessagesMutex; ///< The mutex to use anytime outMessages is modified/accessed.
bool acceptConnections;
bool connected;
sf::TcpListener serverListener;
std::shared_ptr<sf::Thread> serverThread;
std::function<void(gd::String cmd, gd::SerializerElement object, gd::String scope)> onReceiveCb;
};
}
#endif
#endif

View File

@@ -440,6 +440,11 @@ void LayoutEditorCanvas::UpdateModeButtonsState()
* Go in preview mode
*/
void LayoutEditorCanvas::OnPreviewBtClick( wxCommandEvent & event )
{
LaunchPreview();
}
void LayoutEditorCanvas::LaunchPreview()
{
if ( !editing ) return;
@@ -523,6 +528,12 @@ wxRibbonButtonBar* LayoutEditorCanvas::CreateRibbonPage(wxRibbonPage * page)
modeRibbonBar->AddButton(idRibbonEditMode, !hideLabels ? _("Stop the preview") : gd::String(), SkinHelper::GetRibbonIcon("edit"), _("Stop the preview and go back to editing"));
modeRibbonBar->AddButton(idRibbonPreviewMode, !hideLabels ? _("Preview") : gd::String(), SkinHelper::GetRibbonIcon("preview"), _("Launch a preview"), wxRIBBON_BUTTON_HYBRID);
}
{
wxRibbonPanel *ribbonPanel = new wxRibbonPanel(page, wxID_ANY, _("Editors"), SkinHelper::GetRibbonIcon("preview"), wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE);
wxRibbonButtonBar *ribbonBar = new wxRibbonButtonBar(ribbonPanel, wxID_ANY);
ribbonBar->AddButton(idRibbonObjectsEditor, !hideLabels ? _("Objects editor") : gd::String(), gd::SkinHelper::GetRibbonIcon("objects"), _("Show the list of objects of the scene"));
ribbonBar->AddButton(idRibbonLayersEditor, !hideLabels ? _("Layers editor") : gd::String(), gd::SkinHelper::GetRibbonIcon("layers"), _("Show the layers editor"));
}
wxRibbonPanel *toolsPanel = new wxRibbonPanel(page, wxID_ANY, _("Tools"), SkinHelper::GetRibbonIcon("tools"), wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE);
wxRibbonButtonBar * ribbonToolbar = new wxRibbonButtonBar(toolsPanel, wxID_ANY);
@@ -558,8 +569,6 @@ void LayoutEditorCanvas::CreateEditionRibbonTools()
wxConfigBase::Get()->Read( _T( "/Skin/HideLabels" ), &hideLabels );
wxRibbonButtonBar * ribbonToolbar = mainFrameWrapper.GetRibbonSceneEditorButtonBar();
ribbonToolbar->AddButton(idRibbonObjectsEditor, !hideLabels ? _("Objects editor") : gd::String(), gd::SkinHelper::GetRibbonIcon("objects"), _("Show the list of objects of the scene"));
ribbonToolbar->AddButton(idRibbonLayersEditor, !hideLabels ? _("Layers editor") : gd::String(), gd::SkinHelper::GetRibbonIcon("layers"), _("Show the layers editor"));
ribbonToolbar->AddButton(idRibbonObjectsPositionList, !hideLabels ? _("Instances") : gd::String(), gd::SkinHelper::GetRibbonIcon("ObjectsPositionsList"), _("Open a list of all instances of objects put on the scene"));
ribbonToolbar->AddHybridButton(idRibbonUndo, !hideLabels ? _("Undo") : gd::String(), gd::SkinHelper::GetRibbonIcon("undo"), _("Undo the last change"));
ribbonToolbar->AddButton(idRibbonRedo, !hideLabels ? _("Redo") : gd::String(), gd::SkinHelper::GetRibbonIcon("redo"));

View File

@@ -275,6 +275,11 @@ public:
*/
virtual void PausePreview();
/**
* \brief Launch the current previewer.
*/
void LaunchPreview();
/**
* Load resources for objects.
*/

View File

@@ -3,7 +3,7 @@
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
#include "LayoutEditorCanvasOptions.h"
#include "GDCore/Serialization/SerializerElement.h"
#include "GDCore/CommonTools.h"

View File

@@ -3,7 +3,7 @@
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
#ifndef SCENECANVASSETTINGS_H
#define SCENECANVASSETTINGS_H
#include "GDCore/String.h"

View File

@@ -1241,10 +1241,10 @@ void ResourcesEditor::TriggerDrop(wxCoord x, wxCoord y, std::vector<gd::String >
*/
void ResourcesEditor::OnSetFocus(wxFocusEvent& event)
{
ForceRefreshRibbonAndConnect();
EditorDisplayed();
}
void ResourcesEditor::ForceRefreshRibbonAndConnect()
void ResourcesEditor::EditorDisplayed()
{
if ( useRibbon )
{

View File

@@ -98,7 +98,7 @@ public:
/**
* Can be called by parent so as to refresh ribbon for this editor.
*/
void ForceRefreshRibbonAndConnect();
void EditorDisplayed();
static const long idRibbonAdd;
static const long idRibbonAddFromLibrary;

View File

@@ -34,7 +34,6 @@ bool ProjectResourcesCopier::CopyAllResourcesTo(gd::Project & originalProject, A
originalProject.ExposeResources(absolutePathChecker);
bool copyAlsoResourcesWithAbsolutePath = !askAboutAbsoluteFilenames;
std::cout << "Copying all ressources to " << destinationDirectory;
#if !defined(GD_NO_WX_GUI)
if ( !copyAlsoResourcesWithAbsolutePath )
@@ -45,9 +44,12 @@ bool ProjectResourcesCopier::CopyAllResourcesTo(gd::Project & originalProject, A
}
#endif
auto projectDirectory = fs.DirNameFrom(originalProject.GetProjectFile());
std::cout << "Copying all ressources from " << projectDirectory << " to " << destinationDirectory;
//Get the resources to be copied
gd::ResourcesMergingHelper resourcesMergingHelper(fs);
resourcesMergingHelper.SetBaseDirectory(fs.DirNameFrom(originalProject.GetProjectFile()));
resourcesMergingHelper.SetBaseDirectory(projectDirectory);
resourcesMergingHelper.PreserveDirectoriesStructure(preserveDirectoryStructure);
resourcesMergingHelper.PreserveAbsoluteFilenames(!copyAlsoResourcesWithAbsolutePath);

View File

@@ -148,13 +148,13 @@ bool ProjectFileWriter::LoadFromJSONFile(gd::Project & project, const gd::String
return false;
}
project.SetProjectFile(filename);
project.SetDirty(false);
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
gd::SerializerElement rootElement = gd::Serializer::FromJSON(str);
project.UnserializeFrom(rootElement);
project.SetProjectFile(filename);
project.SetDirty(false);
return true;
}
#endif
@@ -172,11 +172,6 @@ bool ProjectFileWriter::LoadFromFile(gd::Project & project, const gd::String & f
return false;
}
#if defined(GD_IDE_ONLY)
project.SetProjectFile(filename);
project.SetDirty(false);
#endif
TiXmlHandle hdl( &doc );
gd::SerializerElement rootElement;
@@ -217,6 +212,11 @@ bool ProjectFileWriter::LoadFromFile(gd::Project & project, const gd::String & f
//Unserialize the whole project
project.UnserializeFrom(rootElement);
#if defined(GD_IDE_ONLY)
project.SetProjectFile(filename);
project.SetDirty(false);
#endif
return true;
}

View File

@@ -6,12 +6,14 @@
#include "GDCore/Project/Project.h"
#include "GDCore/Project/ExternalEvents.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/ExternalLayout.h"
#include "GDCore/Project/ExternalEvents.h"
#include "ProjectStripper.h"
namespace gd
{
void GD_CORE_API ProjectStripper::StripProject(gd::Project & project)
void GD_CORE_API ProjectStripper::StripProjectForExport(gd::Project & project)
{
project.GetObjectGroups().clear();
while ( project.GetExternalEventsCount() > 0 ) project.RemoveExternalEvents(project.GetExternalEvents(0).GetName());
@@ -23,4 +25,62 @@ void GD_CORE_API ProjectStripper::StripProject(gd::Project & project)
}
}
void GD_CORE_API ProjectStripper::StripProjectForLayoutEdition(gd::Project & project, const gd::String & layoutName)
{
while ( project.GetExternalEventsCount() > 0 ) project.RemoveExternalEvents(project.GetExternalEvents(0).GetName());
for (unsigned int i = 0;i<project.GetLayoutsCount();++i)
{
auto & layout = project.GetLayout(i);
if (layoutName == layout.GetName()) continue;
project.GetLayout(i).GetEvents().Clear();
project.GetLayout(i).GetInitialInstances().Clear();
}
for (unsigned int i = 0;i<project.GetExternalEventsCount();++i)
{
project.GetExternalEvents(i).GetEvents().Clear();
}
for (unsigned int i = 0;i<project.GetExternalLayoutsCount();++i)
{
project.GetExternalLayout(i).GetInitialInstances().Clear();
}
}
void GD_CORE_API ProjectStripper::StripProjectForExternalLayoutEdition(gd::Project & project, const gd::String & externalLayoutName)
{
while ( project.GetExternalEventsCount() > 0 ) project.RemoveExternalEvents(project.GetExternalEvents(0).GetName());
gd::String associatedLayoutName;
if (project.HasExternalLayoutNamed(externalLayoutName))
{
associatedLayoutName =
project.GetExternalLayout(externalLayoutName).GetAssociatedLayout();
}
for (unsigned int i = 0;i<project.GetLayoutsCount();++i)
{
auto & layout = project.GetLayout(i);
if (!associatedLayoutName.empty() && associatedLayoutName == layout.GetName()) continue;
project.GetLayout(i).GetEvents().Clear();
project.GetLayout(i).GetInitialInstances().Clear();
}
for (unsigned int i = 0;i<project.GetExternalEventsCount();++i)
{
project.GetExternalEvents(i).GetEvents().Clear();
}
for (unsigned int i = 0;i<project.GetExternalLayoutsCount();++i)
{
auto & externalLayout = project.GetExternalLayout(i);
if (externalLayoutName == externalLayout.GetName()) continue;
externalLayout.GetInitialInstances().Clear();
}
}
}

View File

@@ -6,6 +6,7 @@
#ifndef GDCORE_PROJECTSTRIPPER_H
#define GDCORE_PROJECTSTRIPPER_H
namespace gd { class Project; }
namespace gd { class String; }
namespace gd
{
@@ -23,7 +24,20 @@ public:
*
* \param project The project to be stripped.
*/
static void StripProject(gd::Project & project);
static void StripProjectForExport(gd::Project & project);
/**
* \brief Strip project to keep only the full content of the specified
* layout. The content of other layouts, external events and external layouts is removed.
*/
static void StripProjectForLayoutEdition(gd::Project & project, const gd::String & layoutName);
/**
* \brief Strip project to keep only the full content of the specified
* external layout and the associated layout.
* The content of other layouts, external events and external layouts is removed.
*/
static void StripProjectForExternalLayoutEdition(gd::Project & project, const gd::String & externalLayoutName);
private:
ProjectStripper() {};

View File

@@ -17,10 +17,10 @@ void ExternalLayout::UnserializeFrom(const SerializerElement & element)
{
name = element.GetStringAttribute("name", "", "Name");
instances.UnserializeFrom(element.GetChild("instances", 0, "Instances"));
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
editionSettings.UnserializeFrom(element.GetChild("editionSettings"));
associatedLayout = element.GetStringAttribute("associatedLayout");
#endif
associatedLayout = element.GetStringAttribute("associatedLayout");
}
#if defined(GD_IDE_ONLY)
@@ -28,10 +28,8 @@ void ExternalLayout::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("name", name);
instances.SerializeTo(element.AddChild("instances"));
#if !defined(GD_NO_WX_GUI)
editionSettings.SerializeTo(element.AddChild("editionSettings"));
element.SetAttribute("associatedLayout", associatedLayout);
#endif
}
#endif

View File

@@ -10,7 +10,7 @@
#include "GDCore/Project/InitialInstancesContainer.h"
#include <memory>
namespace gd { class SerializerElement; }
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
#include "GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvasOptions.h"
#endif
@@ -51,7 +51,7 @@ public:
*/
gd::InitialInstancesContainer & GetInitialInstances() { return instances; }
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
/**
* \brief Get the user settings for the IDE.
*/
@@ -61,6 +61,7 @@ public:
* \brief Get the user settings for the IDE.
*/
gd::LayoutEditorCanvasOptions & GetAssociatedSettings() { return editionSettings; }
#endif
/**
* \brief Get the name of the layout last used to edit the external layout.
@@ -71,7 +72,6 @@ public:
* \brief Set the name of the layout used to edit the external layout.
*/
void SetAssociatedLayout(const gd::String & name) { associatedLayout = name; }
#endif
/** \name Serialization
*/
@@ -93,10 +93,10 @@ private:
gd::String name;
gd::InitialInstancesContainer instances;
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
gd::LayoutEditorCanvasOptions editionSettings;
gd::String associatedLayout;
#endif
gd::String associatedLayout;
};
/**

View File

@@ -8,6 +8,7 @@
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Object.h"
#include "GDCore/Serialization/SerializerElement.h"
#if defined(GD_IDE_ONLY)
#include "GDCore/IDE/Dialogs/PropertyDescriptor.h"
#endif
@@ -15,6 +16,8 @@
namespace gd
{
gd::String * InitialInstance::badStringProperyValue = NULL;
InitialInstance::InitialInstance() :
objectName(""),
x(0),
@@ -29,9 +32,78 @@ InitialInstance::InitialInstance() :
{
}
void InitialInstance::UnserializeFrom(const SerializerElement & element)
{
SetObjectName(element.GetStringAttribute("name", "", "nom"));
SetX(element.GetDoubleAttribute("x"));
SetY(element.GetDoubleAttribute("y"));
SetAngle(element.GetDoubleAttribute("angle"));
SetHasCustomSize(element.GetBoolAttribute("customSize", false, "personalizedSize"));
SetCustomWidth(element.GetDoubleAttribute("width"));
SetCustomHeight(element.GetDoubleAttribute("height"));
SetZOrder(element.GetIntAttribute("zOrder", 0, "plan"));
SetLayer(element.GetStringAttribute("layer"));
SetLocked(element.GetBoolAttribute( "locked", false ));
floatInfos.clear();
const SerializerElement & floatPropElement = element.GetChild("numberProperties" , 0 ,"floatInfos");
floatPropElement.ConsiderAsArrayOf("property", "Info");
for (std::size_t j = 0; j < floatPropElement.GetChildrenCount(); ++j)
{
gd::String name = floatPropElement.GetChild(j).GetStringAttribute("name");
float value = floatPropElement.GetChild(j).GetDoubleAttribute("value");
floatInfos[name] = value;
}
stringInfos.clear();
const SerializerElement & stringPropElement = element.GetChild("stringProperties" , 0 ,"stringInfos");
stringPropElement.ConsiderAsArrayOf("property", "Info");
for (std::size_t j = 0; j < stringPropElement.GetChildrenCount(); ++j)
{
gd::String name = stringPropElement.GetChild(j).GetStringAttribute("name");
gd::String value = stringPropElement.GetChild(j).GetStringAttribute("value");
stringInfos[name] = value;
}
GetVariables().UnserializeFrom(element.GetChild("initialVariables", 0, "InitialVariables"));
}
void InitialInstance::SerializeTo(SerializerElement & element) const
{
element.SetAttribute( "name", GetObjectName() );
element.SetAttribute( "x", GetX() );
element.SetAttribute( "y", GetY() );
element.SetAttribute( "zOrder", GetZOrder() );
element.SetAttribute( "layer", GetLayer() );
element.SetAttribute( "angle", GetAngle() );
element.SetAttribute( "customSize", HasCustomSize() );
element.SetAttribute( "width", GetCustomWidth() );
element.SetAttribute( "height", GetCustomHeight() );
element.SetAttribute( "locked", IsLocked() );
SerializerElement & floatPropElement = element.AddChild("numberProperties");
floatPropElement.ConsiderAsArrayOf("property");
for(std::map<gd::String, float>::const_iterator floatInfo = floatInfos.begin(); floatInfo != floatInfos.end(); ++floatInfo)
{
floatPropElement.AddChild("property")
.SetAttribute("name", floatInfo->first)
.SetAttribute("value", floatInfo->second);
}
SerializerElement & stringPropElement = element.AddChild("stringProperties");
stringPropElement.ConsiderAsArrayOf("property");
for(std::map<gd::String, gd::String>::const_iterator stringInfo = stringInfos.begin(); stringInfo != stringInfos.end(); ++stringInfo)
{
stringPropElement.AddChild("property")
.SetAttribute("name", stringInfo->first)
.SetAttribute("value", stringInfo->second);
}
GetVariables().SerializeTo(element.AddChild("initialVariables"));
}
#if defined(GD_IDE_ONLY)
std::map<gd::String, gd::PropertyDescriptor> gd::InitialInstance::GetCustomProperties(gd::Project & project, gd::Layout & layout)
std::map<gd::String, gd::PropertyDescriptor> InitialInstance::GetCustomProperties(gd::Project & project, gd::Layout & layout)
{
//Find an object
if ( layout.HasObjectNamed(GetObjectName()) )
@@ -43,7 +115,7 @@ std::map<gd::String, gd::PropertyDescriptor> gd::InitialInstance::GetCustomPrope
return nothing;
}
bool gd::InitialInstance::UpdateCustomProperty(const gd::String & name, const gd::String & value, gd::Project & project, gd::Layout & layout)
bool InitialInstance::UpdateCustomProperty(const gd::String & name, const gd::String & value, gd::Project & project, gd::Layout & layout)
{
if ( layout.HasObjectNamed(GetObjectName()) )
return layout.GetObject(GetObjectName()).UpdateInitialInstanceProperty(*this, name, value, project, layout);
@@ -53,6 +125,19 @@ bool gd::InitialInstance::UpdateCustomProperty(const gd::String & name, const gd
return false;
}
float InitialInstance::GetRawFloatProperty(const gd::String & name) const
{
const auto & it = floatInfos.find(name);
return it != floatInfos.end() ? it->second : 0;
}
const gd::String & InitialInstance::GetRawStringProperty(const gd::String & name) const
{
if (!badStringProperyValue) badStringProperyValue = new gd::String("");
const auto & it = stringInfos.find(name);
return it != stringInfos.end() ? it->second : *badStringProperyValue;
}
#endif
}

View File

@@ -125,7 +125,6 @@ public:
float GetCustomHeight() const { return height; }
void SetCustomHeight(float height_) { height = height_; }
#if defined(GD_IDE_ONLY)
/**
* \brief Return true if the instance is locked and cannot be selected by clicking on it in the IDE.
*/
@@ -137,7 +136,6 @@ public:
* An instance which is locked cannot be selected by clicking on it in a layout editor canvas.
*/
void SetLocked(bool enable = true) { locked = enable; }
#endif
///@}
@@ -186,10 +184,39 @@ public:
* \return false if the property could not be updated.
*/
bool UpdateCustomProperty(const gd::String & name, const gd::String & value, gd::Project & project, gd::Layout & layout);
/**
* \brief Get the value of a float property stored in the instance.
* \note Only use this when \a GetCustomProperties is too slow (when rendering instances for example).
* \return the value of the property, or 0 if it does not exists.
*/
float GetRawFloatProperty(const gd::String & name) const;
/**
* \brief Get the value of a string property stored in the instance.
* \note Only use this when \a GetCustomProperties is too slow (when rendering instances for example).
* \return the value of the propety, or an empty string if it does not exists.
*/
const gd::String & GetRawStringProperty(const gd::String & name) const;
///@}
#endif
//In our implementation, more properties can be stored in floatInfos and stringInfos.
/** \name Saving and loading
* Members functions related to serialization.
*/
///@{
/**
* \brief Serialize instances container.
*/
virtual void SerializeTo(SerializerElement & element) const;
/**
* \brief Unserialize the instances container.
*/
virtual void UnserializeFrom(const SerializerElement & element);
///@}
//More properties can be stored in floatInfos and stringInfos.
//These properties are then managed by the Object class.
std::map < gd::String, float > floatInfos; ///< More data which can be used by the object
std::map < gd::String, gd::String > stringInfos; ///< More data which can be used by the object
@@ -206,6 +233,8 @@ private:
float height; ///< Object custom height
gd::VariablesContainer initialVariables; ///< Instance specific variables
bool locked; ///< True if the instance is locked
static gd::String * badStringProperyValue; ///< Empty string returned by GetRawStringProperty
};
}

View File

@@ -35,43 +35,9 @@ void InitialInstancesContainer::UnserializeFrom(const SerializerElement & elemen
element.ConsiderAsArrayOf("instance", "Objet");
for (std::size_t i = 0; i < element.GetChildrenCount(); ++i)
{
const SerializerElement & instanceElement = element.GetChild(i);
gd::InitialInstance newPosition;
newPosition.SetObjectName(instanceElement.GetStringAttribute("name", "", "nom"));
newPosition.SetX(instanceElement.GetDoubleAttribute("x"));
newPosition.SetY(instanceElement.GetDoubleAttribute("y"));
newPosition.SetAngle(instanceElement.GetDoubleAttribute("angle"));
newPosition.SetHasCustomSize(instanceElement.GetBoolAttribute("customSize", false, "personalizedSize"));
newPosition.SetCustomWidth(instanceElement.GetDoubleAttribute("width"));
newPosition.SetCustomHeight(instanceElement.GetDoubleAttribute("height"));
newPosition.SetZOrder(instanceElement.GetIntAttribute("zOrder", 0, "plan"));
newPosition.SetLayer(instanceElement.GetStringAttribute("layer"));
#if defined(GD_IDE_ONLY)
newPosition.SetLocked(instanceElement.GetBoolAttribute( "locked", false ));
#endif
const SerializerElement & floatPropElement = instanceElement.GetChild("numberProperties" , 0 ,"floatInfos");
floatPropElement.ConsiderAsArrayOf("property", "Info");
for (std::size_t j = 0; j < floatPropElement.GetChildrenCount(); ++j)
{
gd::String name = floatPropElement.GetChild(j).GetStringAttribute("name");
float value = floatPropElement.GetChild(j).GetDoubleAttribute("value");
newPosition.floatInfos[name] = value;
}
const SerializerElement & stringPropElement = instanceElement.GetChild("stringProperties" , 0 ,"stringInfos");
stringPropElement.ConsiderAsArrayOf("property", "Info");
for (std::size_t j = 0; j < stringPropElement.GetChildrenCount(); ++j)
{
gd::String name = stringPropElement.GetChild(j).GetStringAttribute("name");
gd::String value = stringPropElement.GetChild(j).GetStringAttribute("value");
newPosition.stringInfos[name] = value;
}
newPosition.GetVariables().UnserializeFrom(instanceElement.GetChild("initialVariables", 0, "InitialVariables"));
initialInstances.push_back( newPosition );
gd::InitialInstance instance;
instance.UnserializeFrom(element.GetChild(i));
initialInstances.push_back(instance);
}
}
@@ -197,40 +163,13 @@ void InitialInstancesContainer::Create(const InitialInstancesContainer & source)
void InitialInstancesContainer::SerializeTo(SerializerElement & element) const
{
element.ConsiderAsArrayOf("instance");
for (std::list<gd::InitialInstance>::const_iterator it = initialInstances.begin(), end = initialInstances.end(); it != end; ++it)
{
SerializerElement & instanceElement = element.AddChild("instance");
instanceElement.SetAttribute( "name", (*it).GetObjectName() );
instanceElement.SetAttribute( "x", (*it).GetX() );
instanceElement.SetAttribute( "y", (*it).GetY() );
instanceElement.SetAttribute( "zOrder", (*it).GetZOrder() );
instanceElement.SetAttribute( "layer", (*it).GetLayer() );
instanceElement.SetAttribute( "angle", (*it).GetAngle() );
instanceElement.SetAttribute( "customSize", (*it).HasCustomSize() );
instanceElement.SetAttribute( "width", (*it).GetCustomWidth() );
instanceElement.SetAttribute( "height", (*it).GetCustomHeight() );
instanceElement.SetAttribute( "locked", (*it).IsLocked() );
for (auto instance : initialInstances)
instance.SerializeTo(element.AddChild("instance"));
}
SerializerElement & floatPropElement = instanceElement.AddChild("numberProperties");
floatPropElement.ConsiderAsArrayOf("property");
for(std::map<gd::String, float>::const_iterator floatInfo = (*it).floatInfos.begin(); floatInfo != (*it).floatInfos.end(); ++floatInfo)
{
floatPropElement.AddChild("property")
.SetAttribute("name", floatInfo->first)
.SetAttribute("value", floatInfo->second);
}
SerializerElement & stringPropElement = instanceElement.AddChild("stringProperties");
stringPropElement.ConsiderAsArrayOf("property");
for(std::map<gd::String, gd::String>::const_iterator stringInfo = (*it).stringInfos.begin(); stringInfo != (*it).stringInfos.end(); ++stringInfo)
{
stringPropElement.AddChild("property")
.SetAttribute("name", stringInfo->first)
.SetAttribute("value", stringInfo->second);
}
(*it).GetVariables().SerializeTo(instanceElement.AddChild("initialVariables"));
}
void InitialInstancesContainer::Clear()
{
initialInstances.clear();
}
#endif

View File

@@ -133,6 +133,11 @@ public:
* \brief Return true if there is at least one instance on the layer named \a layerName.
*/
bool SomeInstancesAreOnLayer(const gd::String & layerName);
/**
* \brief Remove all instances
*/
void Clear();
#endif
///@}

View File

@@ -228,8 +228,8 @@ void Layout::SerializeTo(SerializerElement & element) const
element.SetAttribute( "stopSoundsOnStartup", stopSoundsOnStartup);
element.SetAttribute( "disableInputWhenNotFocused", disableInputWhenNotFocused);
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
GetAssociatedLayoutEditorCanvasOptions().SerializeTo(element.AddChild("uiSettings"));
#if defined(GD_IDE_ONLY)
GetAssociatedSettings().SerializeTo(element.AddChild("uiSettings"));
#endif
ObjectGroup::SerializeTo(GetObjectGroups(), element.AddChild("objectsGroups"));
@@ -238,10 +238,7 @@ void Layout::SerializeTo(SerializerElement & element) const
SerializeObjectsTo(element.AddChild("objects"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
SerializerElement & layersElement = element.AddChild("layers");
layersElement.ConsiderAsArrayOf("layer");
for ( std::size_t j = 0;j < GetLayersCount();++j )
GetLayer(j).SerializeTo(layersElement.AddChild("layer"));
SerializeLayersTo(element.AddChild("layers"));
SerializerElement & behaviorDatasElement = element.AddChild("behaviorsSharedData");
behaviorDatasElement.ConsiderAsArrayOf("behaviorSharedData");
@@ -255,8 +252,27 @@ void Layout::SerializeTo(SerializerElement & element) const
it->second->SerializeTo(dataElement);
}
}
void Layout::SerializeLayersTo(SerializerElement & element) const
{
element.ConsiderAsArrayOf("layer");
for ( std::size_t j = 0;j < GetLayersCount();++j )
GetLayer(j).SerializeTo(element.AddChild("layer"));
}
#endif
void Layout::UnserializeLayersFrom(const SerializerElement & element)
{
initialLayers.clear();
element.ConsiderAsArrayOf("layer", "Layer");
for (std::size_t i = 0; i < element.GetChildrenCount(); ++i)
{
gd::Layer layer;
layer.UnserializeFrom(element.GetChild(i));
initialLayers.push_back(layer);
}
}
void Layout::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
SetBackgroundColor(element.GetIntAttribute( "r" ), element.GetIntAttribute( "v" ), element.GetIntAttribute( "b" ));
@@ -268,11 +284,9 @@ void Layout::UnserializeFrom(gd::Project & project, const SerializerElement & el
stopSoundsOnStartup = element.GetBoolAttribute( "stopSoundsOnStartup" );
disableInputWhenNotFocused = element.GetBoolAttribute( "disableInputWhenNotFocused" );
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
associatedSettings.UnserializeFrom(element.GetChild("uiSettings", 0, "UISettings"));
#endif
#if defined(GD_IDE_ONLY)
associatedSettings.UnserializeFrom(element.GetChild("uiSettings", 0, "UISettings"));
gd::ObjectGroup::UnserializeFrom(objectGroups, element.GetChild( "objectsGroups", 0, "GroupesObjets" ));
gd::EventsListSerialization::UnserializeEventsFrom(project, GetEvents(), element.GetChild("events", 0, "Events"));
#endif
@@ -281,16 +295,7 @@ void Layout::UnserializeFrom(gd::Project & project, const SerializerElement & el
initialInstances.UnserializeFrom(element.GetChild("instances", 0, "Positions"));
variables.UnserializeFrom(element.GetChild("variables", 0, "Variables"));
initialLayers.clear();
SerializerElement & layersElement = element.GetChild("layers", 0, "Layers");
layersElement.ConsiderAsArrayOf("layer", "Layer");
for (std::size_t i = 0; i < layersElement.GetChildrenCount(); ++i)
{
gd::Layer layer;
layer.UnserializeFrom(layersElement.GetChild(i));
initialLayers.push_back(layer);
}
UnserializeLayersFrom(element.GetChild("layers", 0, "Layers"));
//Compatibility with GD <= 4
gd::String deprecatedTag1 = "automatismsSharedData";
@@ -350,6 +355,7 @@ void Layout::Init(const Layout & other)
#if defined(GD_IDE_ONLY)
events = other.events;
associatedSettings = other.associatedSettings;
objectGroups = other.objectGroups;
compiledEventsFile = other.compiledEventsFile;

View File

@@ -17,7 +17,7 @@
#include "GDCore/Project/VariablesContainer.h"
#include "GDCore/Project/InitialInstancesContainer.h"
#include "GDCore/Project/Layer.h"
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
#include "GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvasOptions.h"
#endif
namespace gd { class BaseEvent; }
@@ -172,6 +172,7 @@ public:
/** \name Layout layers management
* Members functions related to layout layers management.
* TODO: This should be moved to a separate class
*/
///@{
@@ -232,6 +233,18 @@ public:
* Must swap the position of the specified layers.
*/
void SwapLayers(std::size_t firstLayerIndex, std::size_t secondLayerIndex);
#if defined(GD_IDE_ONLY)
/**
* \brief Serialize the layers.
*/
void SerializeLayersTo(SerializerElement & element) const;
#endif
/**
* \brief Unserialize the layers.
*/
void UnserializeLayersFrom(const SerializerElement & element);
///@}
/**
@@ -244,19 +257,19 @@ public:
*/
void UpdateBehaviorsSharedData(gd::Project & project);
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
#if defined(GD_IDE_ONLY)
/**
* Return the settings associated to the layout.
* \see gd::LayoutEditorCanvasOptions
*/
const gd::LayoutEditorCanvasOptions & GetAssociatedLayoutEditorCanvasOptions() const { return associatedSettings; }
const gd::LayoutEditorCanvasOptions & GetAssociatedSettings() const { return associatedSettings; }
/**
* Return the settings associated to the layout.
* \see gd::LayoutEditorCanvasOptions
*/
gd::LayoutEditorCanvasOptions & GetAssociatedLayoutEditorCanvasOptions() { return associatedSettings; }
#endif
gd::LayoutEditorCanvasOptions & GetAssociatedSettings() { return associatedSettings; }
#endif
/** \name Other properties
*/
@@ -433,8 +446,6 @@ private:
static gd::Layer badLayer; ///< Null object, returned when GetLayer can not find an appropriate layer.
#if defined(GD_IDE_ONLY)
EventsList events; ///< Scene events
#endif
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
gd::LayoutEditorCanvasOptions associatedSettings;
#endif

View File

@@ -50,6 +50,7 @@ void ObjectGroup::SerializeTo(const std::vector < gd::ObjectGroup > & list, Seri
void ObjectGroup::UnserializeFrom(std::vector < gd::ObjectGroup > & list, const SerializerElement & element)
{
list.clear();
element.ConsiderAsArrayOf("group", "Groupe");
for (std::size_t i = 0; i < element.GetChildrenCount(); ++i)
{

View File

@@ -531,6 +531,7 @@ void Project::UnserializeFrom(const SerializerElement & element)
SetAuthor(propElement.GetChild("author", 0, "Auteur").GetValue().GetString());
SetPackageName(propElement.GetStringAttribute("packageName"));
SetFolderProject(propElement.GetBoolAttribute("folderProject"));
SetProjectFile(propElement.GetStringAttribute("projectFile"));
SetLastCompilationDirectory(propElement.GetChild("latestCompilationDirectory", 0, "LatestCompilationDirectory").GetValue().GetString());
winExecutableFilename = propElement.GetStringAttribute("winExecutableFilename");
winExecutableIconFile = propElement.GetStringAttribute("winExecutableIconFile");
@@ -648,6 +649,7 @@ void Project::UnserializeFrom(const SerializerElement & element)
UnserializeObjectsFrom(*this, element.GetChild("objects", 0, "Objects"));
GetVariables().UnserializeFrom(element.GetChild("variables", 0, "Variables"));
scenes.clear();
const SerializerElement & layoutsElement = element.GetChild("layouts", 0, "Scenes");
layoutsElement.ConsiderAsArrayOf("layout", "Scene");
for(std::size_t i = 0;i<layoutsElement.GetChildrenCount();++i)
@@ -670,6 +672,7 @@ void Project::UnserializeFrom(const SerializerElement & element)
}
#if defined(GD_IDE_ONLY)
externalEvents.clear();
const SerializerElement & externalEventsElement = element.GetChild("externalEvents", 0, "ExternalEvents");
externalEventsElement.ConsiderAsArrayOf("externalEvents", "ExternalEvents");
for(std::size_t i = 0;i<externalEventsElement.GetChildrenCount();++i)
@@ -682,6 +685,7 @@ void Project::UnserializeFrom(const SerializerElement & element)
}
#endif
externalLayouts.clear();
const SerializerElement & externalLayoutsElement = element.GetChild("externalLayouts", 0, "ExternalLayouts");
externalLayoutsElement.ConsiderAsArrayOf("externalLayout", "ExternalLayout");
for(std::size_t i = 0;i<externalLayoutsElement.GetChildrenCount();++i)
@@ -693,6 +697,7 @@ void Project::UnserializeFrom(const SerializerElement & element)
}
#if defined(GD_IDE_ONLY)
externalSourceFiles.clear();
const SerializerElement & externalSourceFilesElement = element.GetChild("externalSourceFiles", 0, "ExternalSourceFiles");
externalSourceFilesElement.ConsiderAsArrayOf("sourceFile", "SourceFile");
for(std::size_t i = 0;i<externalSourceFilesElement.GetChildrenCount();++i)
@@ -734,6 +739,7 @@ void Project::SerializeTo(SerializerElement & element) const
propElement.AddChild("maxFPS").SetValue(GetMaximumFPS());
propElement.AddChild("minFPS").SetValue(GetMinimumFPS());
propElement.AddChild("verticalSync").SetValue(IsVerticalSynchronizationEnabledByDefault());
propElement.SetAttribute("projectFile", gameFile);
propElement.SetAttribute("folderProject", folderProject);
propElement.SetAttribute("packageName", packageName);
propElement.SetAttribute("winExecutableFilename", winExecutableFilename);

View File

@@ -520,6 +520,7 @@ void ResourceFolder::UnserializeFrom(const SerializerElement & element, gd::Reso
{
name = element.GetStringAttribute("name");
resources.clear();
SerializerElement & resourcesElement = element.GetChild("resources", 0, "Resources");
resourcesElement.ConsiderAsArrayOf("resource", "Resource");
for(std::size_t i = 0;i<resourcesElement.GetChildrenCount();++i)
@@ -542,6 +543,7 @@ void ResourceFolder::SerializeTo(SerializerElement & element) const
void ResourcesManager::UnserializeFrom(const SerializerElement & element)
{
resources.clear();
const SerializerElement & resourcesElement = element.GetChild("resources", 0, "Resources");
resourcesElement.ConsiderAsArrayOf("resource", "Resource");
for(std::size_t i = 0;i<resourcesElement.GetChildrenCount();++i)
@@ -558,6 +560,7 @@ void ResourcesManager::UnserializeFrom(const SerializerElement & element)
}
#if defined(GD_IDE_ONLY)
folders.clear();
const SerializerElement & resourcesFoldersElement = element.GetChild("resourceFolders", 0, "ResourceFolders");
resourcesFoldersElement.ConsiderAsArrayOf("folder", "Folder");
for(std::size_t i = 0;i<resourcesFoldersElement.GetChildrenCount();++i)

View File

@@ -214,6 +214,16 @@ public:
*/
void UnserializeFrom(const SerializerElement & element);
/**
* \brief Return true if the image should be smoothed.
*/
bool IsSmooth() const { return smooth; }
/**
* \brief Set if the image should be smoothed in game.
*/
void SetSmooth(bool enable = true) { smooth = enable; }
bool smooth; ///< True if smoothing filter is applied
bool alwaysLoaded; ///< True if the image must always be loaded in memory.
private:

View File

@@ -81,18 +81,22 @@ const Variable & Variable::GetChild(const gd::String & name) const
return children[name];
}
/**
* \brief Remove the child with the specified name.
*
* If the variable is not a structure or has not
* the specified child, nothing is done.
*/
void Variable::RemoveChild(const gd::String & name)
{
if ( !isStructure ) return;
children.erase(name);
}
bool Variable::RenameChild(const gd::String & oldName, const gd::String & newName)
{
if ( !isStructure || !HasChild(oldName)|| HasChild(newName) ) return false;
children[newName] = children[oldName];
children.erase(oldName);
return true;
}
void Variable::SerializeTo(SerializerElement & element) const
{
if (!isStructure)

View File

@@ -132,6 +132,15 @@ public:
*/
void RemoveChild(const gd::String & name);
/**
* \brief Rename the specified child.
*
* If the variable is not a structure or has not
* the specified child, nothing is done.
* \return true if the child was renamed, false otherwise.
*/
bool RenameChild(const gd::String & oldName, const gd::String & newName);
/**
* \brief Get the map containing all the children.
*/

View File

@@ -119,11 +119,15 @@ Variable & VariablesContainer::InsertNew(const gd::String & name, std::size_t po
return Insert(name, newVariable, position);
}
void VariablesContainer::Rename(const gd::String & oldName, const gd::String & newName)
bool VariablesContainer::Rename(const gd::String & oldName, const gd::String & newName)
{
if (Has(newName)) return false;
std::vector < std::pair<gd::String, gd::Variable> >::iterator i =
std::find_if(variables.begin(), variables.end(), VariableHasName(oldName));
if (i != variables.end()) i->first = newName;
return true;
}
void VariablesContainer::Swap(std::size_t firstVariableIndex, std::size_t secondVariableIndex)
@@ -135,6 +139,7 @@ void VariablesContainer::Swap(std::size_t firstVariableIndex, std::size_t second
variables[firstVariableIndex] = variables[secondVariableIndex];
variables[secondVariableIndex] = temp;
}
#endif
void VariablesContainer::SerializeTo(SerializerElement & element) const
{
@@ -146,7 +151,6 @@ void VariablesContainer::SerializeTo(SerializerElement & element) const
variables[j].second.SerializeTo(variableElement);
}
}
#endif
void VariablesContainer::UnserializeFrom(const SerializerElement & element)
{

View File

@@ -99,9 +99,10 @@ public:
void Remove(const gd::String & name);
/**
* \brief Rename a variable
* \brief Rename a variable.
* \return true if the variable was renamed, false otherwise.
*/
void Rename(const gd::String & oldName, const gd::String & newName);
bool Rename(const gd::String & oldName, const gd::String & newName);
/**
* \brief Swap the position of the specified variables.
@@ -119,12 +120,10 @@ public:
* Members functions related to saving and loading the object.
*/
///@{
#if defined(GD_IDE_ONLY)
/**
* \brief Serialize variable container.
*/
void SerializeTo(SerializerElement & element) const;
#endif
/**
* \brief Unserialize the variable container.

View File

@@ -0,0 +1,14 @@
namespace gd
{
template <typename T>
T & HexToRgb(int hexValue, T & output)
{
output["r"] = ((hexValue >> 16) & 0xFF);
output["g"] = ((hexValue >> 8) & 0xFF);
output["b"] = ((hexValue) & 0xFF);
return output;
}
}

View File

@@ -0,0 +1,29 @@
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
/**
* @file Tests covering events of GDevelop Core.
*/
#include "catch.hpp"
#include <algorithm>
#include <initializer_list>
#include <map>
#include "GDCore/CommonTools.h"
#include "GDCore/Tools/VersionWrapper.h"
#include "GDCore/Project/InitialInstance.h"
TEST_CASE( "InitialInstance", "[common][instances]" ) {
gd::InitialInstance instance;
SECTION("GetRawFloatProperty") {
REQUIRE( instance.GetRawFloatProperty("NotExistingProperty") == 0 );
}
SECTION("GetRawStringProperty") {
REQUIRE( instance.GetRawStringProperty("NotExistingProperty") == "" );
}
}

View File

@@ -0,0 +1,13 @@
diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp
index 9c68d84..2522d88 100644
--- a/include/SFML/Config.hpp
+++ b/include/SFML/Config.hpp
@@ -76,7 +76,7 @@
// Android
#define SFML_SYSTEM_ANDROID
- #elif defined(__linux__)
+ #elif defined(__linux__) || defined(EMSCRIPTEN)
// Linux
#define SFML_SYSTEM_LINUX

View File

@@ -9,8 +9,8 @@ include(CMakeUtils.txt) #Functions to factor common tasks done in CMakeLists.txt
#Add all the CMakeLists:
ADD_SUBDIRECTORY(AdMobObject)
ADD_SUBDIRECTORY(AnchorBehavior)
IF (NOT EMSCRIPTEN) #Only add some extensions when compiling with emscripten.
ADD_SUBDIRECTORY(AnchorBehavior)
ADD_SUBDIRECTORY(AdvancedXML)
ADD_SUBDIRECTORY(AES)
ADD_SUBDIRECTORY(Box3DObject)
@@ -22,24 +22,30 @@ ADD_SUBDIRECTORY(DestroyOutsideBehavior)
ADD_SUBDIRECTORY(DraggableBehavior)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(Function)
ADD_SUBDIRECTORY(Inventory)
ENDIF()
ADD_SUBDIRECTORY(Inventory)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(Light)
ADD_SUBDIRECTORY(LinkedObjects)
ENDIF()
ADD_SUBDIRECTORY(LinkedObjects)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(Network)
ADD_SUBDIRECTORY(ParticleSystem)
ADD_SUBDIRECTORY(PanelSpriteObject)
ENDIF()
ADD_SUBDIRECTORY(PanelSpriteObject)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(PathBehavior)
ADD_SUBDIRECTORY(PathfindingBehavior)
ADD_SUBDIRECTORY(PhysicsBehavior)
ENDIF()
ADD_SUBDIRECTORY(PlatformBehavior)
ADD_SUBDIRECTORY(PrimitiveDrawing)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(PrimitiveDrawing)
ADD_SUBDIRECTORY(SoundObject)
ADD_SUBDIRECTORY(SystemInfo)
ADD_SUBDIRECTORY(TextEntryObject)
ENDIF()
ADD_SUBDIRECTORY(TextObject)
ADD_SUBDIRECTORY(SystemInfo)
ADD_SUBDIRECTORY(TextEntryObject)
ADD_SUBDIRECTORY(TextObject)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(TileMapObject)
ENDIF()

View File

@@ -25,12 +25,6 @@ public:
*/
DraggableBehaviorJsExtension()
{
SetExtensionInformation("DraggableBehavior",
_("Draggable Behavior"),
_("Behavior allowing to move objects with the mouse"),
"Florian Rival",
"Open source (MIT License)");
DeclareDraggableBehaviorExtension(*this);
GetBehaviorMetadata("DraggableBehavior::Draggable").SetIncludeFile("DraggableBehavior/draggableruntimebehavior.js");

View File

@@ -11,182 +11,185 @@ This project is released under the MIT License.
#include <iostream>
void DeclareInventoryExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("Inventory",
_("Inventory"),
_("Provides action and condition to store an inventory with items in memory."),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension.AddAction("Add",
_("Add an item"),
_("Add an item in an inventory."),
_("Add a _PARAM2_ to inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Add").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("Remove",
_("Remove an item"),
_("Remove an item from an inventory."),
_("Remove a _PARAM2_ from inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Remove").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddCondition("Count",
_("Item count"),
_("Compare the number of an item in an inventory."),
_("Count of _PARAM2_ in _PARAM1_ is _PARAM3__PARAM4_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Count"))
.SetFunctionName("InventoryTools::Count").SetIncludeFile("Inventory/InventoryTools.h")
.SetManipulatedType("number");
extension.AddCondition("Has",
_("Has an item"),
_("Check that there is at least one of the specified item in the inventory."),
_("Inventory _PARAM1_ contains a _PARAM2_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Has").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("SetMaximum",
_("Set a maximum count for an item"),
_("Set the maximum number that can be added in the inventory for the specified item. By default, there is an unlimited number allowed for each item."),
_("Set the maximum count for _PARAM2_ in inventory _PARAM1_ to _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("expression", _("Maximum count"))
.SetFunctionName("InventoryTools::SetMaximum").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("SetUnlimited",
_("Set unlimited count for an item"),
_("Allow an unlimited amount of an object to be in an inventory. This is the case by default for each item."),
_("Allow an unlimited count of _PARAM2_ in inventory _PARAM1_: _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("yesorno", _("Allow an unlimited amount?"))
.SetFunctionName("InventoryTools::SetUnlimited").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddCondition("IsFull",
_("Item full"),
_("Check if an item has reached the maximum number allowed in the inventory."),
_("Inventory _PARAM1_ is full of _PARAM2_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Has").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("Equip",
_("Equip an item"),
_("Mark an item as being equiped. If the item count is 0 it won't be marked as equiped."),
_("Set _PARAM2_ as equiped in inventory _PARAM1_: _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("yesorno", _("Equip?"))
.SetFunctionName("InventoryTools::Equip").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddCondition("IsEquipped",
_("Item equiped"),
_("Check if an item is equiped."),
_("_PARAM2_ is equipped in inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::IsEquipped").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("SerializeToVariable",
_("Save an inventory in a variable"),
_("Save all the items of the inventory in a variable, so that it can be restored later."),
_("Save inventory _PARAM1_ in variable _PARAM2_"),
_("Inventories/Variables"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("scenevar", _("Scene variable"))
.SetFunctionName("InventoryTools::SerializeToVariable").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddAction("UnserializeFromVariable",
_("Load an inventory from a variable"),
_("Load the content of the inventory from a variable."),
_("Load inventory _PARAM1_ from variable _PARAM2_"),
_("Inventories/Variables"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("scenevar", _("Scene variable"))
.SetFunctionName("InventoryTools::UnserializeFromVariable").SetIncludeFile("Inventory/InventoryTools.h");
extension.AddExpression("Count", _("Item count"), _("Get the number of an item in the inventory"), _("Inventory"), "CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", _(""))
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Count").SetIncludeFile("Inventory/InventoryTools.h");
#endif
}
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
class InventoryCppExtension : public ExtensionBase
{
public:
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
InventoryCppExtension()
{
SetExtensionInformation("Inventory",
_("Inventory"),
_("Provides action and condition to store an inventory with items in memory."),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
AddAction("Add",
_("Add an item"),
_("Add an item in an inventory."),
_("Add a _PARAM2_ to inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Add").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("Remove",
_("Remove an item"),
_("Remove an item from an inventory."),
_("Remove a _PARAM2_ from inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Remove").SetIncludeFile("Inventory/InventoryTools.h");
AddCondition("Count",
_("Item count"),
_("Compare the number of an item in an inventory."),
_("Count of _PARAM2_ in _PARAM1_ is _PARAM3__PARAM4_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Count"))
.SetFunctionName("InventoryTools::Count").SetIncludeFile("Inventory/InventoryTools.h")
.SetManipulatedType("number");
AddCondition("Has",
_("Has an item"),
_("Check that there is at least one of the specified item in the inventory."),
_("Inventory _PARAM1_ contains a _PARAM2_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Has").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("SetMaximum",
_("Set a maximum count for an item"),
_("Set the maximum number that can be added in the inventory for the specified item. By default, there is an unlimited number allowed for each item."),
_("Set the maximum count for _PARAM2_ in inventory _PARAM1_ to _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("expression", _("Maximum count"))
.SetFunctionName("InventoryTools::SetMaximum").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("SetUnlimited",
_("Set unlimited count for an item"),
_("Allow an unlimited amount of an object to be in an inventory. This is the case by default for each item."),
_("Allow an unlimited count of _PARAM2_ in inventory _PARAM1_: _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("yesorno", _("Allow an unlimited amount?"))
.SetFunctionName("InventoryTools::SetUnlimited").SetIncludeFile("Inventory/InventoryTools.h");
AddCondition("IsFull",
_("Item full"),
_("Check if an item has reached the maximum number allowed in the inventory."),
_("Inventory _PARAM1_ is full of _PARAM2_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Has").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("Equip",
_("Equip an item"),
_("Mark an item as being equiped. If the item count is 0 it won't be marked as equiped."),
_("Set _PARAM2_ as equiped in inventory _PARAM1_: _PARAM3_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.AddParameter("yesorno", _("Equip?"))
.SetFunctionName("InventoryTools::Equip").SetIncludeFile("Inventory/InventoryTools.h");
AddCondition("IsEquipped",
_("Item equiped"),
_("Check if an item is equiped."),
_("_PARAM2_ is equipped in inventory _PARAM1_"),
_("Inventories"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::IsEquipped").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("SerializeToVariable",
_("Save an inventory in a variable"),
_("Save all the items of the inventory in a variable, so that it can be restored later."),
_("Save inventory _PARAM1_ in variable _PARAM2_"),
_("Inventories/Variables"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("scenevar", _("Scene variable"))
.SetFunctionName("InventoryTools::SerializeToVariable").SetIncludeFile("Inventory/InventoryTools.h");
AddAction("UnserializeFromVariable",
_("Load an inventory from a variable"),
_("Load the content of the inventory from a variable."),
_("Load inventory _PARAM1_ from variable _PARAM2_"),
_("Inventories/Variables"),
"CppPlatform/Extensions/Inventoryicon24.png",
"CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("string", _("Inventory name"))
.AddParameter("scenevar", _("Scene variable"))
.SetFunctionName("InventoryTools::UnserializeFromVariable").SetIncludeFile("Inventory/InventoryTools.h");
AddExpression("Count", _("Item count"), _("Get the number of an item in the inventory"), _("Inventory"), "CppPlatform/Extensions/Inventoryicon16.png")
.AddCodeOnlyParameter("currentScene", _(""))
.AddParameter("string", _("Inventory name"))
.AddParameter("string", _("Item name"))
.SetFunctionName("InventoryTools::Count").SetIncludeFile("Inventory/InventoryTools.h");
#endif
DeclareInventoryExtension(*this);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
@@ -198,10 +201,16 @@ public:
}
};
#if defined(ANDROID)
extern "C" ExtensionBase * CreateGDCppInventoryExtension() {
return new InventoryCppExtension;
}
#elif !defined(EMSCRIPTEN)
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
return new Extension;
return new InventoryCppExtension;
}
#endif

View File

@@ -11,25 +11,21 @@ This project is released under the MIT License.
#include <iostream>
#include "GDCore/Tools/Localization.h"
void DeclareInventoryExtension(gd::PlatformExtension & extension);
/**
* \brief This class declares information about the JS extension.
*/
class JsExtension : public gd::PlatformExtension
class InventoryJsExtension : public gd::PlatformExtension
{
public:
/**
* \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
JsExtension()
InventoryJsExtension()
{
SetExtensionInformation("Inventory",
_("Inventory"),
_("Provides action and condition to store an inventory with items in memory."),
"Florian Rival",
"Open source (MIT License)");
CloneExtension("GDevelop C++ platform", "Inventory");
DeclareInventoryExtension(*this);
GetAllActions()["Inventory::Add"].codeExtraInformation
.SetIncludeFile("Inventory/inventory.js")
@@ -84,14 +80,21 @@ public:
.SetFunctionName("gdjs.evtTools.inventory.count");
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension * CreateGDJSInventoryExtension() {
return new InventoryJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
return new JsExtension;
return new InventoryJsExtension;
}
#endif
#endif

View File

@@ -11,98 +11,102 @@ This project is released under the MIT License.
#include <iostream>
void DeclareLinkedObjectsExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("LinkedObjects",
_("Linked objects"),
_("Extension allowing to virtually link two objects."),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension.AddAction("LinkObjects",
_("Link two objects"),
_("Link two objects together, so as to be able to get one from the other."),
_("Link _PARAM1_ and _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1"))
.AddParameter("objectPtr", _("Object 2"))
.SetFunctionName("GDpriv::LinkedObjects::LinkObjects").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
extension.AddAction("RemoveLinkBetween",
_("Unlink two objects"),
_("Unlink two objects."),
_("Unlink _PARAM1_ and _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1"))
.AddParameter("objectPtr", _("Object 2"))
.SetFunctionName("GDpriv::LinkedObjects::RemoveLinkBetween").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
extension.AddAction("RemoveAllLinksOf",
_("Unlink all objects from an object"),
_("Unlink all objects from an object."),
_("Unlink all objects from _PARAM1_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.SetFunctionName("GDpriv::LinkedObjects::RemoveAllLinksOf").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
extension.AddCondition("PickObjectsLinkedTo",
_("Take into account linked objects"),
_("Take some objects linked to the object into account for next conditions and actions.\nThe condition will return false if no object was taken into account."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects..."))
.AddParameter("objectPtr", _("...if they are linked to this object"))
.SetFunctionName("GDpriv::LinkedObjects::PickObjectsLinkedTo").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
extension.AddAction("PickObjectsLinkedTo",
_("Take into account linked objects"),
_("Take objects linked to the object into account for next actions."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects..."))
.AddParameter("objectPtr", _("...if they are linked to this object"))
.SetFunctionName("GDpriv::LinkedObjects::PickObjectsLinkedTo").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
#endif
}
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
class LinkedObjectsCppExtension : public ExtensionBase
{
public:
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
LinkedObjectsCppExtension()
{
SetExtensionInformation("LinkedObjects",
_("Linked objects"),
_("Extension allowing to virtually link two objects."),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
AddAction("LinkObjects",
_("Link two objects"),
_("Link two objects together, so as to be able to get one from the other."),
_("Link _PARAM1_ and _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1"))
.AddParameter("objectPtr", _("Object 2"))
.SetFunctionName("GDpriv::LinkedObjects::LinkObjects").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
AddAction("RemoveLinkBetween",
_("Unlink two objects"),
_("Unlink two objects."),
_("Unlink _PARAM1_ and _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object 1"))
.AddParameter("objectPtr", _("Object 2"))
.SetFunctionName("GDpriv::LinkedObjects::RemoveLinkBetween").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
AddAction("RemoveAllLinksOf",
_("Unlink all objects from an object"),
_("Unlink all objects from an object."),
_("Unlink all objects from _PARAM1_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectPtr", _("Object"))
.SetFunctionName("GDpriv::LinkedObjects::RemoveAllLinksOf").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
AddCondition("PickObjectsLinkedTo",
_("Take into account linked objects"),
_("Take some objects linked to the object into account for next conditions and actions.\nThe condition will return false if no object was taken into account."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects..."))
.AddParameter("objectPtr", _("...if they are linked to this object"))
.SetFunctionName("GDpriv::LinkedObjects::PickObjectsLinkedTo").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
AddAction("PickObjectsLinkedTo",
_("Take into account linked objects"),
_("Take objects linked to the object into account for next actions."),
_("Take into account all \"_PARAM1_\" linked to _PARAM2_"),
_("Linked objects"),
"CppPlatform/Extensions/LinkedObjectsicon24.png",
"CppPlatform/Extensions/LinkedObjectsicon16.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("objectList", _("Pick these objects..."))
.AddParameter("objectPtr", _("...if they are linked to this object"))
.SetFunctionName("GDpriv::LinkedObjects::PickObjectsLinkedTo").SetIncludeFile("LinkedObjects/LinkedObjectsTools.h");
#endif
DeclareLinkedObjectsExtension(*this);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
@@ -136,10 +140,16 @@ public:
}
};
#if defined(ANDROID)
extern "C" ExtensionBase * CreateGDCppLinkedObjectsExtension() {
return new LinkedObjectsCppExtension;
}
#elif !defined(EMSCRIPTEN)
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
return new Extension;
return new LinkedObjectsCppExtension;
}
#endif

View File

@@ -11,25 +11,21 @@ This project is released under the MIT License.
#include <iostream>
#include "GDCore/Tools/Localization.h"
void DeclareLinkedObjectsExtension(gd::PlatformExtension & extension);
/**
* \brief This class declares information about the JS extension.
*/
class JsExtension : public gd::PlatformExtension
class LinkedObjectsJsExtension : public gd::PlatformExtension
{
public:
/**
* \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
JsExtension()
LinkedObjectsJsExtension()
{
SetExtensionInformation("LinkedObjects",
_("Linked objects"),
_("Extension allowing to virtually link two objects."),
"Florian Rival",
"Open source (MIT License)");
CloneExtension("GDevelop C++ platform", "LinkedObjects");
DeclareLinkedObjectsExtension(*this);
GetAllActions()["LinkedObjects::LinkObjects"].codeExtraInformation.SetIncludeFile("LinkedObjects/linkedobjects.js")
.SetFunctionName("gdjs.evtTools.linkedObjects.linkObjects");
@@ -43,14 +39,21 @@ public:
.SetFunctionName("gdjs.evtTools.linkedObjects.pickObjectsLinkedTo");
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension * CreateGDJSLinkedObjectsExtension() {
return new LinkedObjectsJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
return new JsExtension;
return new LinkedObjectsJsExtension;
}
#endif
#endif

View File

@@ -5,8 +5,8 @@ Copyright (c) 2012-2016 Victor Levasseur (victorlevasseur01@orange.fr)
This project is released under the MIT License.
*/
#ifndef TILEDSPRITEOBJECT_H
#define TILEDSPRITEOBJECT_H
#ifndef PANELSPRITEOBJECT_H
#define PANELSPRITEOBJECT_H
#include "GDCpp/Runtime/Project/Object.h"
#include "GDCpp/Runtime/RuntimeObject.h"
#include <memory>
@@ -64,7 +64,10 @@ public :
bool IsTiled() const { return tiled; };
void SetTiled(bool enable = true) { tiled = enable; };
gd::String textureName;
void SetTexture(const gd::String & newTextureName) { textureName = newTextureName; };
const gd::String & GetTexture() const { return textureName; };
gd::String textureName; ///<deprecated. Use Get/SetTexture instead.
private:
virtual void DoUnserializeFrom(gd::Project & project, const gd::SerializerElement & element);
@@ -141,4 +144,4 @@ private:
std::shared_ptr<SFMLTextureWrapper> texture;
};
#endif // TILEDSPRITEOBJECT_H
#endif // PANELSPRITEOBJECT_H

View File

@@ -25,7 +25,10 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension & extension)
"CppPlatform/Extensions/primitivedrawingicon.png");
#if defined(GD_IDE_ONLY)
#if !defined(GD_NO_WX_GUI)
ShapePainterObject::LoadEdittimeIcon();
#endif
obj.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
obj.AddAction("Rectangle",

View File

@@ -27,7 +27,7 @@ This project is released under the MIT License.
#include "ShapePainterObjectEditor.h"
#endif
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
sf::Texture ShapePainterObject::edittimeIconImage;
sf::Sprite ShapePainterObject::edittimeIcon;
#endif
@@ -59,7 +59,7 @@ RuntimeShapePainterObject::RuntimeShapePainterObject(RuntimeScene & scene, const
ShapePainterObjectBase::operator=(shapePainterObject);
}
void ShapePainterObjectBase::UnserializeFrom(const gd::SerializerElement & element)
void ShapePainterObjectBase::DoUnserializeFrom(const gd::SerializerElement & element)
{
fillOpacity = element.GetChild("fillOpacity", 0, "FillOpacity").GetValue().GetInt();
outlineSize = element.GetChild("outlineSize", 0, "OutlineSize").GetValue().GetInt();
@@ -78,11 +78,11 @@ void ShapePainterObjectBase::UnserializeFrom(const gd::SerializerElement & eleme
void ShapePainterObject::DoUnserializeFrom(gd::Project & project, const gd::SerializerElement & element)
{
ShapePainterObjectBase::UnserializeFrom(element);
ShapePainterObjectBase::DoUnserializeFrom(element);
}
#if defined(GD_IDE_ONLY)
void ShapePainterObjectBase::SerializeTo(gd::SerializerElement & element) const
void ShapePainterObjectBase::DoSerializeTo(gd::SerializerElement & element) const
{
element.AddChild("fillOpacity").SetValue(fillOpacity);
element.AddChild("outlineSize").SetValue(outlineSize);
@@ -100,7 +100,7 @@ void ShapePainterObjectBase::SerializeTo(gd::SerializerElement & element) const
void ShapePainterObject::DoSerializeTo(gd::SerializerElement & element) const
{
ShapePainterObjectBase::SerializeTo(element);
ShapePainterObjectBase::DoSerializeTo(element);
}
#endif
@@ -127,7 +127,7 @@ bool RuntimeShapePainterObject::Draw( sf::RenderTarget& renderTarget )
return true;
}
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
/**
* Render object at edittime
*/
@@ -145,21 +145,20 @@ void ShapePainterObject::LoadEdittimeIcon()
bool ShapePainterObject::GenerateThumbnail(const gd::Project & project, wxBitmap & thumbnail) const
{
#if !defined(GD_NO_WX_GUI)
thumbnail = wxBitmap("CppPlatform/Extensions/primitivedrawingicon24.png", wxBITMAP_TYPE_ANY);
#endif
return true;
}
void ShapePainterObject::EditObject( wxWindow* parent, gd::Project & game, gd::MainFrameWrapper & mainFrameWrapper )
{
#if !defined(GD_NO_WX_GUI)
ShapePainterObjectEditor dialog(parent, game, *this);
dialog.ShowModal();
#endif
}
#endif
#if defined(GD_IDE_ONLY)
void RuntimeShapePainterObject::GetPropertyForDebugger(std::size_t propertyNb, gd::String & name, gd::String & value) const
{
if ( propertyNb == 0 ) {name = _("Fill color"); value = gd::String::From(GetFillColorR())+";"+gd::String::From(GetFillColorG())+";"+gd::String::From(GetFillColorB());}

View File

@@ -52,11 +52,6 @@ public:
ShapePainterObjectBase();
virtual ~ShapePainterObjectBase() {};
virtual void UnserializeFrom(const gd::SerializerElement & element);
#if defined(GD_IDE_ONLY)
virtual void SerializeTo(gd::SerializerElement & element) const;
#endif
inline void SetOutlineSize(float size) { outlineSize = size; };
inline float GetOutlineSize() const { return outlineSize; };
@@ -87,6 +82,13 @@ public:
inline void SetCoordinatesAbsolute() { absoluteCoordinates = true; }
inline void SetCoordinatesRelative() { absoluteCoordinates = false; }
inline bool AreCoordinatesAbsolute() { return absoluteCoordinates; }
protected:
virtual void DoUnserializeFrom(const gd::SerializerElement & element);
#if defined(GD_IDE_ONLY)
virtual void DoSerializeTo(gd::SerializerElement & element) const;
#endif
private:
//Fill color
unsigned int fillColorR;
@@ -115,7 +117,7 @@ public:
virtual ~ShapePainterObject() {};
virtual std::unique_ptr<gd::Object> Clone() const { return gd::make_unique<ShapePainterObject>(*this); }
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
virtual void DrawInitialInstance(gd::InitialInstance & instance, sf::RenderTarget & renderTarget, gd::Project & project, gd::Layout & layout);
virtual sf::Vector2f GetInitialInstanceDefaultSize(gd::InitialInstance & instance, gd::Project & project, gd::Layout & layout) const {return sf::Vector2f(32,32);};
virtual bool GenerateThumbnail(const gd::Project & project, wxBitmap & thumbnail) const;
@@ -129,9 +131,11 @@ private:
#if defined(GD_IDE_ONLY)
virtual void DoSerializeTo(gd::SerializerElement & element) const;
#if !defined(GD_NO_WX_GUI)
static sf::Texture edittimeIconImage;
static sf::Sprite edittimeIcon;
#endif
#endif
};
class GD_EXTENSION_API RuntimeShapePainterObject : public RuntimeObject, public ShapePainterObjectBase

View File

@@ -18,14 +18,14 @@ This project is released under the MIT License.
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
class SoundObjectCppExtension : public ExtensionBase
{
public:
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
SoundObjectCppExtension()
{
SetExtensionInformation("SoundObject",
_("Sound object"),
@@ -524,10 +524,16 @@ public:
};
};
#if defined(ANDROID)
extern "C" ExtensionBase * CreateGDCppSoundObjectExtension() {
return new SoundObjectCppExtension;
}
#elif !defined(EMSCRIPTEN)
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
return new Extension;
return new SoundObjectCppExtension;
}
#endif

View File

@@ -7,6 +7,27 @@ This project is released under the MIT License.
#include "GDCpp/Extensions/ExtensionBase.h"
void DeclareSystemInfoExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("SystemInfo",
_("System information"),
_("Provides information about the system running the game"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
extension.AddCondition("IsMobile",
_("Is a mobile device"),
_("Check if the device running the game is a mobile device"),
_("The device is a mobile device"),
_("System information"),
"CppPlatform/Extensions/systeminfoicon24.png",
"CppPlatform/Extensions/systeminfoicon16.png")
.SetFunctionName("SystemInfo::IsMobile").SetIncludeFile("SystemInfo/SystemInfoTools.h");
#endif
}
/**
* \brief This class declares information about the extension.
@@ -20,24 +41,7 @@ public:
*/
SystemInfoCppExtension()
{
SetExtensionInformation("SystemInfo",
_("System information"),
_("Provides information about the system running the game"),
"Florian Rival",
"Open source (MIT License)");
#if defined(GD_IDE_ONLY)
AddCondition("IsMobile",
_("Is a mobile device"),
_("Check if the device running the game is a mobile device"),
_("The device is a mobile device"),
_("System information"),
"CppPlatform/Extensions/systeminfoicon24.png",
"CppPlatform/Extensions/systeminfoicon16.png")
.SetFunctionName("SystemInfo::IsMobile").SetIncludeFile("SystemInfo/SystemInfoTools.h");
#endif
DeclareSystemInfoExtension(*this);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};

View File

@@ -9,38 +9,41 @@ This project is released under the MIT License.
#include "GDCore/Tools/Localization.h"
void DeclareSystemInfoExtension(gd::PlatformExtension & extension);
/**
* \brief This class declares information about the JS extension.
*/
class JsExtension : public gd::PlatformExtension
class SystemInfoJsExtension : public gd::PlatformExtension
{
public:
/**
* \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
JsExtension()
SystemInfoJsExtension()
{
SetExtensionInformation("SystemInfo",
_("System information"),
_("Provides information about the system running the game"),
"Florian Rival",
"Open source (MIT License)");
CloneExtension("GDevelop C++ platform", "SystemInfo");
DeclareSystemInfoExtension(*this);
GetAllConditions()["SystemInfo::IsMobile"].codeExtraInformation.SetIncludeFile("SystemInfo/systeminfotools.js")
.SetFunctionName("gdjs.evtTools.systemInfo.isMobile");
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension * CreateGDJSSystemInfoExtension() {
return new SystemInfoJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
return new JsExtension;
return new SystemInfoJsExtension;
}
#endif
#endif

View File

@@ -25,7 +25,9 @@ void DeclareTextEntryObjectExtension(gd::PlatformExtension & extension)
"CppPlatform/Extensions/textentry.png");
#if defined(GD_IDE_ONLY)
#if !defined(GD_NO_WX_GUI)
TextEntryObject::LoadEdittimeIcon();
#endif
obj.SetIncludeFile("TextEntryObject/TextEntryObject.h");
obj.AddAction("String",

View File

@@ -26,12 +26,6 @@ public:
*/
TextEntryObjectJsExtension()
{
SetExtensionInformation("TextEntryObject",
_("Text entry object"),
_("Extension allowing to use an object capturing text entered with keyboard."),
"Florian Rival",
"Open source (MIT License)");
DeclareTextEntryObjectExtension(*this);
GetObjectMetadata("TextEntryObject::TextEntry")

View File

@@ -27,7 +27,7 @@ This project is released under the MIT License.
using namespace std;
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
sf::Texture TextEntryObject::edittimeIconImage;
sf::Sprite TextEntryObject::edittimeIcon;
#endif
@@ -71,7 +71,7 @@ void RuntimeTextEntryObject::Update(const RuntimeScene & scene)
}
}
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
void TextEntryObject::DrawInitialInstance(gd::InitialInstance & instance, sf::RenderTarget & renderTarget, gd::Project & project, gd::Layout & layout)
{
edittimeIcon.setPosition(instance.GetX(), instance.GetY());
@@ -86,13 +86,13 @@ void TextEntryObject::LoadEdittimeIcon()
bool TextEntryObject::GenerateThumbnail(const gd::Project & project, wxBitmap & thumbnail) const
{
#if !defined(GD_NO_WX_GUI)
thumbnail = wxBitmap("CppPlatform/Extensions/textentry.png", wxBITMAP_TYPE_ANY);
#endif
return true;
}
#endif
#if defined(GD_IDE_ONLY)
void RuntimeTextEntryObject::GetPropertyForDebugger(std::size_t propertyNb, gd::String & name, gd::String & value) const
{
if ( propertyNb == 0 ) {name = _("Text in memory"); value = GetString();}

View File

@@ -34,14 +34,14 @@ public :
virtual ~TextEntryObject() {};
virtual std::unique_ptr<gd::Object> Clone() const { return gd::make_unique<TextEntryObject>(*this); }
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
virtual void DrawInitialInstance(gd::InitialInstance & instance, sf::RenderTarget & renderTarget, gd::Project & project, gd::Layout & layout);
virtual bool GenerateThumbnail(const gd::Project & project, wxBitmap & thumbnail) const;
static void LoadEdittimeIcon();
#endif
private:
#if defined(GD_IDE_ONLY)
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
static sf::Texture edittimeIconImage;
static sf::Sprite edittimeIcon;
#endif

View File

@@ -52,7 +52,7 @@ public :
void SetTexture(const gd::String & newTextureName) { textureName = newTextureName; };
const gd::String & GetTexture() const { return textureName; };
gd::String textureName;
gd::String textureName; ///<deprecated. Use Get/SetTexture instead.
private:

View File

@@ -81,7 +81,7 @@ bool AndroidExporter::ExportWholeProject(gd::Project & project, gd::String expor
ExportMainFile(exportedProject, exportDir);
//Strip the project (*after* generating events as the events may use stripped things (objects groups...))
gd::ProjectStripper::StripProject(exportedProject);
gd::ProjectStripper::StripProjectForExport(exportedProject);
//Export the project file
gd::SerializerElement rootElement;

View File

@@ -255,7 +255,7 @@ void FullProjectCompiler::LaunchProjectCompilation()
gd::SafeYield::Do();
diagnosticManager.OnMessage(_( "Copying resources..." ), _( "Step 1 out of 3" ));
gd::Project strippedProject = game;
gd::ProjectStripper::StripProject(strippedProject);
gd::ProjectStripper::StripProjectForExport(strippedProject);
gd::ProjectFileWriter::SaveToFile(strippedProject, tempDir + "/GDProjectSrcFile.gdg", true);
diagnosticManager.OnPercentUpdate(80);

View File

@@ -3,7 +3,7 @@ GDevelop C++ Plaform (GDCpp)
The MIT License (MIT)
Copyright (c) 2008-2016 Florian Rival
Copyright (c) 2008-2017 Florian Rival
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -60,7 +60,7 @@ GDCpp also uses the Liberation font which is licensed under the SIL OPEN FONT LI
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright

View File

@@ -129,6 +129,13 @@ gd::PlatformExtension * CreateGDJSDraggableBehaviorExtension();
gd::PlatformExtension * CreateGDJSTopDownMovementBehaviorExtension();
gd::PlatformExtension * CreateGDJSTextObjectExtension();
gd::PlatformExtension * CreateGDJSAdMobObjectExtension();
gd::PlatformExtension * CreateGDJSPanelSpriteObjectExtension();
gd::PlatformExtension * CreateGDJSAnchorBehaviorExtension();
gd::PlatformExtension * CreateGDJSPrimitiveDrawingExtension();
gd::PlatformExtension * CreateGDJSTextEntryObjectExtension();
gd::PlatformExtension * CreateGDJSInventoryExtension();
gd::PlatformExtension * CreateGDJSLinkedObjectsExtension();
gd::PlatformExtension * CreateGDJSSystemInfoExtension();
}
#endif
@@ -167,6 +174,13 @@ JsPlatform::JsPlatform() :
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSTopDownMovementBehaviorExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSTextObjectExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSAdMobObjectExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSPanelSpriteObjectExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSAnchorBehaviorExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSPrimitiveDrawingExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSTextEntryObjectExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSInventoryExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSLinkedObjectsExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSSystemInfoExtension())); std::cout.flush();
#endif
std::cout << "done." << std::endl;
};

View File

@@ -48,7 +48,7 @@ Exporter::~Exporter()
bool Exporter::ExportLayoutForPixiPreview(gd::Project & project, gd::Layout & layout, gd::String exportDir)
{
ExporterHelper helper(fs);
ExporterHelper helper(fs, gdjsRoot);
return helper.ExportLayoutForPixiPreview(project, layout, exportDir, "");
}
@@ -58,7 +58,7 @@ bool Exporter::ExportExternalLayoutForPixiPreview(gd::Project & project, gd::Lay
gd::SerializerElement options;
options.AddChild("injectExternalLayout").SetValue(externalLayout.GetName());
ExporterHelper helper(fs);
ExporterHelper helper(fs, gdjsRoot);
return helper.ExportLayoutForPixiPreview(project, layout, exportDir,
gd::Serializer::ToJSON(options)
);
@@ -89,7 +89,7 @@ void Exporter::ShowProjectExportDialog(gd::Project & project)
bool Exporter::ExportWholePixiProject(gd::Project & project, gd::String exportDir,
bool minify, bool exportForCordova)
{
ExporterHelper helper(fs);
ExporterHelper helper(fs, gdjsRoot);
auto exportProject = [this, &project, &minify,
&exportForCordova, &helper](gd::String exportDir)
@@ -131,7 +131,7 @@ bool Exporter::ExportWholePixiProject(gd::Project & project, gd::String exportDi
}
//Strip the project (*after* generating events as the events may use stripped things like objects groups...)...
gd::ProjectStripper::StripProject(exportedProject);
gd::ProjectStripper::StripProjectForExport(exportedProject);
//...and export it
helper.ExportToJSON(fs, exportedProject, fs.GetTempDir() + "/GDTemporaries/JSCodeTemp/data.js",
@@ -147,8 +147,8 @@ bool Exporter::ExportWholePixiProject(gd::Project & project, gd::String exportDi
helper.ExportIncludesAndLibs(includesFiles, exportDir, minify);
gd::String source = exportForCordova ?
"./JsPlatform/Runtime/Cordova/www/index.html" :
"./JsPlatform/Runtime/index.html";
(gdjsRoot + "/Runtime/Cordova/www/index.html") :
(gdjsRoot + "/Runtime/index.html");
if (!helper.ExportPixiIndexFile(source, exportDir, includesFiles, ""))
{
@@ -195,7 +195,7 @@ bool Exporter::ExportWholePixiProject(gd::Project & project, gd::String exportDi
bool Exporter::ExportWholeCocos2dProject(gd::Project & project, bool debugMode, gd::String exportDir)
{
ExporterHelper helper(fs);
ExporterHelper helper(fs, gdjsRoot);
wxProgressDialog * progressDialogPtr = NULL;
#if !defined(GD_NO_WX_GUI)
@@ -233,7 +233,7 @@ bool Exporter::ExportWholeCocos2dProject(gd::Project & project, bool debugMode,
}
//Strip the project (*after* generating events as the events may use stripped things like objects groups...)...
gd::ProjectStripper::StripProject(exportedProject);
gd::ProjectStripper::StripProjectForExport(exportedProject);
//...and export it
helper.ExportToJSON(fs, exportedProject, fs.GetTempDir() + "/GDTemporaries/JSCodeTemp/data.js",

View File

@@ -23,7 +23,11 @@ namespace gdjs
class Exporter : public gd::ProjectExporter
{
public:
Exporter(gd::AbstractFileSystem & fileSystem) : fs(fileSystem) {};
Exporter(gd::AbstractFileSystem & fileSystem, gd::String gdjsRoot_ = "./JsPlatform") :
fs(fileSystem),
gdjsRoot(gdjsRoot_)
{
};
virtual ~Exporter();
/**
@@ -82,6 +86,7 @@ public:
private:
gd::AbstractFileSystem & fs; ///< The abstract file system to be used for exportation.
gd::String lastError; ///< The last error that occurred.
gd::String gdjsRoot; ///< The root directory of GDJS, used to copy runtime files.
};
}

View File

@@ -89,7 +89,7 @@ bool ExporterHelper::ExportLayoutForPixiPreview(gd::Project & project, gd::Layou
}
//Strip the project (*after* generating events as the events may use stripped things (objects groups...))
gd::ProjectStripper::StripProject(exportedProject);
gd::ProjectStripper::StripProjectForExport(exportedProject);
exportedProject.SetFirstLayout(layout.GetName());
//Export the project
@@ -102,7 +102,7 @@ bool ExporterHelper::ExportLayoutForPixiPreview(gd::Project & project, gd::Layou
ExportIncludesAndLibs(includesFiles, exportDir, false);
//Create the index file
if (!ExportPixiIndexFile("./JsPlatform/Runtime/index.html", exportDir, includesFiles, additionalSpec))
if (!ExportPixiIndexFile(gdjsRoot + "/Runtime/index.html", exportDir, includesFiles, additionalSpec))
return false;
return true;
@@ -151,7 +151,7 @@ bool ExporterHelper::ExportPixiIndexFile(gd::String source, gd::String exportDir
bool ExporterHelper::ExportCordovaConfigFile(const gd::Project & project, gd::String exportDir)
{
gd::String str = fs.ReadFile("./JsPlatform/Runtime/Cordova/config.xml")
gd::String str = fs.ReadFile(gdjsRoot + "/Runtime/Cordova/config.xml")
.FindAndReplace("GDJS_PROJECTNAME", project.GetName())
.FindAndReplace("GDJS_PACKAGENAME", project.GetPackageName())
.FindAndReplace("GDJS_ORIENTATION", "default");
@@ -167,20 +167,20 @@ bool ExporterHelper::ExportCordovaConfigFile(const gd::Project & project, gd::St
bool ExporterHelper::ExportCocos2dFiles(const gd::Project & project, gd::String exportDir, bool debugMode, const std::vector<gd::String> & includesFiles)
{
if (!fs.CopyFile("./JsPlatform/Runtime/Cocos2d/main.js", exportDir + "/main.js"))
if (!fs.CopyFile(gdjsRoot + "/Runtime/Cocos2d/main.js", exportDir + "/main.js"))
{
lastError = "Unable to write Cocos2d main.js file.";
return false;
}
if (!fs.CopyFile("./JsPlatform/Runtime/Cocos2d/cocos2d-js-v3.10.js", exportDir + "/cocos2d-js-v3.10.js"))
if (!fs.CopyFile(gdjsRoot + "/Runtime/Cocos2d/cocos2d-js-v3.10.js", exportDir + "/cocos2d-js-v3.10.js"))
{
lastError = "Unable to write Cocos2d cocos2d-js-v3.10.js file.";
return false;
}
{
gd::String str = fs.ReadFile("./JsPlatform/Runtime/Cocos2d/index.html");
gd::String str = fs.ReadFile(gdjsRoot + "/Runtime/Cocos2d/index.html");
//Generate custom declarations for font resources
gd::String customCss;
@@ -218,7 +218,7 @@ bool ExporterHelper::ExportCocos2dFiles(const gd::Project & project, gd::String
first = false;
}
gd::String str = fs.ReadFile("./JsPlatform/Runtime/Cocos2d/project.json")
gd::String str = fs.ReadFile(gdjsRoot + "/Runtime/Cocos2d/project.json")
.FindAndReplace("// GDJS_INCLUDE_FILES", includeFilesStr)
.FindAndReplace("/*GDJS_SHOW_FPS*/", debugMode ? "true" : "false");
@@ -462,20 +462,20 @@ bool ExporterHelper::ExportIncludesAndLibs(std::vector<gd::String> & includesFil
{
for ( std::vector<gd::String>::iterator include = includesFiles.begin() ; include != includesFiles.end(); ++include )
{
if ( fs.FileExists("./JsPlatform/Runtime/"+*include) )
if ( fs.FileExists(gdjsRoot + "/Runtime/"+*include) )
{
gd::String path = fs.DirNameFrom(exportDir+"/"+*include);
if ( !fs.DirExists(path) ) fs.MkDir(path);
fs.CopyFile("./JsPlatform/Runtime/"+*include, exportDir+"/"+*include);
fs.CopyFile(gdjsRoot + "/Runtime/"+*include, exportDir+"/"+*include);
//Ok, the filename is relative to the export dir.
}
else if ( fs.FileExists("./JsPlatform/Runtime/Extensions/"+*include) )
else if ( fs.FileExists(gdjsRoot + "/Runtime/Extensions/"+*include) )
{
gd::String path = fs.DirNameFrom(exportDir+"/Extensions/"+*include);
if ( !fs.DirExists(path) ) fs.MkDir(path);
fs.CopyFile("./JsPlatform/Runtime/Extensions/"+*include, exportDir+"/Extensions/"+*include);
fs.CopyFile(gdjsRoot + "/Runtime/Extensions/"+*include, exportDir+"/Extensions/"+*include);
*include = "Extensions/"+*include; //Ensure filename is relative to the export dir.
}
else if ( fs.FileExists(*include) )

View File

@@ -24,7 +24,7 @@ namespace gdjs
class ExporterHelper
{
public:
ExporterHelper(gd::AbstractFileSystem & fileSystem) : fs(fileSystem) {};
ExporterHelper(gd::AbstractFileSystem & fileSystem, gd::String gdjsRoot_) : fs(fileSystem), gdjsRoot(gdjsRoot_) {};
virtual ~ExporterHelper() {};
/**
@@ -161,6 +161,7 @@ public:
gd::AbstractFileSystem & fs; ///< The abstract file system to be used for exportation.
gd::String lastError; ///< The last error that occurred.
gd::String gdjsRoot; ///< The root directory of GDJS, used to copy runtime files.
};
}

View File

@@ -39,6 +39,15 @@ gdjs.SceneStack.prototype.step = function(elapsedTime) {
return true;
};
gdjs.SceneStack.prototype.renderWithoutStep = function(elapsedTime) {
if (this._stack.length === 0) return false;
var currentScene = this._stack[this._stack.length - 1];
currentScene.render(elapsedTime);
return true;
};
gdjs.SceneStack.prototype.pop = function() {
if (this._stack.length <= 1) return null;

View File

@@ -3,7 +3,7 @@ GDevelop JS Plaform (GDJS)
The MIT License (MIT)
Copyright (c) 2008-2016 Florian Rival
Copyright (c) 2008-2017 Florian Rival
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -8,10 +8,10 @@ if [ ! $# -eq 0 ]; then
fi
#Copy all js files
echo "Copying GDJS and extensions runtime files (*.js) to '$DESTINATION'..."
echo " Copying GDJS and extensions runtime files (*.js) to '$DESTINATION'..."
mkdir -p "$DESTINATION"
cp -R ../Runtime/* "$DESTINATION"
rsync -r -u --include=*.js --include=*/ --exclude=* ../../Extensions/ "$DESTINATION"/Extensions/
echo "Done."
echo "✅ Copied GDJS and extensions runtime files (*.js) to '$DESTINATION'."

View File

@@ -264,7 +264,7 @@ void CodeEditor::OnResize(wxSizeEvent& event)
textEditor->SetSize(event.GetSize());
}
void CodeEditor::ForceRefreshRibbonAndConnect()
void CodeEditor::EditorDisplayed()
{
mainFrameWrapper.SetRibbonPage(_("Code"));
ConnectEvents();

View File

@@ -54,7 +54,7 @@ public:
/**
* Can be called by parent so as to refresh ribbon for this editor.
*/
void ForceRefreshRibbonAndConnect();
void EditorDisplayed();
protected:

View File

@@ -4,11 +4,13 @@
#include "../ExternalEventsEditor.h"
#include "../EditorScene.h"
#include "../CodeEditor.h"
#include "../LogFileManager.h"
#include "ExternalLayoutEditor.h"
#include "StartHerePage.h"
#include "GDCore/Tools/Localization.h"
#include "GDCore/IDE/wxTools/SkinHelper.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Project/ExternalLayout.h"
#include "GDCore/Project/ExternalEvents.h"
#include "GDCore/Project/SourceFile.h"
#include "GDCore/String.h"
@@ -27,6 +29,62 @@ void EditorsNotebookManager::UpdatePageLabel(int pageIndex, wxString name)
notebook->SetPageText(pageIndex, GetLabelFor(notebook->GetPage(pageIndex), name));
}
void EditorsNotebookManager::NotifyPageDisplayed(wxWindow * newPage)
{
if ( EditorScene * sceneEditorPtr = dynamic_cast<EditorScene*>(newPage) )
{
sceneEditorPtr->EditorDisplayed();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of layout \""+sceneEditorPtr->GetLayout().GetName()+"\"");
}
else if ( ResourcesEditor * imagesEditorPtr = dynamic_cast<ResourcesEditor*>(newPage) )
{
imagesEditorPtr->EditorDisplayed();
LogFileManager::Get()->WriteToLogFile("Switched to resources editor of project \""+imagesEditorPtr->project.GetName()+"\"");
}
else if ( CodeEditor * codeEditorPtr = dynamic_cast<CodeEditor*>(newPage) )
{
codeEditorPtr->EditorDisplayed();
LogFileManager::Get()->WriteToLogFile("Switched to code editor of file \""+codeEditorPtr->filename+"\"");
}
else if ( ExternalEventsEditor * externalEventsEditorPtr = dynamic_cast<ExternalEventsEditor*>(newPage) )
{
externalEventsEditorPtr->EditorDisplayed();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of external events \""+externalEventsEditorPtr->events.GetName()+"\"");
}
else if ( ExternalLayoutEditor * externalLayoutEditorPtr = dynamic_cast<ExternalLayoutEditor*>(newPage) )
{
externalLayoutEditorPtr->EditorDisplayed();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of external layout \""+externalLayoutEditorPtr->GetExternalLayout().GetName()+"\"");
}
}
void EditorsNotebookManager::NotifyPageNotDisplayed(wxWindow * newPage)
{
if ( EditorScene * sceneEditorPtr = dynamic_cast<EditorScene*>(newPage) )
sceneEditorPtr->EditorNotDisplayed();
else if ( ExternalLayoutEditor * externalLayoutEditorPtr = dynamic_cast<ExternalLayoutEditor*>(newPage) )
externalLayoutEditorPtr->EditorNotDisplayed();
}
void EditorsNotebookManager::MainFrameNotDisplayed()
{
for (std::size_t k =0;k<notebook->GetPageCount();k++)
{
wxWindow * page = notebook->GetPage(k);
NotifyPageNotDisplayed(page);
}
}
void EditorsNotebookManager::PageChanged(wxWindow * newPage)
{
for (std::size_t k =0;k<notebook->GetPageCount();k++)
{
wxWindow * page = notebook->GetPage(k);
if (page == newPage) NotifyPageDisplayed(page);
else NotifyPageNotDisplayed(page);
}
}
wxBitmap EditorsNotebookManager::GetIconFor(wxWindow * page)
{
if (dynamic_cast<ResourcesEditor*>(page))

View File

@@ -29,6 +29,9 @@ public:
void AddPage(wxWindow * page, wxString name = "", bool select = false);
void OnPageAdded(std::function<void(wxWindow*)> cb) { onPageAddedCb = cb; }
void PageChanged(wxWindow * newPage);
void MainFrameNotDisplayed();
void UpdatePageLabel(int pageIndex, wxString name);
void CloseAllPagesFor(gd::Project & project);
@@ -53,6 +56,9 @@ public:
wxString GetLabelFor(wxWindow * page, wxString name = "");
private:
void NotifyPageDisplayed(wxWindow * newPage);
void NotifyPageNotDisplayed(wxWindow * page);
gd::Project * GetProjectFor(wxWindow * page);
wxBitmap GetIconFor(wxWindow * page);

View File

@@ -0,0 +1,32 @@
#include "ExternalEditorPanel.h"
ExternalEditorPanel::ExternalEditorPanel(wxWindow* parent)
: ExternalEditorPanelBase(parent)
{
loadingProgress->Pulse();
HideLoader(false);
}
ExternalEditorPanel::~ExternalEditorPanel()
{
}
void ExternalEditorPanel::HideLoader(bool hide)
{
loadingProgress->Show(!hide);
openButton->Show(hide);
captionText->SetLabel(hide ?
_("Click to show the scene editor:") :
_("The editor is being loaded... (this can take a few seconds)")
);
}
void ExternalEditorPanel::onOpenEditorClicked(wxCommandEvent& event)
{
if (onOpenEditorCb) onOpenEditorCb();
}
void ExternalEditorPanel::OnOpenEditor(std::function<void()> cb)
{
onOpenEditorCb = cb;
}

View File

@@ -0,0 +1,20 @@
#ifndef EXTERNALEDITORPANEL_H
#define EXTERNALEDITORPANEL_H
#include "GDIDEDialogs.h"
#include <functional>
class ExternalEditorPanel : public ExternalEditorPanelBase
{
public:
ExternalEditorPanel(wxWindow* parent);
virtual ~ExternalEditorPanel();
void HideLoader(bool hide = true);
void OnOpenEditor(std::function<void()> cb);
protected:
virtual void onOpenEditorClicked(wxCommandEvent& event);
std::function<void()> onOpenEditorCb;
};
#endif // EXTERNALEDITORPANEL_H

View File

@@ -18,10 +18,14 @@
#include "LayoutEditorPropertiesPnl.h"
#include "ObjectsEditor.h"
#include "LayersEditorPanel.h"
#include "ExternalEditorPanel.h"
#include "../MainFrame.h"
#include "GDCore/IDE/wxTools/SkinHelper.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Tools/Localization.h"
#include "GDCore/IDE/Dialogs/ExternalEditor/ExternalEditor.h"
#include "GDCore/IDE/ProjectStripper.h"
#include "GDCore/Tools/HexToRgb.h"
using namespace gd;
@@ -45,10 +49,11 @@ BEGIN_EVENT_TABLE(ExternalLayoutEditor,wxPanel)
END_EVENT_TABLE()
ExternalLayoutEditor::ExternalLayoutEditor(wxWindow* parent, gd::Project & project_, gd::ExternalLayout & externalLayout_, const gd::MainFrameWrapper & mainFrameWrapper_) :
layoutEditorCanvas(NULL),
externalLayout(externalLayout_),
project(project_),
mainFrameWrapper(mainFrameWrapper_)
layoutEditorCanvas(NULL),
externalLayout(externalLayout_),
project(project_),
mainFrameWrapper(mainFrameWrapper_),
isEditorDisplayed(true)
{
gd::InitialInstancesContainer & instanceContainer = dynamic_cast<gd::InitialInstancesContainer&>(externalLayout.GetInitialInstances());
@@ -129,8 +134,22 @@ mainFrameWrapper(mainFrameWrapper_)
Connect(ID_SCROLLBAR2,wxEVT_SCROLL_THUMBTRACK,(wxObjectEventFunction)&ExternalLayoutEditor::OnscrollBar2Scroll);
Connect(ID_COMBOBOX1,wxEVT_COMMAND_COMBOBOX_DROPDOWN,(wxObjectEventFunction)&ExternalLayoutEditor::OnparentSceneComboBoxDropDown);
m_mgr.SetManagedWindow( this );
externalEditorPanel = new ExternalEditorPanel(corePanel);
FlexGridSizer3->Add(externalEditorPanel, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
externalEditorPanel->Connect(wxEVT_SIZE,(wxObjectEventFunction)&ExternalLayoutEditor::OnexternalEditorPanelResize,0,this);
mainFrameWrapper.GetMainEditor()->Connect(wxEVT_MOVE,(wxObjectEventFunction)&ExternalLayoutEditor::OnexternalEditorPanelMoved,0,this);
externalEditorPanel->OnOpenEditor([this]() {
if (!externalLayoutEditor) return;
if (externalLayoutEditor->IsLaunchedAndConnected())
externalLayoutEditor->Show();
else
externalLayoutEditor->Launch("external-layout-editor", externalLayout.GetName());
});
//Prepare pane manager
m_mgr.SetManagedWindow( this );
m_mgr.AddPane( corePanel, wxAuiPaneInfo().Name( wxT( "LayoutPanel" ) ).Center().CloseButton( false ).Caption( _( "Scene's editor" ) ).MaximizeButton( true ).MinimizeButton( false ).CaptionVisible(false) );
gd::SkinHelper::ApplyCurrentSkin(m_mgr);
@@ -138,6 +157,86 @@ mainFrameWrapper(mainFrameWrapper_)
Refresh();
}
void ExternalLayoutEditor::CreateExternalLayoutEditor()
{
externalLayoutEditor = std::shared_ptr<gd::ExternalEditor>(new gd::ExternalEditor);
externalLayoutEditor->OnSendUpdate([this](gd::String scope) {
if (scope == "instances")
{
gd::SerializerElement serializedInstances;
this->externalLayout.GetInitialInstances().SerializeTo(serializedInstances);
return serializedInstances;
}
gd::SerializerElement serializedProject;
gd::Project strippedProject = project;
gd::ProjectStripper::StripProjectForExternalLayoutEdition(strippedProject, this->externalLayout.GetName());
strippedProject.SerializeTo(serializedProject);
return serializedProject;
});
externalLayoutEditor->OnUpdateReceived([this](gd::SerializerElement object, gd::String scope) {
std::cout << "Updating \"" << scope << "\" from the external editor." << std::endl;
gd::String name = externalLayout.GetAssociatedLayout();
gd::Layout * layout = project.HasLayoutNamed(name) ? &project.GetLayout(name) : NULL;
if (scope == "instances")
this->externalLayout.GetInitialInstances().UnserializeFrom(object);
else if (scope == "uiSettings")
this->externalLayout.GetAssociatedSettings().UnserializeFrom(object);
else if (scope == "windowTitle" && layout)
layout->SetWindowDefaultTitle(object.GetValue().GetString());
else if (scope == "layers" && layout)
{
layout->UnserializeLayersFrom(object);
if (layersEditor) layersEditor->Refresh();
}
else if (scope == "backgroundColor" && layout)
{
std::map<gd::String, unsigned int> rgbColor = {
{"r", 0}, {"g", 0}, {"b", 0}
};
HexToRgb(object.GetValue().GetString().To<int>(), rgbColor);
layout->SetBackgroundColor(rgbColor["r"], rgbColor["g"], rgbColor["b"]);
}
else
{
std::cout << "Updating \"" << scope << "\" is not supported." << std::endl;
}
});
externalLayoutEditor->OnEditObject([this](const gd::String & objectName){
gd::String name = externalLayout.GetAssociatedLayout();
gd::Layout * layout = project.HasLayoutNamed(name) ? &project.GetLayout(name) : NULL;
if (!objectsEditor || !layout) return;
externalLayoutEditor->Hide(true);
if (layout->HasObjectNamed(objectName))
{
objectsEditor->SelectObject(layout->GetObject(objectName), false);
objectsEditor->EditObject(layout->GetObject(objectName), false);
}
else if (project.HasObjectNamed(objectName))
{
objectsEditor->SelectObject(project.GetObject(objectName), true);
objectsEditor->EditObject(project.GetObject(objectName), true);
}
else
{
std::cout << "Could not find object \"" << objectName << "\" to edit." << std::endl;
}
UpdateExternalLayoutEditorSize(true);
externalLayoutEditor->Show();
});
externalLayoutEditor->OnLaunchPreview([this](){
if (layoutEditorCanvas) layoutEditorCanvas->LaunchPreview();
});
externalLayoutEditor->OnLaunched([this]() {
externalEditorPanel->HideLoader();
});
externalLayoutEditor->Launch("external-layout-editor", externalLayout.GetName());
}
ExternalLayoutEditor::~ExternalLayoutEditor()
{
//(*Destroy(ExternalLayoutEditor)
@@ -170,6 +269,12 @@ void ExternalLayoutEditor::OnResize(wxSizeEvent& event)
contextPanel->SetSize(GetSize().GetWidth(), contextPanel->GetSize().GetHeight());
layoutPanel->SetPosition(wxPoint(0,contextPanel->GetSize().GetHeight()));
layoutPanel->SetSize(GetSize().GetWidth(),GetSize().GetHeight()-contextPanel->GetSize().GetHeight());
if (externalEditorPanel)
{
externalEditorPanel->SetPosition(wxPoint(0,contextPanel->GetSize().GetHeight()));
externalEditorPanel->SetSize(GetSize().GetWidth(),GetSize().GetHeight()-contextPanel->GetSize().GetHeight());
UpdateExternalLayoutEditorSize();
}
}
void ExternalLayoutEditor::OnscenePanelResize(wxSizeEvent& event)
@@ -181,6 +286,29 @@ void ExternalLayoutEditor::OnscenePanelResize(wxSizeEvent& event)
scrollBar2->SetSize(layoutPanel->GetSize().GetWidth()-scrollBar2->GetSize().GetWidth(), 0, scrollBar2->GetSize().GetWidth(), layoutPanel->GetSize().GetHeight()-scrollBar1->GetSize().GetHeight());
}
void ExternalLayoutEditor::UpdateExternalLayoutEditorSize(bool force)
{
if (!externalLayoutEditor) return;
if (!isEditorDisplayed && !force) return;
auto rect = corePanel->GetScreenRect();
rect.SetY(rect.GetY() + contextPanel->GetSize().GetHeight());
rect.SetHeight(rect.GetHeight() - contextPanel->GetSize().GetHeight());
externalLayoutEditor->SetBounds(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight());
}
void ExternalLayoutEditor::OnexternalEditorPanelMoved(wxMoveEvent& event)
{
UpdateExternalLayoutEditorSize();
event.Skip();
}
void ExternalLayoutEditor::OnexternalEditorPanelResize(wxSizeEvent& event)
{
UpdateExternalLayoutEditorSize();
event.Skip();
}
void ExternalLayoutEditor::OnscrollBar2Scroll(wxScrollEvent& event)
{
layoutEditorCanvas->OnvScrollbarScroll(event);
@@ -191,10 +319,25 @@ void ExternalLayoutEditor::OnscrollBar1Scroll(wxScrollEvent& event)
layoutEditorCanvas->OnhScrollbarScroll(event);
}
void ExternalLayoutEditor::ForceRefreshRibbonAndConnect()
void ExternalLayoutEditor::EditorDisplayed()
{
mainFrameWrapper.SetRibbonPage(_("Scene"));
isEditorDisplayed = true;
mainFrameWrapper.SetRibbonPage(_("Scene"));
if (layoutEditorCanvas) layoutEditorCanvas->ConnectEvents();
if (externalLayoutEditor)
{
UpdateExternalLayoutEditorSize();
externalLayoutEditor->Show();
}
}
void ExternalLayoutEditor::EditorNotDisplayed()
{
isEditorDisplayed = false;
if (externalLayoutEditor)
{
externalLayoutEditor->Hide();
}
}
void ExternalLayoutEditor::OnsceneCanvasSetFocus(wxFocusEvent& event)
@@ -205,15 +348,29 @@ void ExternalLayoutEditor::OnsceneCanvasSetFocus(wxFocusEvent& event)
void ExternalLayoutEditor::SetupForScene(gd::Layout & layout)
{
bool useExternalEditor = false;
wxConfigBase::Get()->Read("/SceneEditor/ExternalSceneEditor", &useExternalEditor, false);
if ( &layout == &emptyLayout )
{
layoutPanel->Hide();
externalEditorPanel->Hide();
helpPanel->Show();
}
else
{
layoutPanel->Show();
helpPanel->Hide();
if (useExternalEditor)
{
layoutPanel->Hide();
externalEditorPanel->Show();
helpPanel->Hide();
CreateExternalLayoutEditor();
} else {
layoutPanel->Show();
externalEditorPanel->Hide();
helpPanel->Hide();
}
gd::InitialInstancesContainer & instanceContainer = externalLayout.GetInitialInstances();
@@ -256,8 +413,15 @@ void ExternalLayoutEditor::SetupForScene(gd::Layout & layout)
wxConfigBase::Get()->Read("/ExternalLayoutEditor/LastWorkspace", &perspective);
m_mgr.LoadPerspective(perspective);
objectsEditor->OnChange([this](gd::String changeScope) {
if (externalLayoutEditor) externalLayoutEditor->SetDirty();
});
layersEditor->OnChange([this](gd::String changeScope) {
if (externalLayoutEditor) externalLayoutEditor->SetDirty();
});
m_mgr.Update();
ForceRefreshRibbonAndConnect();
EditorDisplayed();
}
//Save the choice
@@ -268,6 +432,7 @@ void ExternalLayoutEditor::SetupForScene(gd::Layout & layout)
void ExternalLayoutEditor::OnparentSceneComboBoxSelected(wxCommandEvent& event)
{
if (externalLayoutEditor) externalLayoutEditor->Show();
gd::String name = parentSceneComboBox->GetValue();
gd::Layout * scene = project.HasLayoutNamed(name) ? &project.GetLayout(name) : NULL;
@@ -287,6 +452,7 @@ void ExternalLayoutEditor::OnparentSceneComboBoxSelected(wxCommandEvent& event)
*/
void ExternalLayoutEditor::OnparentSceneComboBoxDropDown(wxCommandEvent& event)
{
if (externalLayoutEditor) externalLayoutEditor->Hide(true);
parentSceneComboBox->Clear();
parentSceneComboBox->Append(_("No layout"));

View File

@@ -24,8 +24,10 @@ namespace gd { class ExternalLayout; }
namespace gd { class LayoutEditorCanvas; }
namespace gd { class ObjectsEditor; }
class LayersEditorPanel;
namespace gd { class ExternalEditor; }
class LayoutEditorPropertiesPnl;
class InitialPositionBrowserDlg;
class ExternalEditorPanel;
class ExternalLayoutEditor: public wxPanel
{
@@ -42,7 +44,13 @@ public:
/**
* Can be called by parent so as to refresh ribbon for this editor.
*/
void ForceRefreshRibbonAndConnect();
void EditorDisplayed();
/**
* Can be called by parent to let the editor know that it's not the editor
* displayed and focused.
*/
void EditorNotDisplayed();
/**
* \brief Set a function that is called when the layout used for editing the external layout
@@ -77,6 +85,7 @@ public:
/**
* Get the layout editor owned by this editor.
* \note Can be NULL if no layout editor was created.
*/
gd::LayoutEditorCanvas * GetLayoutEditorCanvas() const { return layoutEditorCanvas; }
@@ -106,8 +115,12 @@ private:
void OnResize(wxSizeEvent& event);
void OnparentSceneComboBoxSelected(wxCommandEvent& event);
//*)
void OnexternalEditorPanelResize(wxSizeEvent& event);
void OnexternalEditorPanelMoved(wxMoveEvent& event);
void OnparentSceneComboBoxDropDown(wxCommandEvent& event);
void SetupForScene(gd::Layout & scene);
void CreateExternalLayoutEditor();
void UpdateExternalLayoutEditorSize(bool force = false);
//(*Declarations(ExternalLayoutEditor)
wxScrollBar* scrollBar1;
@@ -132,6 +145,10 @@ private:
gd::MainFrameWrapper mainFrameWrapper;
Scene emptyLayout;
std::shared_ptr<gd::ExternalEditor> externalLayoutEditor;
ExternalEditorPanel * externalEditorPanel;
bool isEditorDisplayed;
std::function<void()> onAssociatedLayoutChangedCb;
wxAuiManager m_mgr;

View File

@@ -1,7 +1,7 @@
{
"metadata": {
"m_generatedFilesDir": ".",
"m_objCounter": 115,
"m_objCounter": 127,
"m_includeFiles": [],
"m_bitmapFunction": "wxCraftergfm8VaInitBitmapResources",
"m_bitmapsFile": "GDIDE_dialogs_bitmaps.cpp",
@@ -4049,5 +4049,432 @@
}]
}]
}]
}, {
"m_type": 4407,
"proportion": 0,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": ["wxTAB_TRAVERSAL"],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"],
"m_properties": [{
"type": "string",
"m_label": "Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "ExternalEditorPanelBase"
}, {
"type": "multi-string",
"m_label": "Tooltip:",
"m_value": ""
}, {
"type": "colour",
"m_label": "Bg Colour:",
"colour": "<Default>"
}, {
"type": "colour",
"m_label": "Fg Colour:",
"colour": "<Default>"
}, {
"type": "font",
"m_label": "Font:",
"m_value": ""
}, {
"type": "bool",
"m_label": "Hidden",
"m_value": false
}, {
"type": "bool",
"m_label": "Disabled",
"m_value": false
}, {
"type": "bool",
"m_label": "Focused",
"m_value": false
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "string",
"m_label": "Title:",
"m_value": ""
}, {
"type": "virtualFolderPicker",
"m_label": "Virtual Folder:",
"m_path": ""
}, {
"type": "choice",
"m_label": "Centre:",
"m_selection": 1,
"m_options": ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"]
}, {
"type": "string",
"m_label": "Inherited Class",
"m_value": "ExternalEditorPanel"
}, {
"type": "string",
"m_label": "File:",
"m_value": "ExternalEditorPanel"
}, {
"type": "string",
"m_label": "Class Decorator",
"m_value": ""
}],
"m_events": [],
"m_children": [{
"m_type": 4403,
"proportion": 1,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": [],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
"m_properties": [{
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "flexGridSizer119"
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "string",
"m_label": "# Columns:",
"m_value": "0"
}, {
"type": "string",
"m_label": "# Rows:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Growable columns:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Growable rows:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Horizontal gap:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Vertical gap:",
"m_value": "0"
}],
"m_events": [],
"m_children": [{
"m_type": 4403,
"proportion": 1,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": [],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER"],
"m_properties": [{
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "flexGridSizer121"
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "string",
"m_label": "# Columns:",
"m_value": "1"
}, {
"type": "string",
"m_label": "# Rows:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Growable columns:",
"m_value": ""
}, {
"type": "string",
"m_label": "Growable rows:",
"m_value": ""
}, {
"type": "string",
"m_label": "Horizontal gap:",
"m_value": "0"
}, {
"type": "string",
"m_label": "Vertical gap:",
"m_value": "0"
}],
"m_events": [],
"m_children": [{
"m_type": 4405,
"proportion": 0,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": [],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
"m_properties": [{
"type": "winid",
"m_label": "ID:",
"m_winid": "wxID_ANY"
}, {
"type": "string",
"m_label": "Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "captionText"
}, {
"type": "multi-string",
"m_label": "Tooltip:",
"m_value": ""
}, {
"type": "colour",
"m_label": "Bg Colour:",
"colour": "<Default>"
}, {
"type": "colour",
"m_label": "Fg Colour:",
"colour": "<Default>"
}, {
"type": "font",
"m_label": "Font:",
"m_value": ""
}, {
"type": "bool",
"m_label": "Hidden",
"m_value": false
}, {
"type": "bool",
"m_label": "Disabled",
"m_value": false
}, {
"type": "bool",
"m_label": "Focused",
"m_value": false
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "multi-string",
"m_label": "Label:",
"m_value": "The scene is edited in a separate window"
}, {
"type": "string",
"m_label": "Wrap:",
"m_value": "-1"
}],
"m_events": [],
"m_children": []
}, {
"m_type": 4420,
"proportion": 0,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": ["wxGA_HORIZONTAL"],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"],
"m_properties": [{
"type": "winid",
"m_label": "ID:",
"m_winid": "wxID_ANY"
}, {
"type": "string",
"m_label": "Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "loadingProgress"
}, {
"type": "multi-string",
"m_label": "Tooltip:",
"m_value": ""
}, {
"type": "colour",
"m_label": "Bg Colour:",
"colour": "<Default>"
}, {
"type": "colour",
"m_label": "Fg Colour:",
"colour": "<Default>"
}, {
"type": "font",
"m_label": "Font:",
"m_value": ""
}, {
"type": "bool",
"m_label": "Hidden",
"m_value": false
}, {
"type": "bool",
"m_label": "Disabled",
"m_value": false
}, {
"type": "bool",
"m_label": "Focused",
"m_value": false
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "string",
"m_label": "Range:",
"m_value": "100"
}, {
"type": "string",
"m_label": "Value:",
"m_value": "10"
}],
"m_events": [],
"m_children": []
}, {
"m_type": 4400,
"proportion": 0,
"border": 5,
"gbSpan": "1,1",
"gbPosition": "0,0",
"m_styles": [],
"m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxALIGN_CENTER_HORIZONTAL"],
"m_properties": [{
"type": "winid",
"m_label": "ID:",
"m_winid": "wxID_ANY"
}, {
"type": "string",
"m_label": "Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Minimum Size:",
"m_value": "-1,-1"
}, {
"type": "string",
"m_label": "Name:",
"m_value": "openButton"
}, {
"type": "multi-string",
"m_label": "Tooltip:",
"m_value": ""
}, {
"type": "colour",
"m_label": "Bg Colour:",
"colour": "<Default>"
}, {
"type": "colour",
"m_label": "Fg Colour:",
"colour": "<Default>"
}, {
"type": "font",
"m_label": "Font:",
"m_value": ""
}, {
"type": "bool",
"m_label": "Hidden",
"m_value": false
}, {
"type": "bool",
"m_label": "Disabled",
"m_value": false
}, {
"type": "bool",
"m_label": "Focused",
"m_value": false
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
"m_value": ""
}, {
"type": "string",
"m_label": "Label:",
"m_value": "Open the scene editor"
}, {
"type": "bool",
"m_label": "Default Button",
"m_value": false
}, {
"type": "bitmapPicker",
"m_label": "Bitmap File:",
"m_path": ""
}, {
"type": "choice",
"m_label": "Direction",
"m_selection": 0,
"m_options": ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"]
}, {
"type": "string",
"m_label": "Margins:",
"m_value": "2,2"
}],
"m_events": [{
"m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED",
"m_eventClass": "wxCommandEvent",
"m_eventHandler": "wxCommandEventHandler",
"m_functionNameAndSignature": "onOpenEditorClicked(wxCommandEvent& event)",
"m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.",
"m_noBody": false
}],
"m_children": []
}]
}]
}]
}]
}

View File

@@ -394,3 +394,55 @@ LayersEditorPanelBase::~LayersEditorPanelBase()
delete m_auimgr;
}
ExternalEditorPanelBase::ExternalEditorPanelBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: wxPanel(parent, id, pos, size, style)
{
if ( !bBitmapLoaded ) {
// We need to initialise the default bitmap handler
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
wxCraftergfm8VaInitBitmapResources();
bBitmapLoaded = true;
}
wxFlexGridSizer* flexGridSizer119 = new wxFlexGridSizer(0, 0, 0, 0);
flexGridSizer119->SetFlexibleDirection( wxBOTH );
flexGridSizer119->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
flexGridSizer119->AddGrowableCol(0);
flexGridSizer119->AddGrowableRow(0);
this->SetSizer(flexGridSizer119);
wxFlexGridSizer* flexGridSizer121 = new wxFlexGridSizer(0, 1, 0, 0);
flexGridSizer121->SetFlexibleDirection( wxBOTH );
flexGridSizer121->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
flexGridSizer119->Add(flexGridSizer121, 1, wxALL|wxALIGN_CENTER, 5);
captionText = new wxStaticText(this, wxID_ANY, _("The scene is edited in a separate window"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer121->Add(captionText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
loadingProgress = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(-1,-1), wxGA_HORIZONTAL);
loadingProgress->SetValue(10);
flexGridSizer121->Add(loadingProgress, 0, wxALL|wxEXPAND, 5);
openButton = new wxButton(this, wxID_ANY, _("Open the scene editor"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer121->Add(openButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
SetName(wxT("ExternalEditorPanelBase"));
SetSize(-1,-1);
if (GetSizer()) {
GetSizer()->Fit(this);
}
// Connect events
openButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalEditorPanelBase::onOpenEditorClicked), NULL, this);
}
ExternalEditorPanelBase::~ExternalEditorPanelBase()
{
openButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalEditorPanelBase::onOpenEditorClicked), NULL, this);
}

View File

@@ -25,6 +25,8 @@
#include <wx/menu.h>
#include <wx/toolbar.h>
#include <wx/listctrl.h>
#include <wx/gauge.h>
#include <wx/button.h>
#if wxVERSION_NUMBER >= 2900
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
@@ -142,4 +144,23 @@ public:
virtual ~LayersEditorPanelBase();
};
class ExternalEditorPanelBase : public wxPanel
{
protected:
wxStaticText* captionText;
wxGauge* loadingProgress;
wxButton* openButton;
protected:
virtual void onOpenEditorClicked(wxCommandEvent& event) { event.Skip(); }
public:
wxStaticText* GetCaptionText() { return captionText; }
wxGauge* GetLoadingProgress() { return loadingProgress; }
wxButton* GetOpenButton() { return openButton; }
ExternalEditorPanelBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxTAB_TRAVERSAL);
virtual ~ExternalEditorPanelBase();
};
#endif

View File

@@ -267,6 +267,7 @@ void LayersEditorPanel::OnAddLayerClicked(wxCommandEvent& event)
m_layout.InsertNewLayer(name, m_layout.GetLayersCount()-1);
m_layout.GetLayer(name).SetCameraCount(1);
if (onChangeCb) onChangeCb("layer-added");
Refresh();
}
@@ -305,6 +306,7 @@ void LayersEditorPanel::OnDeleteLayerClicked(wxCommandEvent& event)
m_layout.RemoveLayer(name);
if ( m_layoutCanvas ) m_layoutCanvas->SetCurrentLayer("");
if ( propPnl ) propPnl->SelectedLayer(NULL);
if (onChangeCb) onChangeCb("layer-deleted");
Refresh();
return;
}
@@ -336,6 +338,7 @@ void LayersEditorPanel::OnLayerDownClicked(wxCommandEvent& event)
{
//Move the layer
m_layout.SwapLayers(i,i-1);
if (onChangeCb) onChangeCb("layer-moved-down");
Refresh();
//Focus it again
@@ -361,6 +364,7 @@ void LayersEditorPanel::OnLayerUpClicked(wxCommandEvent& event)
{
//Move the layer
m_layout.SwapLayers(i,i+1);
if (onChangeCb) onChangeCb("layer-moved-up");
Refresh();
//Focus it again

View File

@@ -33,6 +33,11 @@ public:
*/
void Refresh();
/**
* \brief Set a function to call each time a change is made.
*/
void OnChange(std::function<void(gd::String)> cb) { onChangeCb = cb; }
/**
* The editor can be linked to a layout editor canvas to update it according to the changes made in the editor.
*/
@@ -97,6 +102,7 @@ private:
LayoutEditorPropertiesPnl * propPnl;
wxAuiManager * propPnlManager;
std::function<void(gd::String)> onChangeCb;
gd::String m_layerSelected;
};

View File

@@ -168,11 +168,19 @@ void LayoutEditorPropertiesPnl::OnPropertySelected(wxPropertyGridEvent& event)
if (layoutEditorCanvas && displayInstancesProperties) instancesHelper.OnPropertySelected(layoutEditorCanvas->GetSelection(), event);
if (object)
{
if (objectsHelper.OnPropertySelected(object, &layout, event)) launchRefresh();
if (objectsHelper.OnPropertySelected(object, &layout, event))
{
launchRefresh();
if (onChangeCb) onChangeCb("object-edited");
}
}
if (layer)
{
if (layerHelper.OnPropertySelected(*layer, event)) launchRefresh();
if (layerHelper.OnPropertySelected(*layer, event))
{
launchRefresh();
if (onChangeCb) onChangeCb("layer-edited");
}
}
}
@@ -204,7 +212,10 @@ void LayoutEditorPropertiesPnl::OnPropertyChanged(wxPropertyGridEvent& event)
}
if ( object )
{
if (objectsHelper.OnPropertyChanged(object, &layout, event)) launchRefresh();
if (objectsHelper.OnPropertyChanged(object, &layout, event))
launchRefresh();
if (onChangeCb) onChangeCb("object-property-changed");
}
if (layer)
{
@@ -223,10 +234,15 @@ void LayoutEditorPropertiesPnl::OnPropertyChanged(wxPropertyGridEvent& event)
layout.GetInitialInstances().MoveInstancesToLayer(oldName, layer->GetName());
if ( layoutEditorCanvas && layoutEditorCanvas->GetCurrentLayer() == oldName )
layoutEditorCanvas->SetCurrentLayer(layer->GetName());
if (onChangeCb) onChangeCb("layer-renamed");
}
else
{
if (layerHelper.OnPropertyChanged(*layer, event)) launchRefresh();
if (layerHelper.OnPropertyChanged(*layer, event))
launchRefresh();
if (onChangeCb) onChangeCb("layer-property-changed");
}
}
}

View File

@@ -44,6 +44,11 @@ public:
*/
void OnRefreshed(std::function<void()> cb) { onRefreshedCb = cb; };
/**
* \brief Set a function to call each time a change is made.
*/
void OnChange(std::function<void(gd::String)> cb) { onChangeCb = cb; }
/** \name Initial instances properties
* Members functions related to displaying the properties of the instances selected in the layout editor canvas.
* Most of these members functions are inherited from gd::LayoutEditorCanvasAssociatedEditor.
@@ -104,6 +109,7 @@ private:
static const wxEventType refreshEventType; ///< The internal wxWidgets event used to ask the grid to be refreshed.
std::function<void()> onRefreshedCb;
std::function<void(gd::String)> onChangeCb;
DECLARE_EVENT_TABLE()
};

View File

@@ -751,6 +751,7 @@ void ObjectsEditor::OnobjectsListEndLabelEdit(wxTreeEvent& event)
renamedItemOldName = newName;
project.SetDirty();
if (onChangeCb) onChangeCb("rename");
}
void ObjectsEditor::OnobjectsListSelectionChanged(wxTreeEvent& event)
@@ -830,6 +831,35 @@ gd::ObjectGroup * ObjectsEditor::GetSelectedGroup()
return it != objectsGroups.end() ? &(*it) : NULL;
}
void ObjectsEditor::EditObject(gd::Object & object, bool isGlobalObject)
{
auto properties = object.GetProperties(project);
if ( properties.empty() || properties.find("PLEASE_ALSO_SHOW_EDIT_BUTTON_THANKS") != properties.end() ) {
//Open object editor
object.EditObject(this, project, mainFrameWrapper);
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectEdited(project, isGlobalObject ? NULL : &layout, object);
project.SetDirty();
if (onChangeCb) onChangeCb("object-edited");
listsHelper.MakeObjectItem(objectsList, lastSelectedItem, object, isGlobalObject);
//Reload resources : Do not forget to switch the working directory.
wxString oldWorkingDir = wxGetCwd();
if ( wxDirExists(wxFileName::FileName(project.GetProjectFile()).GetPath()))
wxSetWorkingDirectory(wxFileName::FileName(project.GetProjectFile()).GetPath());
object.LoadResources(project, layout);
wxSetWorkingDirectory(oldWorkingDir);
} else {
//No object editor: open properties panel
wxCommandEvent useless;
OnMenuPropertiesSelected(useless);
}
}
void ObjectsEditor::OnMenuEditObjectSelected(wxCommandEvent& event)
{
//Get the selected item
@@ -842,31 +872,7 @@ void ObjectsEditor::OnMenuEditObjectSelected(wxCommandEvent& event)
gd::Object * object = GetSelectedObject();
if ( !object ) return;
auto properties = object->GetProperties(project);
if ( properties.empty() || properties.find("PLEASE_ALSO_SHOW_EDIT_BUTTON_THANKS") != properties.end() ) {
//Open object editor
object->EditObject(this, project, mainFrameWrapper);
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectEdited(project, globalObject ? NULL : &layout, *object);
project.SetDirty();
listsHelper.MakeObjectItem(objectsList, lastSelectedItem, *object, globalObject);
//Reload resources : Do not forget to switch the working directory.
wxString oldWorkingDir = wxGetCwd();
if ( wxDirExists(wxFileName::FileName(project.GetProjectFile()).GetPath()))
wxSetWorkingDirectory(wxFileName::FileName(project.GetProjectFile()).GetPath());
object->LoadResources(project, layout);
wxSetWorkingDirectory(oldWorkingDir);
} else {
//No object editor: open properties panel
wxCommandEvent useless;
OnMenuPropertiesSelected(useless);
}
EditObject(*object, globalObject);
}
//Group clicked?
else if ( data && (data->GetString() == "GlobalGroup" || data->GetString() == "LayoutGroup") )
@@ -881,6 +887,9 @@ void ObjectsEditor::OnMenuEditObjectSelected(wxCommandEvent& event)
if (dialog.ShowModal() == 1) { //Add objects to the group
for(std::size_t i = 0;i < dialog.GetChosenObjects().size();++i)
group->AddObject(dialog.GetChosenObjects()[i]);
project.SetDirty();
if (onChangeCb) onChangeCb("group-edited");
}
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
@@ -938,6 +947,9 @@ void ObjectsEditor::OnAddObjectSelected(wxCommandEvent& event)
objectsList->EditLabel(itemAdded);
renamedItemOldName = name; //With wxGTK, calling EditLabel do not update renamedItemOldName with the name of the new object.
project.SetDirty();
if (onChangeCb) onChangeCb("object-added");
gd::LogStatus( _( "The object was correctly added" ) );
objectsList->Expand(objectsRootItem);
}
@@ -970,6 +982,9 @@ void ObjectsEditor::OnAddGroupSelected(wxCommandEvent& event)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectGroupAdded(project, &layout, name);
gd::LogStatus( _( "The group was correctly added." ) );
project.SetDirty();
if (onChangeCb) onChangeCb("group-added");
//Make sure that the group root item is expanded
objectsList->Expand(groupsRootItem);
}
@@ -1109,6 +1124,9 @@ void ObjectsEditor::OnDeleteSelected(wxCommandEvent& event)
UpdateGroup(groupItem);
}
project.SetDirty();
if (onChangeCb) onChangeCb("objects-deleted");
//Call the notifiers
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectsDeleted(project, &layout, objectsDeleted);
@@ -1168,6 +1186,12 @@ void ObjectsEditor::OnMoveDownSelected(wxCommandEvent& event)
SelectItem(objectsRootItem, name, dataStr, dataStr2); //Select again the moved item
}
void ObjectsEditor::SelectObject(const gd::Object & object, bool isGlobalObject)
{
SelectItem(objectsRootItem, object.GetName(),
isGlobalObject ? "GlobalObject" : "LayoutObject", "");
}
void ObjectsEditor::SelectItem(wxTreeItemId parent, gd::String name, gd::String dataStr1, gd::String dataStr2)
{
wxTreeItemId item = objectsList->GetLastChild(parent);
@@ -1240,6 +1264,8 @@ void ObjectsEditor::OnCutSelected(wxCommandEvent& event)
objects.RemoveObject(name);
project.SetDirty();
if (onChangeCb) onChangeCb("objects-deleted");
std::vector<gd::String> objectsDeleted;
objectsDeleted.push_back(name);
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
@@ -1258,6 +1284,8 @@ void ObjectsEditor::OnCutSelected(wxCommandEvent& event)
gd::Clipboard::Get()->ForgetObject();
RemoveGroup(name, objectsGroups);
project.SetDirty();
if (onChangeCb) onChangeCb("objects-deleted");
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectGroupDeleted(project, globalGroup ? NULL : &layout, name);
}
@@ -1287,6 +1315,9 @@ void ObjectsEditor::OnPasteSelected(wxCommandEvent& event)
//Add it to the list
objects.InsertObject(*object, objects.GetObjectsCount());
project.SetDirty();
if (onChangeCb) onChangeCb("object-added");
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectAdded(project, globalObject ? NULL : &layout, *object);
}
@@ -1303,6 +1334,8 @@ void ObjectsEditor::OnPasteSelected(wxCommandEvent& event)
}));
objectsGroups.push_back( groupPasted );
project.SetDirty();
if (onChangeCb) onChangeCb("group-added");
for ( std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectGroupAdded(project, globalGroup ? NULL : &layout, groupPasted.GetName());
}
@@ -1355,6 +1388,9 @@ void ObjectsEditor::OnSetGlobalSelected(wxCommandEvent& event)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectAdded(project, NULL, project.GetObject(objectName));
}
project.SetDirty();
if (onChangeCb) onChangeCb("object-set-global");
//Delete the old item
objectsList->Delete(lastSelectedItem);
@@ -1397,6 +1433,9 @@ void ObjectsEditor::OnSetGlobalSelected(wxCommandEvent& event)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnObjectGroupAdded(project, NULL, groupName);
}
project.SetDirty();
if (onChangeCb) onChangeCb("group-set-global");
//Add the item corresponding to the global group
bool wasExpanded = objectsList->IsExpanded(lastSelectedItem);
objectsList->Delete(lastSelectedItem);

View File

@@ -49,6 +49,16 @@ public:
virtual ~ObjectsEditor();
/**
* \brief Open the editor of the specified object
*/
void EditObject(gd::Object & object, bool isGlobalObject);
/**
* \brief Select the specified object in the list
*/
void SelectObject(const gd::Object & object, bool isGlobalObject);
/**
* \brief Refresh the editor.
*/
@@ -59,6 +69,11 @@ public:
*/
void OnRefreshed(std::function<void()> cb) { onRefreshedCb = cb; }
/**
* \brief Set a function to call each time a change is made.
*/
void OnChange(std::function<void(gd::String)> cb) { onChangeCb = cb; }
/**
* \brief Create the ribbon buttons for this editor
*/
@@ -231,6 +246,7 @@ private:
gd::String renamedItemOldName;
wxTreeItemId lastSelectedItem;
std::function<void()> onRefreshedCb;
std::function<void(gd::String)> onChangeCb;
DECLARE_EVENT_TABLE()
};

View File

@@ -21,6 +21,7 @@
#include <wx/ribbon/bar.h>
#include <wx/ribbon/buttonbar.h>
#include <wx/ribbon/toolbar.h>
#include <wx/app.h>
#include "GDCore/Project/Layout.h"
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
@@ -33,33 +34,39 @@
#include "EventsEditor.h"
#include "Dialogs/LayersEditorPanel.h"
#include "Dialogs/LayoutEditorPropertiesPnl.h"
#include "Dialogs/ExternalEditorPanel.h"
#include "GDCore/IDE/Dialogs/ExternalEditor/ExternalEditor.h"
#include "GDCore/Tools/HexToRgb.h"
#include "GDCore/Project/Project.h"
#include "GDCore/Project/Project.h"
#include "GDCore/IDE/ProjectStripper.h"
//(*IdInit(EditorScene)
const long EditorScene::ID_SCROLLBAR3 = wxNewId();
const long EditorScene::ID_SCROLLBAR4 = wxNewId();
const long EditorScene::ID_CUSTOM3 = wxNewId();
const long EditorScene::ID_PANEL1 = wxNewId();
const long EditorScene::ID_PANEL2 = wxNewId();
const long EditorScene::ID_CUSTOM2 = wxNewId();
const long EditorScene::ID_PANEL6 = wxNewId();
const long EditorScene::ID_AUINOTEBOOK1 = wxNewId();
//*)
BEGIN_EVENT_TABLE(EditorScene,wxPanel)
//(*EventTable(EditorScene)
//*)
END_EVENT_TABLE()
EditorScene::EditorScene(wxWindow* parent, gd::Project & project_, gd::Layout & layout_, const gd::MainFrameWrapper & mainFrameWrapper_) :
project(project_),
layout(layout_),
mainFrameWrapper(mainFrameWrapper_)
project(project_),
layout(layout_),
mainFrameWrapper(mainFrameWrapper_),
isEditorDisplayed(true)
{
//(*Initialize(EditorScene)
wxFlexGridSizer* FlexGridSizer3;
wxFlexGridSizer* externalEditorContainerSizer;
wxFlexGridSizer* FlexGridSizer1;
Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
@@ -75,7 +82,14 @@ mainFrameWrapper(mainFrameWrapper_)
vScrollbar->SetScrollbar(2500, 10, 5000, 10);
hScrollbar = new wxScrollBar(scenePanel, ID_SCROLLBAR4, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL, wxDefaultValidator, _T("ID_SCROLLBAR4"));
hScrollbar->SetScrollbar(2500, 10, 5000, 10);
layoutEditorCanvas = new gd::LayoutEditorCanvas(scenePanel, project, layout, layout.GetInitialInstances(), layout.GetAssociatedLayoutEditorCanvasOptions(), mainFrameWrapper);
layoutEditorCanvas = new gd::LayoutEditorCanvas(scenePanel, project, layout, layout.GetInitialInstances(), layout.GetAssociatedSettings(), mainFrameWrapper);
externalSceneEditorContainerPanel = new wxPanel(notebook, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2"));
externalEditorContainerSizer = new wxFlexGridSizer(1, 1, 0, 0);
externalEditorContainerSizer->AddGrowableCol(0);
externalEditorContainerSizer->AddGrowableRow(0);
externalSceneEditorContainerPanel->SetSizer(externalEditorContainerSizer);
externalEditorContainerSizer->Fit(externalSceneEditorContainerPanel);
externalEditorContainerSizer->SetSizeHints(externalSceneEditorContainerPanel);
eventsPanel = new wxPanel(notebook, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL6"));
eventsPanel->SetBackgroundColour(wxColour(255,255,255));
eventsPanel->SetHelpText(_("Edit the events of the scene"));
@@ -88,6 +102,7 @@ mainFrameWrapper(mainFrameWrapper_)
FlexGridSizer3->Fit(eventsPanel);
FlexGridSizer3->SetSizeHints(eventsPanel);
notebook->AddPage(scenePanel, _("Scene"), false, gd::SkinHelper::GetIcon("scene", 16));
notebook->AddPage(externalSceneEditorContainerPanel, _("Scene"), false, gd::SkinHelper::GetIcon("scene", 16));
notebook->AddPage(eventsPanel, _("Events"), false, gd::SkinHelper::GetIcon("events", 16));
FlexGridSizer1->Add(notebook, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
SetSizer(FlexGridSizer1);
@@ -108,6 +123,22 @@ mainFrameWrapper(mainFrameWrapper_)
//Prepare pane manager
m_mgr.SetManagedWindow( this );
externalEditorPanel = new ExternalEditorPanel(externalSceneEditorContainerPanel);
externalEditorContainerSizer->Add(externalEditorPanel, 1, wxALL|wxEXPAND, 0);
externalEditorPanel->Connect(wxEVT_SIZE,(wxObjectEventFunction)&EditorScene::OnexternalEditorPanelResize,0,this);
mainFrameWrapper.GetMainEditor()->Connect(wxEVT_MOVE,(wxObjectEventFunction)&EditorScene::OnexternalEditorPanelMoved,0,this);
externalEditorPanel->OnOpenEditor([this]() {
if (!externalLayoutEditor) return;
auto rect = externalEditorPanel->GetScreenRect();
externalLayoutEditor->SetLaunchBounds(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight());
if (externalLayoutEditor->IsLaunchedAndConnected())
externalLayoutEditor->Show();
else
externalLayoutEditor->Launch("scene-editor", layout.GetName());
});
layoutEditorCanvas->SetParentAuiManager(&m_mgr);
layoutEditorCanvas->SetScrollbars(hScrollbar, vScrollbar);
@@ -123,7 +154,7 @@ mainFrameWrapper(mainFrameWrapper_)
layoutEditorCanvas->AddAssociatedEditor(propertiesPnl.get());
layoutEditorCanvas->AddAssociatedEditor(initialInstancesBrowser.get());
layersEditor->SetAssociatedLayoutEditorCanvas(layoutEditorCanvas);
layersEditor->SetAssociatedPropertiesPanel(propertiesPnl.get(), &m_mgr);
layersEditor->SetAssociatedPropertiesPanel(propertiesPnl.get(), &m_mgr);
eventsEditor->SetAssociatedLayoutCanvas(layoutEditorCanvas);
objectsEditor->SetAssociatedPropertiesPanel(propertiesPnl.get(), &m_mgr);
@@ -163,15 +194,154 @@ mainFrameWrapper(mainFrameWrapper_)
m_mgr.GetPane(initialInstancesBrowser.get()).Caption(_( "Instances list" ));
m_mgr.Update();
//Only show the selected editor
bool useExternalEditor = false;
wxConfigBase::Get()->Read("/SceneEditor/ExternalSceneEditor", &useExternalEditor, false);
if (useExternalEditor)
{
notebook->RemovePage(0);
CreateExternalLayoutEditor(this);
objectsEditor->OnChange([this](gd::String changeScope) {
externalLayoutEditor->SetDirty();
});
layersEditor->OnChange([this](gd::String changeScope) {
externalLayoutEditor->SetDirty();
});
propertiesPnl->OnChange([this](gd::String changeScope) {
externalLayoutEditor->SetDirty();
});
}
else
{
notebook->RemovePage(1);
}
}
void EditorScene::CreateExternalLayoutEditor(wxWindow * parent)
{
externalLayoutEditor = std::shared_ptr<gd::ExternalEditor>(new gd::ExternalEditor);
externalLayoutEditor->OnSendUpdate([this](gd::String scope) {
if (scope == "instances")
{
gd::SerializerElement serializedInstances;
this->layout.GetInitialInstances().SerializeTo(serializedInstances);
return serializedInstances;
}
gd::SerializerElement serializedProject;
gd::Project strippedProject = project;
gd::ProjectStripper::StripProjectForLayoutEdition(strippedProject, this->layout.GetName());
strippedProject.SerializeTo(serializedProject);
return serializedProject;
});
externalLayoutEditor->OnUpdateReceived([this](gd::SerializerElement object, gd::String scope) {
std::cout << "Updating \"" << scope << "\" from the external editor." << std::endl;
if (scope == "instances")
layout.GetInitialInstances().UnserializeFrom(object);
else if (scope == "uiSettings")
layout.GetAssociatedSettings().UnserializeFrom(object);
else if (scope == "windowTitle")
layout.SetWindowDefaultTitle(object.GetValue().GetString());
else if (scope == "layers")
{
layout.UnserializeLayersFrom(object);
if (layersEditor) layersEditor->Refresh();
}
else if (scope == "backgroundColor")
{
std::map<gd::String, unsigned int> rgbColor = {
{"r", 0}, {"g", 0}, {"b", 0}
};
HexToRgb(object.GetValue().GetString().To<int>(), rgbColor);
layout.SetBackgroundColor(rgbColor["r"], rgbColor["g"], rgbColor["b"]);
}
else
{
std::cout << "Updating \"" << scope << "\" is not supported." << std::endl;
}
});
externalLayoutEditor->OnLaunchPreview([this](){
if (layoutEditorCanvas) layoutEditorCanvas->LaunchPreview();
});
externalLayoutEditor->OnEditObject([this](const gd::String & objectName){
if (!objectsEditor) return;
externalLayoutEditor->Hide(true);
if (layout.HasObjectNamed(objectName))
{
objectsEditor->SelectObject(layout.GetObject(objectName), false);
objectsEditor->EditObject(layout.GetObject(objectName), false);
}
else if (project.HasObjectNamed(objectName))
{
objectsEditor->SelectObject(project.GetObject(objectName), true);
objectsEditor->EditObject(project.GetObject(objectName), true);
}
else
{
std::cout << "Could not find object \"" << objectName << "\" to edit." << std::endl;
}
UpdateExternalLayoutEditorSize(true);
externalLayoutEditor->Show();
});
Layout();
if (parent)
{
auto rect = parent->GetScreenRect();
externalLayoutEditor->SetLaunchBounds(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight());
}
externalLayoutEditor->OnLaunched([this]() {
externalEditorPanel->HideLoader();
});
externalLayoutEditor->Launch("scene-editor", layout.GetName());
}
void EditorScene::UpdateExternalLayoutEditorSize(bool force)
{
if (!externalLayoutEditor) return;
if (!force)
{
if (!isEditorDisplayed) return;
if (notebook->GetPageText(notebook->GetSelection()) != _("Scene")) return;
}
auto rect = externalEditorPanel->GetScreenRect();
externalLayoutEditor->SetBounds(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight());
}
void EditorScene::OnscenePanelResize(wxSizeEvent& event)
{
layoutEditorCanvas->UpdateSize();
if (layoutEditorCanvas) layoutEditorCanvas->UpdateSize();
hScrollbar->SetSize(0, scenePanel->GetSize().GetHeight()-hScrollbar->GetSize().GetHeight(), scenePanel->GetSize().GetWidth()-vScrollbar->GetSize().GetWidth(), hScrollbar->GetSize().GetHeight());
vScrollbar->SetSize(scenePanel->GetSize().GetWidth()-vScrollbar->GetSize().GetWidth(), 0, vScrollbar->GetSize().GetWidth(), scenePanel->GetSize().GetHeight()-hScrollbar->GetSize().GetHeight());
}
void EditorScene::OnexternalEditorPanelMoved(wxMoveEvent& event)
{
UpdateExternalLayoutEditorSize();
event.Skip();
}
void EditorScene::OnexternalEditorPanelResize(wxSizeEvent& event)
{
UpdateExternalLayoutEditorSize();
event.Skip();
}
void EditorScene::EditorNotDisplayed()
{
isEditorDisplayed = false;
if (externalLayoutEditor)
{
externalLayoutEditor->Hide();
}
}
EditorScene::~EditorScene()
{
//(*Destroy(EditorScene)
@@ -181,19 +351,33 @@ EditorScene::~EditorScene()
m_mgr.UnInit();
}
void EditorScene::ForceRefreshRibbonAndConnect()
void EditorScene::EditorDisplayed()
{
isEditorDisplayed = true;
if ( notebook->GetPageText(notebook->GetSelection()) == _("Scene") )
{
layoutEditorCanvas->RecreateRibbonToolbar();
layoutEditorCanvas->EnableIdleEvents();
if (externalLayoutEditor)
{
UpdateExternalLayoutEditorSize();
externalLayoutEditor->Show();
}
if (layoutEditorCanvas)
{
layoutEditorCanvas->RecreateRibbonToolbar();
layoutEditorCanvas->EnableIdleEvents();
layoutEditorCanvas->ConnectEvents();
}
mainFrameWrapper.SetRibbonPage(_("Scene"));
layoutEditorCanvas->ConnectEvents();
}
else if ( notebook->GetPageText(notebook->GetSelection()) == _("Events") )
{
if (externalLayoutEditor)
externalLayoutEditor->Hide();
mainFrameWrapper.SetRibbonPage(_("Events"));
layoutEditorCanvas->EnableIdleEvents(false);
if (layoutEditorCanvas) layoutEditorCanvas->EnableIdleEvents(false);
eventsEditor->ConnectEvents();
}
}
@@ -213,27 +397,31 @@ bool EditorScene::CanBeClosed()
*/
void EditorScene::OnnotebookPageChanged(wxAuiNotebookEvent& event)
{
ForceRefreshRibbonAndConnect();
EditorDisplayed();
}
void EditorScene::OnnotebookPageChanging(wxAuiNotebookEvent& event)
{
if ( !layoutEditorCanvas->IsEditing() && !layoutEditorCanvas->PreviewPaused() )
if (layoutEditorCanvas &&
!layoutEditorCanvas->IsEditing() &&
!layoutEditorCanvas->PreviewPaused())
{
layoutEditorCanvas->PausePreview();
}
}
void EditorScene::OnsceneCanvasSetFocus(wxFocusEvent& event)
{
mainFrameWrapper.SetRibbonPage(_("Scene"));
layoutEditorCanvas->ConnectEvents();
if (layoutEditorCanvas) layoutEditorCanvas->ConnectEvents();
}
void EditorScene::OnvScrollbarScroll(wxScrollEvent& event)
{
layoutEditorCanvas->OnvScrollbarScroll(event);
if (layoutEditorCanvas) layoutEditorCanvas->OnvScrollbarScroll(event);
}
void EditorScene::OnhScrollbarScroll(wxScrollEvent& event)
{
layoutEditorCanvas->OnhScrollbarScroll(event);
if (layoutEditorCanvas) layoutEditorCanvas->OnhScrollbarScroll(event);
}

View File

@@ -22,15 +22,17 @@
#include <wx/ribbon/toolbar.h>
#include <memory>
#include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
namespace gd {class Layout;}
namespace gd {class Project;}
namespace gd {class LayoutEditorCanvas;}
namespace gd {class ObjectsEditor;}
namespace gd { class Layout; }
namespace gd { class Project; }
namespace gd { class LayoutEditorCanvas; }
namespace gd { class ObjectsEditor; }
class LayersEditorPanel;
namespace gd { class ExternalEditor; }
class CppLayoutPreviewer;
class EventsEditor;
class LayoutEditorPropertiesPnl;
class InitialPositionBrowserDlg;
class ExternalEditorPanel;
/**
* \brief Panel containing all the editors of a layout.
@@ -55,7 +57,13 @@ public:
/**
* Can be called by parent so as to refresh ribbon for this editor.
*/
void ForceRefreshRibbonAndConnect();
void EditorDisplayed();
/**
* Can be called by parent to let the editor know that it's not the editor
* displayed and focused.
*/
void EditorNotDisplayed();
/**
* Return true if the editor can be closed, false otherwise ( i.e. Scene is being previewed )
@@ -69,6 +77,7 @@ protected:
static const long ID_SCROLLBAR4;
static const long ID_CUSTOM3;
static const long ID_PANEL1;
static const long ID_PANEL2;
static const long ID_CUSTOM2;
static const long ID_PANEL6;
static const long ID_AUINOTEBOOK1;
@@ -96,16 +105,23 @@ private:
void OnvScrollbarScrollThumbRelease(wxScrollEvent& event);
void OnhScrollbarScrollThumbRelease(wxScrollEvent& event);
//*)
void OnexternalEditorPanelResize(wxSizeEvent& event);
void OnexternalEditorPanelMoved(wxMoveEvent& event);
void OnMainFrameActivate(wxActivateEvent& event);
void CreateExternalLayoutEditor(wxWindow * parent = NULL);
void UpdateExternalLayoutEditorSize(bool force = false);
//(*Declarations(EditorScene)
EventsEditor* eventsEditor;
gd::LayoutEditorCanvas* layoutEditorCanvas;
wxPanel* scenePanel;
wxPanel* eventsPanel;
wxPanel* externalSceneEditorContainerPanel;
wxScrollBar* hScrollbar;
wxAuiNotebook* notebook;
wxScrollBar* vScrollbar;
//*)
ExternalEditorPanel * externalEditorPanel;
std::shared_ptr<gd::ObjectsEditor> objectsEditor;
std::shared_ptr<LayersEditorPanel> layersEditor;
std::shared_ptr<LayoutEditorPropertiesPnl> propertiesPnl;
@@ -115,6 +131,10 @@ private:
gd::Layout & layout;
gd::MainFrameWrapper mainFrameWrapper;
std::shared_ptr<gd::ExternalEditor> externalEventsEditor;
std::shared_ptr<gd::ExternalEditor> externalLayoutEditor;
bool isEditorDisplayed;
wxAuiManager m_mgr;
DECLARE_EVENT_TABLE()

View File

@@ -87,7 +87,7 @@ ExternalEventsEditor::~ExternalEventsEditor()
//*)
}
void ExternalEventsEditor::ForceRefreshRibbonAndConnect()
void ExternalEventsEditor::EditorDisplayed()
{
mainFrameWrapper.SetRibbonPage(_("Events"));
eventsEditor->ConnectEvents();

View File

@@ -44,7 +44,7 @@ public:
/**
* Can be called by parent so as to refresh ribbon for this editor.
*/
void ForceRefreshRibbonAndConnect();
void EditorDisplayed();
protected:

File diff suppressed because it is too large Load Diff

View File

@@ -292,6 +292,7 @@ MainFrame::MainFrame( wxWindow* parent ) :
Connect( ID_RIBBON, wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGING, ( wxObjectEventFunction )&MainFrame::OnRibbonPageChanging );
Connect( ID_RIBBON, wxEVT_COMMAND_RIBBONBAR_HELP_CLICKED, ( wxObjectEventFunction )&MainFrame::OnRibbonHelpBtClick );
Connect( ID_RIBBON, wxEVT_COMMAND_RIBBONBAR_TOGGLED, ( wxObjectEventFunction )&MainFrame::OnRibbonToggleBtClick );
Connect( wxID_ANY, wxEVT_ACTIVATE, ( wxObjectEventFunction )&MainFrame::OnActivate );
#ifdef GD_NO_UPDATE_CHECKER //Remove the menu item to check for updates
helpMenu.Delete(MenuItem21); //(useful when GD is distributed on a system managing updates by itself).
@@ -654,31 +655,7 @@ void MainFrame::OnNotebook1PageChanged(wxAuiNotebookEvent& event)
editorsNotebook->SetWindowStyleFlag(style);
}
if ( EditorScene * sceneEditorPtr = dynamic_cast<EditorScene*>(editorsNotebook->GetPage(event.GetSelection())) )
{
sceneEditorPtr->ForceRefreshRibbonAndConnect();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of layout \""+sceneEditorPtr->GetLayout().GetName()+"\"");
}
else if ( ResourcesEditor * imagesEditorPtr = dynamic_cast<ResourcesEditor*>(editorsNotebook->GetPage(event.GetSelection())) )
{
imagesEditorPtr->ForceRefreshRibbonAndConnect();
LogFileManager::Get()->WriteToLogFile("Switched to resources editor of project \""+imagesEditorPtr->project.GetName()+"\"");
}
else if ( CodeEditor * codeEditorPtr = dynamic_cast<CodeEditor*>(editorsNotebook->GetPage(event.GetSelection())) )
{
codeEditorPtr->ForceRefreshRibbonAndConnect();
LogFileManager::Get()->WriteToLogFile("Switched to code editor of file \""+codeEditorPtr->filename+"\"");
}
else if ( ExternalEventsEditor * externalEventsEditorPtr = dynamic_cast<ExternalEventsEditor*>(editorsNotebook->GetPage(event.GetSelection())) )
{
externalEventsEditorPtr->ForceRefreshRibbonAndConnect();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of external events \""+externalEventsEditorPtr->events.GetName()+"\"");
}
else if ( ExternalLayoutEditor * externalLayoutEditorPtr = dynamic_cast<ExternalLayoutEditor*>(editorsNotebook->GetPage(event.GetSelection())) )
{
externalLayoutEditorPtr->ForceRefreshRibbonAndConnect();
LogFileManager::Get()->WriteToLogFile("Switched to the editor of external layout \""+externalLayoutEditorPtr->GetExternalLayout().GetName()+"\"");
}
editorsManager.PageChanged(editorsNotebook->GetPage(event.GetSelection()));
}
void MainFrame::OnRibbonPageChanging(wxRibbonBarEvent& evt)
@@ -1023,3 +1000,13 @@ void MainFrame::OnRibbonDecomposerDropDownClicked(wxRibbonButtonBarEvent& evt)
{
evt.PopupMenu(&decomposerContextMenu);
}
void MainFrame::OnActivate(wxActivateEvent& event)
{
if (event.GetActive())
editorsManager.PageChanged(editorsNotebook->GetCurrentPage());
else if (!event.GetActive())
editorsManager.MainFrameNotDisplayed();
event.Skip();
}

View File

@@ -275,6 +275,9 @@ public:
void SetLastUsedFile(wxString file);
bool Save(gd::Project & project, wxString file);
StartHerePage* GetStartPage();
void OnLoseFocus(wxFocusEvent& event);
void OnChildFocus(wxChildFocusEvent& event);
void OnActivate(wxActivateEvent& event);
private:

View File

@@ -61,8 +61,7 @@ void MainFrame::CreateNewProject()
if ( !dialog.GetChosenTemplateFile().empty() )
{
newProject->SetProjectFile(dialog.GetChosenTemplateFile());
gd::ProjectFileWriter::LoadFromFile(*newProject, newProject->GetProjectFile());
gd::ProjectFileWriter::LoadFromFile(*newProject, dialog.GetChosenTemplateFile());
gd::ProjectResourcesCopier::CopyAllResourcesTo(*newProject, gd::NativeFileSystem::Get(),
targetDirectory, false);
}

View File

@@ -1,11 +1,11 @@
#include "Preferences.h"
//(*InternalHeaders(Preferences)
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/bitmap.h>
#include <wx/settings.h>
#include <wx/intl.h>
#include <wx/image.h>
#include <wx/string.h>
//*)
#include <wx/propgrid/advprops.h>
#include <wx/imaglist.h>
@@ -48,6 +48,7 @@ const long Preferences::ID_STATICTEXT5 = wxNewId();
const long Preferences::ID_STATICTEXT14 = wxNewId();
const long Preferences::ID_CHECKBOX8 = wxNewId();
const long Preferences::ID_CHECKBOX9 = wxNewId();
const long Preferences::ID_CHECKBOX5 = wxNewId();
const long Preferences::ID_PANEL6 = wxNewId();
const long Preferences::ID_STATICTEXT13 = wxNewId();
const long Preferences::ID_CHOICE2 = wxNewId();
@@ -139,65 +140,66 @@ Preferences::Preferences( wxWindow* parent ) :
changesNeedRestart(false)
{
//(*Initialize(Preferences)
wxStaticBoxSizer* StaticBoxSizer17;
wxFlexGridSizer* FlexGridSizer30;
wxStaticBoxSizer* StaticBoxSizer2;
wxFlexGridSizer* FlexGridSizer21;
wxFlexGridSizer* FlexGridSizer28;
wxFlexGridSizer* FlexGridSizer8;
wxStaticBoxSizer* StaticBoxSizer10;
wxFlexGridSizer* FlexGridSizer1;
wxFlexGridSizer* FlexGridSizer25;
wxFlexGridSizer* FlexGridSizer2;
wxFlexGridSizer* FlexGridSizer15;
wxStaticBoxSizer* StaticBoxSizer19;
wxStaticBoxSizer* StaticBoxSizer7;
wxStaticBoxSizer* StaticBoxSizer5;
wxFlexGridSizer* FlexGridSizer17;
wxFlexGridSizer* FlexGridSizer29;
wxFlexGridSizer* FlexGridSizer11;
wxFlexGridSizer* FlexGridSizer4;
wxFlexGridSizer* FlexGridSizer16;
wxFlexGridSizer* FlexGridSizer24;
wxFlexGridSizer* FlexGridSizer19;
wxStaticBoxSizer* StaticBoxSizer12;
wxFlexGridSizer* FlexGridSizer7;
wxFlexGridSizer* FlexGridSizer4;
wxStaticBoxSizer* StaticBoxSizer16;
wxFlexGridSizer* FlexGridSizer26;
wxFlexGridSizer* FlexGridSizer9;
wxStaticBoxSizer* StaticBoxSizer3;
wxFlexGridSizer* FlexGridSizer14;
wxFlexGridSizer* FlexGridSizer33;
wxFlexGridSizer* FlexGridSizer6;
wxStaticBoxSizer* StaticBoxSizer20;
wxStaticBoxSizer* StaticBoxSizer13;
wxStaticBoxSizer* StaticBoxSizer21;
wxFlexGridSizer* FlexGridSizer23;
wxFlexGridSizer* FlexGridSizer38;
wxFlexGridSizer* FlexGridSizer27;
wxFlexGridSizer* FlexGridSizer37;
wxFlexGridSizer* FlexGridSizer3;
wxFlexGridSizer* FlexGridSizer22;
wxStaticBoxSizer* StaticBoxSizer15;
wxStaticBoxSizer* StaticBoxSizer14;
wxStaticBoxSizer* StaticBoxSizer4;
wxFlexGridSizer* FlexGridSizer10;
wxFlexGridSizer* FlexGridSizer3;
wxFlexGridSizer* FlexGridSizer27;
wxStaticBoxSizer* StaticBoxSizer16;
wxFlexGridSizer* FlexGridSizer37;
wxFlexGridSizer* FlexGridSizer5;
wxFlexGridSizer* FlexGridSizer25;
wxFlexGridSizer* FlexGridSizer22;
wxFlexGridSizer* FlexGridSizer9;
wxFlexGridSizer* FlexGridSizer2;
wxStaticBoxSizer* StaticBoxSizer9;
wxFlexGridSizer* FlexGridSizer7;
wxStaticBoxSizer* StaticBoxSizer7;
wxStaticBoxSizer* StaticBoxSizer17;
wxStaticBoxSizer* StaticBoxSizer13;
wxStaticBoxSizer* StaticBoxSizer10;
wxStaticBoxSizer* StaticBoxSizer19;
wxFlexGridSizer* FlexGridSizer29;
wxFlexGridSizer* FlexGridSizer34;
wxStaticBoxSizer* StaticBoxSizer8;
wxStaticBoxSizer* StaticBoxSizer3;
wxStaticBoxSizer* StaticBoxSizer6;
wxFlexGridSizer* FlexGridSizer15;
wxFlexGridSizer* FlexGridSizer18;
wxFlexGridSizer* FlexGridSizer8;
wxStaticBoxSizer* StaticBoxSizer20;
wxFlexGridSizer* FlexGridSizer21;
wxFlexGridSizer* FlexGridSizer14;
wxStaticBoxSizer* StaticBoxSizer11;
wxFlexGridSizer* FlexGridSizer20;
wxFlexGridSizer* FlexGridSizer13;
wxFlexGridSizer* FlexGridSizer35;
wxFlexGridSizer* FlexGridSizer12;
wxFlexGridSizer* FlexGridSizer36;
wxFlexGridSizer* FlexGridSizer6;
wxStaticBoxSizer* StaticBoxSizer1;
wxFlexGridSizer* FlexGridSizer1;
wxFlexGridSizer* FlexGridSizer33;
wxFlexGridSizer* FlexGridSizer11;
wxFlexGridSizer* FlexGridSizer17;
wxStaticBoxSizer* StaticBoxSizer5;
wxFlexGridSizer* FlexGridSizer32;
wxFlexGridSizer* FlexGridSizer31;
wxFlexGridSizer* FlexGridSizer39;
wxStaticBoxSizer* StaticBoxSizer9;
wxStaticBoxSizer* StaticBoxSizer4;
wxStaticBoxSizer* StaticBoxSizer6;
wxStaticBoxSizer* StaticBoxSizer14;
wxStaticBoxSizer* StaticBoxSizer18;
wxFlexGridSizer* FlexGridSizer16;
wxFlexGridSizer* FlexGridSizer34;
wxFlexGridSizer* FlexGridSizer23;
wxFlexGridSizer* FlexGridSizer10;
wxStaticBoxSizer* StaticBoxSizer11;
wxFlexGridSizer* FlexGridSizer13;
wxFlexGridSizer* FlexGridSizer18;
wxFlexGridSizer* FlexGridSizer36;
wxFlexGridSizer* FlexGridSizer12;
wxFlexGridSizer* FlexGridSizer35;
wxFlexGridSizer* FlexGridSizer5;
wxFlexGridSizer* FlexGridSizer24;
wxFlexGridSizer* FlexGridSizer32;
wxStaticBoxSizer* StaticBoxSizer1;
wxFlexGridSizer* FlexGridSizer20;
wxFlexGridSizer* FlexGridSizer28;
wxFlexGridSizer* FlexGridSizer26;
wxFlexGridSizer* FlexGridSizer30;
Create(parent, wxID_ANY, _("GDevelop settings"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX, _T("wxID_ANY"));
FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
@@ -215,10 +217,10 @@ changesNeedRestart(false)
Panel1->SetSizer(FlexGridSizer12);
FlexGridSizer12->Fit(Panel1);
FlexGridSizer12->SetSizeHints(Panel1);
FlexGridSizer17->Add(Panel1, 1, wxALL|wxEXPAND, 0);
FlexGridSizer17->Add(Panel1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
StaticLine2 = new wxStaticLine(this, ID_STATICLINE2, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE2"));
FlexGridSizer17->Add(StaticLine2, 1, wxALL|wxEXPAND, 0);
FlexGridSizer1->Add(FlexGridSizer17, 1, wxALL|wxEXPAND, 0);
FlexGridSizer17->Add(StaticLine2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer1->Add(FlexGridSizer17, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
Listbook1 = new wxListbook(this, ID_LISTBOOK1, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT, _T("ID_LISTBOOK1"));
Panel2 = new wxPanel(Listbook1, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL6"));
FlexGridSizer14 = new wxFlexGridSizer(0, 1, 0, 0);
@@ -232,8 +234,8 @@ changesNeedRestart(false)
sendInfoCheck->SetValue(false);
sendInfoCheck->SetToolTip(_("When checked, GDevelop will send some anonymous information to our server so as to get some statistics about the software"));
FlexGridSizer39->Add(sendInfoCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer1->Add(FlexGridSizer39, 1, wxALL|wxEXPAND, 0);
FlexGridSizer14->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer1->Add(FlexGridSizer39, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer14->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer4 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("Autosave"));
FlexGridSizer10 = new wxFlexGridSizer(0, 1, 0, 0);
FlexGridSizer19 = new wxFlexGridSizer(0, 3, 0, 0);
@@ -248,17 +250,22 @@ changesNeedRestart(false)
FlexGridSizer10->Add(FlexGridSizer19, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticText14 = new wxStaticText(Panel2, ID_STATICTEXT14, _("Files will be saved with .gdg.autosave at the end of their name"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT14"));
FlexGridSizer10->Add(StaticText14, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer4->Add(FlexGridSizer10, 1, wxALL|wxEXPAND, 0);
FlexGridSizer14->Add(StaticBoxSizer4, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer4->Add(FlexGridSizer10, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer14->Add(StaticBoxSizer4, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer12 = new wxStaticBoxSizer(wxVERTICAL, Panel2, _("Miscellaneous"));
logCheck = new wxCheckBox(Panel2, ID_CHECKBOX8, _("Activate a log file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX8"));
logCheck->SetValue(false);
StaticBoxSizer12->Add(logCheck, 1, wxALL|wxALIGN_LEFT, 5);
StaticBoxSizer12->Add(logCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
avertOnSaveCheck = new wxCheckBox(Panel2, ID_CHECKBOX9, _("Warn when saving a project in a new directory"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX9"));
avertOnSaveCheck->SetValue(false);
avertOnSaveCheck->SetToolTip(_("Warn, when the project is saved in a new folder, that project resources should also be copied to the folder."));
StaticBoxSizer12->Add(avertOnSaveCheck, 1, wxALL|wxALIGN_LEFT, 5);
FlexGridSizer14->Add(StaticBoxSizer12, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer12->Add(avertOnSaveCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
FlexGridSizer14->Add(StaticBoxSizer12, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer21 = new wxStaticBoxSizer(wxHORIZONTAL, Panel2, _("External scene editor"));
externalSceneEditorCheck = new wxCheckBox(Panel2, ID_CHECKBOX5, _("Use the experimental, new scene editor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5"));
externalSceneEditorCheck->SetValue(false);
StaticBoxSizer21->Add(externalSceneEditorCheck, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer14->Add(StaticBoxSizer21, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
Panel2->SetSizer(FlexGridSizer14);
FlexGridSizer14->Fit(Panel2);
FlexGridSizer14->SetSizeHints(Panel2);
@@ -282,11 +289,11 @@ changesNeedRestart(false)
FlexGridSizer24->Add(StaticText16, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
newProjectFolderEdit = new wxTextCtrl(Panel3, ID_TEXTCTRL7, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL7"));
newProjectFolderEdit->SetToolTip(_("Path to the image editing program."));
FlexGridSizer24->Add(newProjectFolderEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer24->Add(newProjectFolderEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
newProjectFolderBrowseBt = new wxButton(Panel3, ID_BUTTON9, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON9"));
FlexGridSizer24->Add(newProjectFolderBrowseBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer17->Add(FlexGridSizer24, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer15->Add(StaticBoxSizer17, 1, wxALL|wxEXPAND, 5);
FlexGridSizer15->Add(StaticBoxSizer17, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer5 = new wxStaticBoxSizer(wxHORIZONTAL, Panel3, _("External programs"));
FlexGridSizer11 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer11->AddGrowableCol(1);
@@ -294,11 +301,11 @@ changesNeedRestart(false)
FlexGridSizer11->Add(StaticText6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
EditeurImageEdit = new wxTextCtrl(Panel3, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
EditeurImageEdit->SetToolTip(_("Path to the image editing program."));
FlexGridSizer11->Add(EditeurImageEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer11->Add(EditeurImageEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
BrowseEditionImage = new wxButton(Panel3, ID_BUTTON5, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON5"));
FlexGridSizer11->Add(BrowseEditionImage, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer5->Add(FlexGridSizer11, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer15->Add(StaticBoxSizer5, 1, wxALL|wxEXPAND, 5);
FlexGridSizer15->Add(StaticBoxSizer5, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer6 = new wxStaticBoxSizer(wxVERTICAL, Panel3, _("Compilation"));
FlexGridSizer13 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer13->AddGrowableCol(1);
@@ -306,24 +313,24 @@ changesNeedRestart(false)
FlexGridSizer13->Add(StaticText8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
DossierTempCompEdit = new wxTextCtrl(Panel3, ID_TEXTCTRL4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL4"));
DossierTempCompEdit->SetToolTip(_("Folder used to store temporary files when compiling a game.\nWe must own write permissions on this folder.\nIf empty, the default temporary folder of the system is used."));
FlexGridSizer13->Add(DossierTempCompEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer13->Add(DossierTempCompEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
BrowseDossierTempBt = new wxButton(Panel3, ID_BUTTON4, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
FlexGridSizer13->Add(BrowseDossierTempBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer6->Add(FlexGridSizer13, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer6->Add(FlexGridSizer13, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer31 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer31->AddGrowableCol(1);
StaticText21 = new wxStaticText(Panel3, ID_STATICTEXT21, _("Temporary folder for compilation:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT21"));
FlexGridSizer31->Add(StaticText21, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
eventsCompilerTempDirEdit = new wxTextCtrl(Panel3, ID_TEXTCTRL6, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL6"));
eventsCompilerTempDirEdit->SetToolTip(_("Folder used to store temporary files when compiling a game.\nWe must own write permissions on this folder.\nIf empty, the default temporary folder of the system is used."));
FlexGridSizer31->Add(eventsCompilerTempDirEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer31->Add(eventsCompilerTempDirEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
browseCompilationTempDir = new wxButton(Panel3, ID_BUTTON12, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON12"));
FlexGridSizer31->Add(browseCompilationTempDir, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer6->Add(FlexGridSizer31, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer6->Add(FlexGridSizer31, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
deleteTemporariesCheck = new wxCheckBox(Panel3, ID_CHECKBOX7, _("Delete temporaries as soon as possible"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7"));
deleteTemporariesCheck->SetValue(true);
StaticBoxSizer6->Add(deleteTemporariesCheck, 1, wxALL|wxALIGN_LEFT, 5);
FlexGridSizer15->Add(StaticBoxSizer6, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer6->Add(deleteTemporariesCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
FlexGridSizer15->Add(StaticBoxSizer6, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer19 = new wxStaticBoxSizer(wxHORIZONTAL, Panel3, _("Java"));
FlexGridSizer34 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer34->AddGrowableCol(1);
@@ -331,11 +338,11 @@ changesNeedRestart(false)
FlexGridSizer34->Add(StaticText24, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
javaDirEdit = new wxTextCtrl(Panel3, ID_TEXTCTRL8, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL8"));
javaDirEdit->SetToolTip(_("Folder used to store temporary files when compiling a game.\nWe must own write permissions on this folder.\nIf empty, the default temporary folder of the system is used."));
FlexGridSizer34->Add(javaDirEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer34->Add(javaDirEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
browseJavaBt = new wxButton(Panel3, ID_BUTTON15, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON15"));
FlexGridSizer34->Add(browseJavaBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer19->Add(FlexGridSizer34, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer15->Add(StaticBoxSizer19, 1, wxALL|wxEXPAND, 5);
FlexGridSizer15->Add(StaticBoxSizer19, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
Panel3->SetSizer(FlexGridSizer15);
FlexGridSizer15->Fit(Panel3);
FlexGridSizer15->SetSizeHints(Panel3);
@@ -350,8 +357,8 @@ changesNeedRestart(false)
sceneEventsTabPosition->Append(_("Top"));
sceneEventsTabPosition->SetSelection( sceneEventsTabPosition->Append(_("Bottom")) );
FlexGridSizer21->Add(sceneEventsTabPosition, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer11->Add(FlexGridSizer21, 1, wxALL|wxEXPAND, 0);
FlexGridSizer20->Add(StaticBoxSizer11, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer11->Add(FlexGridSizer21, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer20->Add(StaticBoxSizer11, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
Panel6->SetSizer(FlexGridSizer20);
FlexGridSizer20->Fit(Panel6);
FlexGridSizer20->SetSizeHints(Panel6);
@@ -373,7 +380,7 @@ changesNeedRestart(false)
oxygenStyleBt = new wxButton(Panel4, ID_BUTTON13, _("Oxygen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON13"));
FlexGridSizer2->Add(oxygenStyleBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer2->Add(FlexGridSizer2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer16->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND, 5);
FlexGridSizer16->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
FlexGridSizer3 = new wxFlexGridSizer(0, 4, 0, 0);
wxString __wxRadioBoxChoices_1[3] =
{
@@ -382,7 +389,7 @@ changesNeedRestart(false)
_("Metro")
};
ribbonStyleBox = new wxRadioBox(Panel4, ID_RADIOBOX1, _("Ribbon\'s style"), wxDefaultPosition, wxDefaultSize, 3, __wxRadioBoxChoices_1, 1, wxRA_HORIZONTAL, wxDefaultValidator, _T("ID_RADIOBOX1"));
FlexGridSizer3->Add(ribbonStyleBox, 1, wxALL|wxEXPAND, 5);
FlexGridSizer3->Add(ribbonStyleBox, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer7 = new wxStaticBoxSizer(wxHORIZONTAL, Panel4, _("Ribbon\'s colors"));
FlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0);
StaticText1 = new wxStaticText(Panel4, ID_STATICTEXT1, _("Primary :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
@@ -393,25 +400,25 @@ changesNeedRestart(false)
FlexGridSizer4->Add(StaticText2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
ribbonColor2Pnl = new wxPanel(Panel4, ID_PANEL10, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL10"));
FlexGridSizer4->Add(ribbonColor2Pnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer7->Add(FlexGridSizer4, 1, wxALL|wxEXPAND, 0);
FlexGridSizer3->Add(StaticBoxSizer7, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer7->Add(FlexGridSizer4, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer3->Add(StaticBoxSizer7, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer10 = new wxStaticBoxSizer(wxHORIZONTAL, Panel4, _("Ribbon labels"));
FlexGridSizer22 = new wxFlexGridSizer(2, 1, 0, 0);
FlexGridSizer22->AddGrowableCol(0);
hideLabelsCheck = new wxCheckBox(Panel4, ID_CHECKBOX2, _("Hide the button\'s labels"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
hideLabelsCheck->SetValue(false);
FlexGridSizer22->Add(hideLabelsCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer10->Add(FlexGridSizer22, 1, wxALL|wxEXPAND, 0);
FlexGridSizer3->Add(StaticBoxSizer10, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer10->Add(FlexGridSizer22, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer3->Add(StaticBoxSizer10, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer16 = new wxStaticBoxSizer(wxHORIZONTAL, Panel4, _("File button"));
FlexGridSizer32 = new wxFlexGridSizer(0, 3, 0, 0);
StaticText22 = new wxStaticText(Panel4, ID_STATICTEXT22, _("Color"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT22"));
FlexGridSizer32->Add(StaticText22, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
fileBtColorPnl = new wxPanel(Panel4, ID_PANEL21, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL21"));
FlexGridSizer32->Add(fileBtColorPnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer16->Add(FlexGridSizer32, 1, wxALL|wxEXPAND, 0);
FlexGridSizer3->Add(StaticBoxSizer16, 1, wxALL|wxEXPAND, 5);
FlexGridSizer16->Add(FlexGridSizer3, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer16->Add(FlexGridSizer32, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer3->Add(StaticBoxSizer16, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
FlexGridSizer16->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer18 = new wxFlexGridSizer(0, 3, 0, 0);
StaticBoxSizer3 = new wxStaticBoxSizer(wxVERTICAL, Panel4, _("Panes\' color"));
FlexGridSizer7 = new wxFlexGridSizer(0, 3, 0, 0);
@@ -427,7 +434,7 @@ changesNeedRestart(false)
FlexGridSizer7->Add(InactifColorPnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
InactifColor2Pnl = new wxPanel(Panel4, ID_PANEL2, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL2"));
FlexGridSizer7->Add(InactifColor2Pnl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer3->Add(FlexGridSizer7, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer3->Add(FlexGridSizer7, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer18->Add(StaticBoxSizer3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer8 = new wxStaticBoxSizer(wxVERTICAL, Panel4, _("Sash\'s color"));
FlexGridSizer8 = new wxFlexGridSizer(0, 2, 0, 0);
@@ -439,7 +446,7 @@ changesNeedRestart(false)
FlexGridSizer8->Add(StaticText10, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
borderColorPnl = new wxPanel(Panel4, ID_PANEL13, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL13"));
FlexGridSizer8->Add(borderColorPnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer8->Add(FlexGridSizer8, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer8->Add(FlexGridSizer8, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer18->Add(StaticBoxSizer8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer9 = new wxStaticBoxSizer(wxVERTICAL, Panel4, _("Text\'s color"));
FlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0);
@@ -451,9 +458,9 @@ changesNeedRestart(false)
FlexGridSizer6->Add(StaticText12, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
inactiveTextColorPnl = new wxPanel(Panel4, ID_PANEL14, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL14"));
FlexGridSizer6->Add(inactiveTextColorPnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer9->Add(FlexGridSizer6, 1, wxALL|wxEXPAND, 0);
FlexGridSizer18->Add(StaticBoxSizer9, 1, wxALL|wxEXPAND, 5);
FlexGridSizer16->Add(FlexGridSizer18, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer9->Add(FlexGridSizer6, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer18->Add(StaticBoxSizer9, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
FlexGridSizer16->Add(FlexGridSizer18, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer38 = new wxFlexGridSizer(0, 3, 0, 0);
StaticBoxSizer14 = new wxStaticBoxSizer(wxVERTICAL, Panel4, _("Tabs"));
FlexGridSizer30 = new wxFlexGridSizer(0, 3, 0, 0);
@@ -466,16 +473,16 @@ changesNeedRestart(false)
FlexGridSizer37->Add(StaticText20, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
tabColorPnl = new wxPanel(Panel4, ID_PANEL20, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL20"));
FlexGridSizer37->Add(tabColorPnl, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer30->Add(FlexGridSizer37, 1, wxALL|wxEXPAND, 0);
FlexGridSizer30->Add(FlexGridSizer37, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
wxString __wxRadioBoxChoices_2[2] =
{
_("Normal"),
_("Flat")
};
tabBox = new wxRadioBox(Panel4, ID_RADIOBOX2, _("Style"), wxDefaultPosition, wxDefaultSize, 2, __wxRadioBoxChoices_2, 1, 0, wxDefaultValidator, _T("ID_RADIOBOX2"));
FlexGridSizer30->Add(tabBox, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer14->Add(FlexGridSizer30, 1, wxALL|wxEXPAND, 0);
FlexGridSizer38->Add(StaticBoxSizer14, 1, wxALL|wxEXPAND, 5);
FlexGridSizer30->Add(tabBox, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer14->Add(FlexGridSizer30, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer38->Add(StaticBoxSizer14, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer20 = new wxStaticBoxSizer(wxHORIZONTAL, Panel4, _("Toolbars"));
FlexGridSizer35 = new wxFlexGridSizer(0, 2, 0, 0);
FlexGridSizer36 = new wxFlexGridSizer(0, 3, 0, 0);
@@ -484,17 +491,17 @@ changesNeedRestart(false)
FlexGridSizer36->Add(customToolbarColorCheck, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
toolbarColorPanel = new wxPanel(Panel4, ID_PANEL22, wxDefaultPosition, wxSize(39,16), wxRAISED_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL22"));
FlexGridSizer36->Add(toolbarColorPanel, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer35->Add(FlexGridSizer36, 1, wxALL|wxEXPAND, 0);
FlexGridSizer35->Add(FlexGridSizer36, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
wxString __wxRadioBoxChoices_3[2] =
{
_("Normal"),
_("Flat")
};
toolbarBox = new wxRadioBox(Panel4, ID_RADIOBOX3, _("Style"), wxDefaultPosition, wxDefaultSize, 2, __wxRadioBoxChoices_3, 1, 0, wxDefaultValidator, _T("ID_RADIOBOX3"));
FlexGridSizer35->Add(toolbarBox, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer20->Add(FlexGridSizer35, 1, wxALL|wxEXPAND, 0);
FlexGridSizer35->Add(toolbarBox, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer20->Add(FlexGridSizer35, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer38->Add(StaticBoxSizer20, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer16->Add(FlexGridSizer38, 1, wxALL|wxEXPAND, 0);
FlexGridSizer16->Add(FlexGridSizer38, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
Panel4->SetSizer(FlexGridSizer16);
FlexGridSizer16->Fit(Panel4);
FlexGridSizer16->SetSizeHints(Panel4);
@@ -508,7 +515,7 @@ changesNeedRestart(false)
FlexGridSizer28->Add(conditionsColumnWidthEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText18 = new wxStaticText(Panel8, ID_STATICTEXT18, _("pixels"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT18"));
FlexGridSizer28->Add(StaticText18, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer27->Add(FlexGridSizer28, 1, wxALL|wxEXPAND, 0);
FlexGridSizer27->Add(FlexGridSizer28, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
hideContextPanelsLabels = new wxCheckBox(Panel8, ID_CHECKBOX6, _("Hide the button\'s labels in context panels"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
hideContextPanelsLabels->SetValue(false);
FlexGridSizer27->Add(hideContextPanelsLabels, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
@@ -516,9 +523,9 @@ changesNeedRestart(false)
FlexGridSizer29 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer29->AddGrowableCol(0);
eventsEditorParametersProperties = new wxPropertyGrid(Panel8,ID_CUSTOM1,wxDefaultPosition,wxSize(532,211),0,_T("ID_CUSTOM1"));
FlexGridSizer29->Add(eventsEditorParametersProperties, 1, wxALL|wxEXPAND, 5);
FlexGridSizer29->Add(eventsEditorParametersProperties, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer15->Add(FlexGridSizer29, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer27->Add(StaticBoxSizer15, 1, wxALL|wxEXPAND, 5);
FlexGridSizer27->Add(StaticBoxSizer15, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
eventsEditorFontBt = new wxButton(Panel8, ID_BUTTON14, _("Choose the font used by events editors"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON14"));
FlexGridSizer27->Add(eventsEditorFontBt, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
Panel8->SetSizer(FlexGridSizer27);
@@ -538,12 +545,12 @@ changesNeedRestart(false)
externalCodeEditorCheck = new wxRadioButton(Panel7, ID_RADIOBUTTON1, _("Use an external program :"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON1"));
FlexGridSizer26->Add(externalCodeEditorCheck, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
codeEditorEdit = new wxTextCtrl(Panel7, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
FlexGridSizer26->Add(codeEditorEdit, 1, wxALL|wxEXPAND, 5);
FlexGridSizer26->Add(codeEditorEdit, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
browseCodeEditorBt = new wxButton(Panel7, ID_BUTTON11, _("Browse"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON11"));
FlexGridSizer26->Add(browseCodeEditorBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer25->Add(FlexGridSizer26, 1, wxALL|wxEXPAND, 0);
StaticBoxSizer13->Add(FlexGridSizer25, 1, wxALL|wxEXPAND, 0);
FlexGridSizer23->Add(StaticBoxSizer13, 1, wxALL|wxEXPAND, 5);
FlexGridSizer25->Add(FlexGridSizer26, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
StaticBoxSizer13->Add(FlexGridSizer25, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer23->Add(StaticBoxSizer13, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticBoxSizer18 = new wxStaticBoxSizer(wxHORIZONTAL, Panel7, _("Internal code compiler"));
FlexGridSizer33 = new wxFlexGridSizer(0, 3, 0, 0);
StaticText23 = new wxStaticText(Panel7, ID_STATICTEXT23, _("Maximum thread number for code compiler :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT23"));
@@ -552,7 +559,7 @@ changesNeedRestart(false)
codeCompilerThreadEdit->SetValue(_T("1"));
FlexGridSizer33->Add(codeCompilerThreadEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer18->Add(FlexGridSizer33, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer23->Add(StaticBoxSizer18, 1, wxALL|wxEXPAND, 5);
FlexGridSizer23->Add(StaticBoxSizer18, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
Panel7->SetSizer(FlexGridSizer23);
FlexGridSizer23->Fit(Panel7);
FlexGridSizer23->SetSizeHints(Panel7);
@@ -563,9 +570,9 @@ changesNeedRestart(false)
Listbook1->AddPage(Panel4, _("Appearance"), false);
Listbook1->AddPage(Panel8, _("Events editor"), false);
Listbook1->AddPage(Panel7, _("C++ Compilation"), false);
FlexGridSizer1->Add(Listbook1, 1, wxALL|wxEXPAND, 5);
FlexGridSizer1->Add(Listbook1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
FlexGridSizer1->Add(StaticLine1, 1, wxALL|wxEXPAND, 0);
FlexGridSizer1->Add(StaticLine1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
FlexGridSizer5 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer5->AddGrowableCol(0);
OkBt = new wxButton(this, ID_BUTTON1, _("Ok"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
@@ -574,7 +581,7 @@ changesNeedRestart(false)
FlexGridSizer5->Add(AnnulerBt, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
AideBt = new wxButton(this, ID_BUTTON3, _("Help"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
FlexGridSizer5->Add(AideBt, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer1->Add(FlexGridSizer5, 1, wxALL|wxEXPAND, 0);
FlexGridSizer1->Add(FlexGridSizer5, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
SetSizer(FlexGridSizer1);
wxFontData fontData_1;
fontData_1.EnableEffects(false);
@@ -586,6 +593,7 @@ changesNeedRestart(false)
Connect(ID_CHECKBOX4,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&Preferences::OnMAJCheckClick);
Connect(ID_CHECKBOX8,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&Preferences::OnlogCheckClick);
Connect(ID_CHECKBOX5,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&Preferences::OnexternalSceneEditorCheckClick);
Connect(ID_CHOICE2,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&Preferences::OnlangChoiceSelect);
Connect(ID_BUTTON9,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Preferences::OnnewProjectFolderBrowseBtClick);
Connect(ID_BUTTON5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Preferences::OnBrowseEditionImageClick);
@@ -890,6 +898,11 @@ changesNeedRestart(false)
pConfig->Read("/Save/AvertOnSaveAs", &avertOnSave, true);
if ( avertOnSave ) avertOnSaveCheck->SetValue(true);
}
{
bool useExternalEditor;
pConfig->Read("/SceneEditor/ExternalSceneEditor", &useExternalEditor, false);
if ( useExternalEditor ) externalSceneEditorCheck->SetValue(true);
}
conditionsColumnWidthEdit->SetValue(gd::String::From(static_cast<int>(pConfig->ReadDouble("EventsEditor/ConditionColumnWidth", 350))));
hideContextPanelsLabels->SetValue(pConfig->ReadBool("EventsEditor/HideContextPanelsLabels", false));
@@ -1052,6 +1065,8 @@ void Preferences::OnOkBtClick( wxCommandEvent& event )
pConfig->Write("/Save/AvertOnSaveAs", avertOnSaveCheck->GetValue());
pConfig->Write("/SceneEditor/ExternalSceneEditor", externalSceneEditorCheck->GetValue());
gd::InstructionSentenceFormatter * eventsEditorConfig = gd::InstructionSentenceFormatter::Get();
for (std::map<gd::String, gd::TextFormatting>::iterator it = eventsEditorConfig->typesFormatting.begin();it!=eventsEditorConfig->typesFormatting.end();++it)
{
@@ -1730,3 +1745,7 @@ void Preferences::OntoolbarColorPanelLeftUp(wxMouseEvent& event)
toolbarColorPanel->Refresh();
}
}
void Preferences::OnexternalSceneEditorCheckClick(wxCommandEvent& event)
{
}

View File

@@ -2,23 +2,23 @@
#define PREFERENCES_H
//(*Headers(Preferences)
#include <wx/spinctrl.h>
#include <wx/checkbox.h>
#include <wx/dialog.h>
#include <wx/sizer.h>
#include <wx/fontdlg.h>
#include <wx/notebook.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/radiobox.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/spinctrl.h>
#include <wx/propgrid/propgrid.h>
#include <wx/statline.h>
#include <wx/radiobut.h>
#include <wx/panel.h>
#include <wx/listbook.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/propgrid/propgrid.h>
#include <wx/radiobox.h>
#include <wx/statbmp.h>
#include <wx/fontdlg.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/listbook.h>
//*)
class Preferences: public wxDialog
@@ -29,99 +29,100 @@ class Preferences: public wxDialog
virtual ~Preferences();
//(*Declarations(Preferences)
wxButton* gdStyleBt;
wxStaticText* StaticText24;
wxButton* newProjectFolderBrowseBt;
wxStaticText* StaticText22;
wxButton* AideBt;
wxPanel* ActifColorPnl;
wxPanel* Panel6;
wxPanel* Panel1;
wxButton* browseCompilationTempDir;
wxStaticText* StaticText21;
wxStaticText* StaticText13;
wxStaticText* StaticText14;
wxPanel* Panel7;
wxRadioButton* internalCodeEditorCheck;
wxStaticText* StaticText15;
wxChoice* sceneEventsTabPosition;
wxStaticLine* StaticLine2;
wxCheckBox* hideLabelsCheck;
wxChoice* langChoice;
wxStaticText* StaticText17;
wxButton* oxygenStyleBt;
wxButton* BrowseDossierTempBt;
wxFontDialog* eventsEditorFontDialog;
wxPanel* ActifColor2Pnl;
wxPanel* inactiveTextColorPnl;
wxRadioBox* tabBox;
wxCheckBox* autosaveActivatedCheck;
wxButton* Button1;
wxButton* Button2;
wxTextCtrl* autosaveTimeEdit;
wxPanel* activeTextColorPnl;
wxPanel* activeTabColorPnl;
wxPanel* Panel8;
wxStaticText* StaticText20;
wxStaticText* StaticText18;
wxCheckBox* hideContextPanelsLabels;
wxStaticText* StaticText1;
wxStaticText* StaticText10;
wxTextCtrl* newProjectFolderEdit;
wxStaticText* StaticText16;
wxPanel* ribbonColor2Pnl;
wxPanel* Panel2;
wxCheckBox* deleteTemporariesCheck;
wxTextCtrl* DossierTempCompEdit;
wxRadioButton* externalCodeEditorCheck;
wxButton* eventsEditorFontBt;
wxPanel* InactifColorPnl;
wxStaticText* StaticText22;
wxButton* OkBt;
wxStaticText* StaticText9;
wxStaticText* StaticText20;
wxPanel* backColorPnl;
wxPanel* Panel5;
wxCheckBox* hideLabelsCheck;
wxCheckBox* avertOnSaveCheck;
wxCheckBox* MAJCheck;
wxRadioBox* ribbonStyleBox;
wxButton* gdStyleBt;
wxButton* BrowseDossierTempBt;
wxTextCtrl* newProjectFolderEdit;
wxTextCtrl* codeEditorEdit;
wxButton* oxygenStyleBt;
wxStaticText* StaticText13;
wxPanel* ActifColor2Pnl;
wxStaticText* StaticText2;
wxPanel* Panel4;
wxCheckBox* externalSceneEditorCheck;
wxChoice* sceneEventsTabPosition;
wxStaticText* StaticText14;
wxCheckBox* logCheck;
wxCheckBox* deleteTemporariesCheck;
wxButton* Button1;
wxStaticText* StaticText6;
wxPanel* activeTabColorPnl;
wxPanel* borderColorPnl;
wxSpinCtrl* codeCompilerThreadEdit;
wxStaticText* StaticText19;
wxStaticText* StaticText8;
wxPanel* toolbarColorPanel;
wxStaticText* StaticText11;
wxStaticText* StaticText18;
wxTextCtrl* autosaveTimeEdit;
wxPanel* Panel8;
wxPanel* tabColorPnl;
wxTextCtrl* eventsCompilerTempDirEdit;
wxFontDialog* eventsEditorFontDialog;
wxPanel* Panel1;
wxTextCtrl* conditionsColumnWidthEdit;
wxPanel* activeTextColorPnl;
wxStaticText* StaticText1;
wxStaticText* StaticText3;
wxTextCtrl* EditeurImageEdit;
wxPanel* Panel4;
wxStaticText* StaticText23;
wxCheckBox* customToolbarColorCheck;
wxStaticLine* StaticLine1;
wxPanel* Panel5;
wxStaticText* StaticText8;
wxStaticText* StaticText12;
wxButton* officeStyleBt;
wxTextCtrl* conditionsColumnWidthEdit;
wxButton* AnnulerBt;
wxPanel* Panel3;
wxStaticText* StaticText7;
wxTextCtrl* codeEditorEdit;
wxPanel* borderColorPnl;
wxPanel* InactifColorPnl;
wxRadioBox* ribbonStyleBox;
wxTextCtrl* eventsCompilerTempDirEdit;
wxCheckBox* logCheck;
wxTextCtrl* javaDirEdit;
wxStaticText* StaticText4;
wxPanel* toolbarColorPanel;
wxStaticText* StaticText5;
wxButton* eventsEditorFontBt;
wxStaticText* StaticText2;
wxStaticBitmap* StaticBitmap3;
wxCheckBox* avertOnSaveCheck;
wxButton* OkBt;
wxPanel* fileBtColorPnl;
wxStaticText* StaticText6;
wxPanel* backColorPnl;
wxPanel* inactiveTextColorPnl;
wxButton* browseJavaBt;
wxPanel* ribbonColor1Pnl;
wxButton* radianceStyleBt;
wxStaticText* StaticText19;
wxButton* BrowseEditionImage;
wxRadioButton* externalCodeEditorCheck;
wxPanel* tabColorPnl;
wxStaticText* StaticText9;
wxRadioBox* toolbarBox;
wxButton* newProjectFolderBrowseBt;
wxButton* Button2;
wxPanel* InactifColor2Pnl;
wxButton* browseCodeEditorBt;
wxPanel* Panel6;
wxPanel* Panel3;
wxStaticText* StaticText21;
wxStaticLine* StaticLine2;
wxStaticText* StaticText23;
wxStaticText* StaticText24;
wxCheckBox* customToolbarColorCheck;
wxRadioBox* tabBox;
wxPanel* ActifColorPnl;
wxCheckBox* sendInfoCheck;
wxCheckBox* hideContextPanelsLabels;
wxPropertyGrid* eventsEditorParametersProperties;
wxListbook* Listbook1;
wxStaticText* StaticText11;
wxCheckBox* sendInfoCheck;
wxStaticText* StaticText5;
wxStaticText* StaticText7;
wxPanel* Panel7;
wxPanel* fileBtColorPnl;
wxCheckBox* autosaveActivatedCheck;
wxStaticLine* StaticLine1;
wxButton* BrowseEditionImage;
wxTextCtrl* javaDirEdit;
wxStaticText* StaticText15;
wxStaticText* StaticText12;
wxButton* AnnulerBt;
wxPanel* Panel2;
wxChoice* langChoice;
wxButton* radianceStyleBt;
wxTextCtrl* DossierTempCompEdit;
wxPanel* ribbonColor1Pnl;
wxPanel* ribbonColor2Pnl;
wxStaticText* StaticText17;
wxStaticText* StaticText4;
wxButton* browseCodeEditorBt;
wxRadioBox* toolbarBox;
wxButton* browseCompilationTempDir;
wxButton* officeStyleBt;
wxStaticText* StaticText16;
wxStaticBitmap* StaticBitmap3;
wxRadioButton* internalCodeEditorCheck;
wxButton* AideBt;
//*)
protected:
@@ -139,6 +140,7 @@ class Preferences: public wxDialog
static const long ID_STATICTEXT14;
static const long ID_CHECKBOX8;
static const long ID_CHECKBOX9;
static const long ID_CHECKBOX5;
static const long ID_PANEL6;
static const long ID_STATICTEXT13;
static const long ID_CHOICE2;
@@ -266,6 +268,7 @@ class Preferences: public wxDialog
void OnMetroWhiteStyleClick(wxCommandEvent& event);
void OnMAJCheckClick(wxCommandEvent& event);
void OnOfficeGDStyleBtClick(wxCommandEvent& event);
void OnexternalSceneEditorCheckClick(wxCommandEvent& event);
//*)
void SetSkinOfficeGD();
void SetSkinOffice();

View File

@@ -40,7 +40,7 @@
<handler function="OnhScrollbarScroll" entry="EVT_COMMAND_SCROLL_CHANGED" />
</object>
<object class="Custom" name="ID_CUSTOM3" subclass="gd::LayoutEditorCanvas" variable="layoutEditorCanvas" member="yes">
<creating_code>$(THIS) = new $(CLASS)($(PARENT), project, layout, layout.GetInitialInstances(), layout.GetAssociatedLayoutEditorCanvasOptions(), mainFrameWrapper);</creating_code>
<creating_code>$(THIS) = new $(CLASS)($(PARENT), project, layout, layout.GetInitialInstances(), layout.GetAssociatedSettings(), mainFrameWrapper);</creating_code>
<local_include>1</local_include>
<style></style>
<pos>0,0</pos>
@@ -52,6 +52,18 @@
<label>Scene</label>
<icon code='gd::SkinHelper::GetIcon(&quot;scene&quot;, 16)' />
</object>
<object class="AuiNotebookPage">
<object class="wxPanel" name="ID_PANEL2" variable="externalSceneEditorContainerPanel" member="yes">
<object class="wxFlexGridSizer" variable="externalEditorContainerSizer" member="no">
<cols>1</cols>
<rows>1</rows>
<growablecols>0</growablecols>
<growablerows>0</growablerows>
</object>
</object>
<label>Scene</label>
<icon code='gd::SkinHelper::GetIcon(&quot;scene&quot;, 16)' />
</object>
<object class="AuiNotebookPage">
<object class="wxPanel" name="ID_PANEL6" variable="eventsPanel" member="yes">
<bg>#FFFFFF</bg>

View File

@@ -38,18 +38,18 @@
</object>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxStaticLine" name="ID_STATICLINE2" variable="StaticLine2" member="yes">
<size>10,-1</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -86,11 +86,11 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -141,11 +141,11 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -158,7 +158,7 @@
<label>Activate a log file</label>
<handler function="OnlogCheckClick" entry="EVT_CHECKBOX" />
</object>
<flag>wxALL|wxALIGN_LEFT</flag>
<flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -167,12 +167,29 @@
<label>Warn when saving a project in a new directory</label>
<tooltip>Warn, when the project is saved in a new folder, that project resources should also be copied to the folder.</tooltip>
</object>
<flag>wxALL|wxALIGN_LEFT</flag>
<flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer" variable="StaticBoxSizer21" member="no">
<label>External scene editor</label>
<object class="sizeritem">
<object class="wxCheckBox" name="ID_CHECKBOX5" variable="externalSceneEditorCheck" member="yes">
<label>Use the experimental, new scene editor</label>
<handler function="OnexternalSceneEditorCheckClick" entry="EVT_CHECKBOX" />
</object>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<option>1</option>
</object>
@@ -232,7 +249,7 @@
<object class="wxTextCtrl" name="ID_TEXTCTRL7" variable="newProjectFolderEdit" member="yes">
<tooltip>Path to the image editing program.</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -250,7 +267,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -273,7 +290,7 @@
<object class="wxTextCtrl" name="ID_TEXTCTRL3" variable="EditeurImageEdit" member="yes">
<tooltip>Path to the image editing program.</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -291,7 +308,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -315,7 +332,7 @@
<object class="wxTextCtrl" name="ID_TEXTCTRL4" variable="DossierTempCompEdit" member="yes">
<tooltip>Folder used to store temporary files when compiling a game.&#x0A;We must own write permissions on this folder.&#x0A;If empty, the default temporary folder of the system is used.</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -329,7 +346,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -349,7 +366,7 @@
<tooltip>Folder used to store temporary files when compiling a game.&#x0A;We must own write permissions on this folder.&#x0A;If empty, the default temporary folder of the system is used.</tooltip>
<handler function="OneventsCompilerTempDirEditText" entry="EVT_TEXT" />
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -363,7 +380,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -371,12 +388,12 @@
<label>Delete temporaries as soon as possible</label>
<checked>1</checked>
</object>
<flag>wxALL|wxALIGN_LEFT</flag>
<flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -399,7 +416,7 @@
<object class="wxTextCtrl" name="ID_TEXTCTRL8" variable="javaDirEdit" member="yes">
<tooltip>Folder used to store temporary files when compiling a game.&#x0A;We must own write permissions on this folder.&#x0A;If empty, the default temporary folder of the system is used.</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -418,7 +435,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -458,11 +475,11 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -540,7 +557,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -558,7 +575,7 @@
<default>-1</default>
<style>wxRA_HORIZONTAL</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -605,11 +622,11 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -631,11 +648,11 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -664,16 +681,16 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -741,7 +758,7 @@
<border>5</border>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
@@ -793,7 +810,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
@@ -845,16 +862,16 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -907,7 +924,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -919,16 +936,16 @@
</content>
<default>-1</default>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -961,7 +978,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -973,12 +990,12 @@
</content>
<default>-1</default>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
@@ -987,7 +1004,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
@@ -1025,7 +1042,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -1050,7 +1067,7 @@
<style></style>
<size>532,211</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1060,7 +1077,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1113,7 +1130,7 @@
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="ID_TEXTCTRL2" variable="codeEditorEdit" member="yes" />
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1127,15 +1144,15 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1167,7 +1184,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1176,7 +1193,7 @@
<label>C++ Compilation</label>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<border>5</border>
<option>1</option>
</object>
@@ -1184,7 +1201,7 @@
<object class="wxStaticLine" name="ID_STATICLINE1" variable="StaticLine1" member="yes">
<size>10,-1</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
<object class="sizeritem">
@@ -1219,7 +1236,7 @@
<option>1</option>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<flag>wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
</object>

View File

@@ -1,51 +1,34 @@
![GDevelop logo](https://raw.githubusercontent.com/4ian/GD/master/Core/docs/images/gdlogo.png "GDevelop logo")
GDevelop is a full featured, open source game development software, allowing to create HTML5 and native games
without needing any knowledge in a specific programming language. All the game logic is made thanks to an
intuitive and powerful event based system.
GDevelop is a full featured, open source game development software, allowing to create HTML5 and native games without any knowledge in a specific programming language. All the game logic is made thanks to an intuitive and powerful event based system.
![GDevelop in action, used to add a trigger in a platformer game](https://raw.githubusercontent.com/4ian/GD/master/Core/docs/images/demo.gif "GDevelop in action, used to add a trigger in a platformer game")
Powered by GDevelop: *Lil BUB's Hello Earth*
--------------------------------------------
Getting started [![Build Status](https://travis-ci.org/4ian/GD.svg?branch=master)](https://travis-ci.org/4ian/GD) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/4ian/GD?branch=master&svg=true)](https://ci.appveyor.com/project/4ian/gd)
---------------
![GDevelop logo](http://compilgames.net/assets/bub/screenshots-background.jpg "GDevelop logo")
| ❔ I want to... | 🚀 What to do |
| --- | --- |
| Download GDevelop to make games | Go on [GDevelop website](http://compilgames.net) to download GD! |
| Contribute to the new editor | Download [Node.js] and follow this [README](newIDE/README.md). |
| Contribute to the old C++ editor | Download and launch [CMake], choose this directory as the source, generate the Makefile and launch it. Be sure to have [required development libraries](http://4ian.github.io/GD-Documentation/GDCore%20Documentation/setup_dev_env.html) installed. <br><br> Fully detailed instructions are [available here](http://4ian.github.io/GD-Documentation). |
| Help to translate GDevelop | Go on the [GDevelop project on Crowdin](https://crowdin.com/project/gdevelop). |
> *BUB* is a very special, one of a kind critter. More specifically, she is the most amazing cat on the planet... and her game is made with *GDevelop*!
Overview of the architecture
----------------------------
Help BUB and GDevelop by **[backing the project on Kickstarter](http://lilbub.com/game)**! You can download the demo for [iOS](https://itunes.apple.com/us/app/lil-bubs-hello-earth/id1123383033?mt=8) and [Android](https://play.google.com/store/apps/details?id=com.lilbub.game).
| Directory | Description |
| --- | --- |
| `Core` | GDevelop core library, containing common tools to implement the IDE and work with GDevelop games. |
| `GDCpp` | GDevelop C++ game engine, used to **build native games**. |
| `GDJS` | GDevelop JS game engine, used to build **HTML5 games**. |
| `IDE` | The editor (written in C++). Binaries are created in `Binaries/Output` folder. |
| `newIDE` | The new editor, written in Javascript with React, Electron and Pixi.js. |
| `Extensions` | Extensions for C++ or JS game engines, providing objects, events and new features. |
About directory structure
-------------------------
### Documentation
* Core: GDevelop core library, containing common tools to implement the IDE and platforms.
* GDCpp: Sources files of GDevelop C++ Platform, used to build native games.
* GDJS: Sources files of GDevelop JS Platform, used to build HTML5 games.
* IDE: Sources files of GDevelop IDE.
* Extensions: Sources files of extensions. (For C++ or JS platform)
* Binaries: Binaries are generated in Binaries/Output. Binaries/Releases contains the installer exes and compressed files containing GDevelop releases.
* scripts: Various scripts, notably scripts to package GD (ReleaseProcedure* scripts).
* docs: Directory where the documentation is generated. To avoid you to generate it by yourself, it is [available here](http://4ian.github.io/GD-Documentation).
How to build [![Build Status](https://travis-ci.org/4ian/GD.svg?branch=master)](https://travis-ci.org/4ian/GD) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/4ian/GD?branch=master&svg=true)](https://ci.appveyor.com/project/4ian/gd)
------------
Full and detailed instructions are in the getting started page of the [documentation available here](http://4ian.github.io/GD-Documentation).
Basically:
* Install and launch [CMake].
* Choose this directory as the source directory, and a new directory like Binaries/.build
as the directory where to build. Files will be output in Binaries/Output anyway.
* On Linux, be sure to have [required development libraries](http://4ian.github.io/GD-Documentation/GDCore%20Documentation/setup_dev_env.html) installed. On Windows, be sure to use the same version of [the compiler](http://4ian.github.io/GD-Documentation/GDCore%20Documentation/setup_dev_env.html) for better compatibility.
* Generate the Makefile (or [Ninja] build file) and launch it.
Documentation
-------------
The documentation is available on http://4ian.github.io/GD-Documentation.
A pre-generated documentation of the Core library, C++ and JS game engines is [available here](http://4ian.github.io/GD-Documentation).
Links
-----
@@ -65,19 +48,26 @@ Links
### Related projects
* [GDevelop.js](https://github.com/4ian/GDevelop.js) is a binding to use GDevelop engine in Javascript.
* [GDevelop.js](https://github.com/4ian/GDevelop.js) is a binding to use GDevelop engine in Javascript. Used for newIDE.
* [GDevApp.com](https://gdevapp.com) is a radically innovative online game creator, compatible with GDevelop. It is based on GDevelop.js and can be used on any browser, including iOS and Android.
* [Lil BUB's HELLO EARTH](http://lilbub.com/game) is a retro 8-bit mobile video game featuring [Lil BUB](http://lilbub.com). It's created with GDevelop and made up of equal parts science, magic, and heart.
![Lil Bub](http://compilgames.net/assets/bub/screenshots-background.jpg "GDevelop logo")
> *BUB* is a very special, one of a kind critter. More specifically, she is the most amazing cat on the planet... and her game is made with *GDevelop*!
See **[the project on Kickstarter](http://lilbub.com/game)**! You can download the demo for [iOS](https://itunes.apple.com/us/app/lil-bubs-hello-earth/id1123383033?mt=8) and [Android](https://play.google.com/store/apps/details?id=com.lilbub.game).
License
-------
* The Core library, the native and HTML5 platforms and all extensions (respectively *Core*, *GDCpp*, *GDJS* and *Extensions* folders) are under the **MIT license**.
* The IDE (in the IDE folder) is licensed with **GPL v3**.
* The Core library, the native and HTML5 game engines, the new IDE, and all extensions (respectively `Core`, `GDCpp`, `GDJS`, `new IDE` and `Extensions` folders) are under the **MIT license**.
* The IDE (in the `IDE` folder) is licensed with **GPL v3**.
* The name, GDevelop, and its logo are the exclusive property of Florian Rival.
Games exported with GDevelop are based on the native and/or HTML5 platforms (see *Core*, *GDCpp* and *GDJS* folders): these platforms are distributed under the MIT license, so that you can **distribute, sell or do anything** with the games you created with GDevelop. In particular, you are not forced to make your game open source.
Games exported with GDevelop are based on the native and/or HTML5 game engines (see `Core`, `GDCpp` and `GDJS` folders): these engines are distributed under the MIT license, so that you can **distribute, sell or do anything** with the games you created with GDevelop. In particular, you are not forced to make your game open source.
[Node.js]:https://nodejs.org
[CMake]:http://www.cmake.org/
[Ninja]:http://martine.github.io/ninja/

View File

@@ -1,5 +1,5 @@
* The Core library, the native and HTML5 platforms and all extensions (respectively *Core*, *GDCpp*, *GDJS* and *Extensions* folders) are under the MIT license.
* The IDE (in the IDE folder) is licensed with GPL v3.
* The Core library, the native and HTML5 game engines, the new IDE, and all extensions (respectively *Core*, *GDCpp*, *GDJS*, *new IDE* and *Extensions* folders) are under the **MIT license**.
* The IDE (in the IDE folder) is licensed with **GPL v3**.
* The name, GDevelop, and its logo are the exclusive property of Florian Rival.
See the license.txt in each folders for the full licenses.

Some files were not shown because too many files have changed in this diff Show More