Adapted to changes in GDCore.

git-svn-id: svn://localhost@710 8062f311-0dae-4547-b526-b8ab9ac864a5
This commit is contained in:
Florian
2012-05-14 11:34:09 +00:00
parent 074b588669
commit cee23154c8
27 changed files with 243 additions and 243 deletions
+66 -66
View File
@@ -322,8 +322,8 @@ void ChoixAction::RefreshList()
0) :
extensionItem;
//Add each object actions
std::map<string, InstructionMetadata > allObjActions = extensions[i]->GetAllActionsForObject(objectsTypes[j]);
for(std::map<string, InstructionMetadata>::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it)
std::map<string, gd::InstructionMetadata > allObjActions = extensions[i]->GetAllActionsForObject(objectsTypes[j]);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it)
{
//Verify if the action match the search
if ( searching &&
@@ -361,8 +361,8 @@ void ChoixAction::RefreshList()
0) :
extensionItem;
//Add each automatism actions
std::map<string, InstructionMetadata > allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismsTypes[j]);
for(std::map<string, InstructionMetadata>::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it)
std::map<string, gd::InstructionMetadata > allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismsTypes[j]);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it)
{
//Verify if the action match the search
if ( searching
@@ -393,8 +393,8 @@ void ChoixAction::RefreshList()
}
//Add each (free) actions
std::map<string, InstructionMetadata > allActions = extensions[i]->GetAllActions();
for(std::map<string, InstructionMetadata>::const_iterator it = allActions.begin(); it != allActions.end(); ++it)
std::map<string, gd::InstructionMetadata > allActions = extensions[i]->GetAllActions();
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allActions.begin(); it != allActions.end(); ++it)
{
//Verify if the action match the search
if ( searching &&
@@ -473,8 +473,8 @@ void ChoixAction::RefreshObjectActionsList()
extensionItem;
//Add each object actions
std::map<string, InstructionMetadata > allObjActions = extensions[i]->GetAllActionsForObject(objectType);
for(std::map<string, InstructionMetadata>::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it)
std::map<string, gd::InstructionMetadata > allObjActions = extensions[i]->GetAllActionsForObject(objectType);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allObjActions.begin(); it != allObjActions.end(); ++it)
{
//Verify if the action match the search
if ( searching &&
@@ -519,8 +519,8 @@ void ChoixAction::RefreshObjectActionsList()
0) :
extensionItem;
//Add each automatism actions
std::map<string, InstructionMetadata > allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismType);
for(std::map<string, InstructionMetadata>::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it)
std::map<string, gd::InstructionMetadata > allAutoActions = extensions[i]->GetAllActionsForAutomatism(automatismType);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allAutoActions.begin(); it != allAutoActions.end(); ++it)
{
//Verify if the action match the search
if ( searching &&
@@ -596,18 +596,18 @@ void ChoixAction::RefreshFromAction()
{
if ( Type.empty() ) return;
const InstructionMetadata & InstructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(Type);
//Display action main properties
NomActionTxt->SetLabel( InstructionMetadata.fullname );
NomActionTxt->SetLabel( instructionMetadata.fullname );
NomActionTxt->Wrap( 450 );
ActionTextTxt->SetLabel( InstructionMetadata.description );
ActionTextTxt->SetLabel( instructionMetadata.description );
ActionTextTxt->Wrap( 450 );
if ( InstructionMetadata.icon.IsOk() ) ActionImg->SetBitmap( InstructionMetadata.icon );
if ( instructionMetadata.icon.IsOk() ) ActionImg->SetBitmap( instructionMetadata.icon );
else ActionImg->SetBitmap(CommonBitmapManager::GetInstance()->unknown24);
//Update controls count
while ( ParaEdit.size() < InstructionMetadata.parameters.size() )
while ( ParaEdit.size() < instructionMetadata.parameters.size() )
{
const string num =ToString( ParaEdit.size() );
long id = wxNewId(); //Bitmap buttons want an unique id so as to be displayed properly
@@ -635,7 +635,7 @@ void ChoixAction::RefreshFromAction()
ParaSpacer1.back()->Show(false);
ParaSpacer2.back()->Show(false);
}
while ( ParaEdit.size() > InstructionMetadata.parameters.size() )
while ( ParaEdit.size() > instructionMetadata.parameters.size() )
{
ParaFac.back()->Destroy();
ParaFac.erase(ParaFac.begin()+ParaFac.size()-1);
@@ -652,9 +652,9 @@ void ChoixAction::RefreshFromAction()
}
//Update parameters
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
if (InstructionMetadata.parameters[i].codeOnly)
if (instructionMetadata.parameters[i].codeOnly)
{
ParaFac.at(i)->Show(false);
ParaText.at(i)->Show(false);
@@ -663,21 +663,21 @@ void ChoixAction::RefreshFromAction()
}
else
{
ParaFac.at(i)->Show(InstructionMetadata.parameters[i].optional);
ParaFac.at(i)->Show(instructionMetadata.parameters[i].optional);
ParaFac.at(i)->SetValue(!ParaEdit.at( i )->GetValue().empty());
ParaText.at(i)->SetLabel( InstructionMetadata.parameters[i].description + _(" :") );
ParaText.at(i)->SetLabel( instructionMetadata.parameters[i].description + _(" :") );
ParaText.at(i)->Show();
if ( i < Param.size() ) ParaEdit.at( i )->SetValue(Param[i].GetPlainString());
ParaEdit.at(i)->Show();
ParaBmpBt.at(i)->SetBitmapLabel( TranslateAction::GetInstance()->BitmapFromType(InstructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->SetToolTip( TranslateAction::GetInstance()->LabelFromType(InstructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->Show( !InstructionMetadata.parameters[i].type.empty() );
ParaBmpBt.at(i)->SetBitmapLabel( TranslateAction::GetInstance()->BitmapFromType(instructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->SetToolTip( TranslateAction::GetInstance()->LabelFromType(instructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->Show( !instructionMetadata.parameters[i].type.empty() );
//De/activate widgets if parameter is optional
if ( InstructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() )
if ( instructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() )
{
ParaBmpBt.at(i)->Enable(false);
ParaText.at(i)->Enable(false);
@@ -693,11 +693,11 @@ void ChoixAction::RefreshFromAction()
}
//Add defaults
if ( !InstructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) )
if ( !instructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) )
{
if ( InstructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0");
else if ( InstructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\"");
else if ( InstructionMetadata.parameters[i].type == "operator" ) ParaEdit.at( i )->SetValue("=");
if ( instructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0");
else if ( instructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\"");
else if ( instructionMetadata.parameters[i].type == "operator" ) ParaEdit.at( i )->SetValue("=");
}
}
@@ -723,29 +723,29 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
unsigned int i = ToInt(num);
GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance();
const InstructionMetadata & InstructionMetadata = extensionManager->GetActionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = extensionManager->GetActionInfos(Type);
if ( i < MaxPara && i < InstructionMetadata.parameters.size())
if ( i < MaxPara && i < instructionMetadata.parameters.size())
{
if ( InstructionMetadata.parameters[i].type == "object" )
if ( instructionMetadata.parameters[i].type == "object" )
{
ChooseObject Dialog(this, game, scene, true, InstructionMetadata.parameters[i].supplementaryInformation);
ChooseObject Dialog(this, game, scene, true, instructionMetadata.parameters[i].supplementaryInformation);
if ( Dialog.ShowModal() == 1 )
{
ParaEdit.at(i)->ChangeValue(Dialog.objectChosen);
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "automatism" )
else if ( instructionMetadata.parameters[i].type == "automatism" )
{
std::string object = ParaEdit.empty() ? "" : ParaEdit[0]->GetValue().mb_str();
ChooseAutomatismDlg dialog(this, game, scene, object, InstructionMetadata.parameters[i].supplementaryInformation);
ChooseAutomatismDlg dialog(this, game, scene, object, instructionMetadata.parameters[i].supplementaryInformation);
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.automatismChosen);
return;
}
else if ( InstructionMetadata.parameters[i].type == "expression" )
else if ( instructionMetadata.parameters[i].type == "expression" )
{
EditExpression Dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene);
if ( Dialog.ShowModal() == 1 )
@@ -754,7 +754,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "string" )
else if ( instructionMetadata.parameters[i].type == "string" )
{
EditTextDialog Dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene);
if ( Dialog.ShowModal() == 1 )
@@ -763,7 +763,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "color" )
else if ( instructionMetadata.parameters[i].type == "color" )
{
wxColour color = wxGetColourFromUser(this, wxColour(0,0,0));
if ( color.IsOk() )
@@ -776,7 +776,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "police" )
else if ( instructionMetadata.parameters[i].type == "police" )
{
wxFileDialog dialog(this, _("Choisissez une police de caractère ( fichiers ttf, ttc )"), "", "", "Polices (*.ttf, *.ttc)|*.ttf;*.ttc");
dialog.ShowModal();
@@ -788,7 +788,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "musicfile" )
else if ( instructionMetadata.parameters[i].type == "musicfile" )
{
wxFileDialog dialog(this, _("Choisissez une musique ( fichiers ogg )"), "", "", "Fichiers audio (*.ogg)|*.ogg");
dialog.ShowModal();
@@ -800,7 +800,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "soundfile" )
else if ( instructionMetadata.parameters[i].type == "soundfile" )
{
wxFileDialog dialog(this, _("Choisissez un son ( fichiers wav )"), "", "", "Fichiers audio (*.wav)|*.wav");
dialog.ShowModal();
@@ -812,7 +812,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "operator" )
else if ( instructionMetadata.parameters[i].type == "operator" )
{
SigneModification dialog(this);
int retour = dialog.ShowModal();
@@ -830,7 +830,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "password" )
else if ( instructionMetadata.parameters[i].type == "password" )
{
GeneratePassword dialog(this);
@@ -839,7 +839,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "yesorno" )
else if ( instructionMetadata.parameters[i].type == "yesorno" )
{
if (wxMessageBox("Choisissez Oui ou Non pour compléter ce paramètre :", "Oui ou non",wxYES_NO ) == wxYES)
{
@@ -852,7 +852,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "layer" )
else if ( instructionMetadata.parameters[i].type == "layer" )
{
ChooseLayer dialog(this, scene.initialLayers);
if( dialog.ShowModal() == 1 )
@@ -860,7 +860,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "joyaxis" )
else if ( instructionMetadata.parameters[i].type == "joyaxis" )
{
ChoiceJoyAxis dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene, true);
if( dialog.ShowModal() == 1 )
@@ -868,7 +868,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "file" )
else if ( instructionMetadata.parameters[i].type == "file" )
{
ChoiceFile dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene, true);
if ( dialog.ShowModal() == 1 )
@@ -876,7 +876,7 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
return;
}
else if ( InstructionMetadata.parameters[i].type == "objectvar" )
else if ( instructionMetadata.parameters[i].type == "objectvar" )
{
if ( ParaEdit.empty() ) return;
@@ -893,23 +893,23 @@ void ChoixAction::OnABtClick(wxCommandEvent& event)
else
return;
ChooseVariableDialog dialog(this, object->GetVariables());
gd::ChooseVariableDialog dialog(this, object->GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
return;
}
else if ( InstructionMetadata.parameters[i].type == "scenevar" )
else if ( instructionMetadata.parameters[i].type == "scenevar" )
{
ChooseVariableDialog dialog(this, scene.GetVariables());
gd::ChooseVariableDialog dialog(this, scene.GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
return;
}
else if ( InstructionMetadata.parameters[i].type == "globalvar" )
else if ( instructionMetadata.parameters[i].type == "globalvar" )
{
ChooseVariableDialog dialog(this, game.GetVariables());
gd::ChooseVariableDialog dialog(this, game.GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
@@ -945,12 +945,12 @@ void ChoixAction::OnFacClicked(wxCommandEvent& event)
void ChoixAction::OnOkBtClick(wxCommandEvent& event)
{
GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance();
const InstructionMetadata & InstructionMetadata = extensionManager->GetActionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = extensionManager->GetActionInfos(Type);
if ( Type == "" )
return;
if (ParaEdit.size() < InstructionMetadata.parameters.size())
if (ParaEdit.size() < instructionMetadata.parameters.size())
{
wxLogWarning(_("Trop peu de paramètres. Ceci peut être dû à un bug de Game Develop."));
return;
@@ -960,9 +960,9 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event)
bool parametersHaveErrors = false;
string message;
size_t parameterDisplayedNb = 0;
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
if (!InstructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++;
if (!instructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++;
//Do not check optional parameters which are desactivated
if ( !ParaFac.at(i)->IsShown() || (ParaFac.at(i)->IsShown() && ParaFac.at(i)->GetValue()))
@@ -970,12 +970,12 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event)
CallbacksForExpressionCorrectnessTesting callbacks(game, scene);
GDExpressionParser expressionParser(string(ParaEdit.at(i)->GetValue().mb_str())) ;
if ( (InstructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks)))
if ( (instructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks)))
{
message = expressionParser.firstErrorStr;
@@ -998,15 +998,15 @@ void ChoixAction::OnOkBtClick(wxCommandEvent& event)
//On ajoute les paramètres
Param.clear();
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
//Si un paramètre facultatif est desactivé
if ( ParaFac.at(i)->IsShown() && !ParaFac.at(i)->GetValue())
{
Param.push_back(GDExpression(""));
Param.push_back(gd::Expression(""));
}
else
Param.push_back(GDExpression(string(ParaEdit.at(i)->GetValue().mb_str())));
Param.push_back(gd::Expression(string(ParaEdit.at(i)->GetValue().mb_str())));
}
if ( LocaliseCheck->GetValue() )
@@ -1024,7 +1024,7 @@ void ChoixAction::OnCancelBtClick(wxCommandEvent& event)
void ChoixAction::OnAideBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(29);
}
+2 -2
View File
@@ -24,7 +24,7 @@
#include <wx/checkbox.h>
#include <wx/imaglist.h>
#include <wx/bmpbuttn.h>
#include "GDCore/Events/GDExpression.h"
#include "GDCore/Events/Expression.h"
class Scene;
class Game;
@@ -47,7 +47,7 @@ class ChoixAction: public wxDialog
bool Loc;
Game & game;
Scene & scene;
vector < GDExpression > Param;
vector < gd::Expression > Param;
unsigned static const int MaxPara = 8;
+63 -63
View File
@@ -354,8 +354,8 @@ void ChoixCondition::RefreshList()
0) :
extensionItem;
//Add each object conditions
std::map<string, InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForObject(objectsTypes[j]);
for(std::map<string, InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
std::map<string, gd::InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForObject(objectsTypes[j]);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
{
//Verify if the condition match the search
if ( searching &&
@@ -393,8 +393,8 @@ void ChoixCondition::RefreshList()
0) :
extensionItem;
//Add each automatism conditions
std::map<string, InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismsTypes[j]);
for(std::map<string, InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
std::map<string, gd::InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismsTypes[j]);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
{
//Verify if the condition match the search
if ( searching &&
@@ -425,8 +425,8 @@ void ChoixCondition::RefreshList()
}
//Add each (free) conditions
std::map<string, InstructionMetadata > allConditions = extensions[i]->GetAllConditions();
for(std::map<string, InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
std::map<string, gd::InstructionMetadata > allConditions = extensions[i]->GetAllConditions();
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
{
//Verify if the condition match the search
if ( searching &&
@@ -505,8 +505,8 @@ void ChoixCondition::RefreshObjectConditionsList()
extensionItem;
//Add each object conditions
std::map<string, InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForObject(objectType);
for(std::map<string, InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
std::map<string, gd::InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForObject(objectType);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
{
//Verify if the condition match the search
if ( searching &&
@@ -551,8 +551,8 @@ void ChoixCondition::RefreshObjectConditionsList()
0) :
extensionItem;
//Add each automatism conditions
std::map<string, InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismType);
for(std::map<string, InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
std::map<string, gd::InstructionMetadata > allConditions = extensions[i]->GetAllConditionsForAutomatism(automatismType);
for(std::map<string, gd::InstructionMetadata>::const_iterator it = allConditions.begin(); it != allConditions.end(); ++it)
{
//Verify if the condition match the search
if ( searching &&
@@ -627,17 +627,17 @@ void ChoixCondition::RefreshFromCondition()
if ( Type.empty() ) return;
//Display action main properties
const InstructionMetadata & InstructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(Type);
NomConditionTxt->SetLabel( InstructionMetadata.fullname );
NomConditionTxt->SetLabel( instructionMetadata.fullname );
NomConditionTxt->Wrap( 450 );
ConditionTextTxt->SetLabel( InstructionMetadata.description );
ConditionTextTxt->SetLabel( instructionMetadata.description );
ConditionTextTxt->Wrap( 450 );
if ( InstructionMetadata.icon.IsOk() ) ConditionImg->SetBitmap( InstructionMetadata.icon );
if ( instructionMetadata.icon.IsOk() ) ConditionImg->SetBitmap( instructionMetadata.icon );
else ConditionImg->SetBitmap(CommonBitmapManager::GetInstance()->unknown24);
//Update controls count
while ( ParaEdit.size() < InstructionMetadata.parameters.size() )
while ( ParaEdit.size() < instructionMetadata.parameters.size() )
{
const string num =ToString( ParaEdit.size() );
long id = wxNewId(); //Bitmap buttons want an unique id so as to be displayed properly
@@ -665,7 +665,7 @@ void ChoixCondition::RefreshFromCondition()
ParaSpacer1.back()->Show(false);
ParaSpacer2.back()->Show(false);
}
while ( ParaEdit.size() > InstructionMetadata.parameters.size() )
while ( ParaEdit.size() > instructionMetadata.parameters.size() )
{
ParaFac.back()->Destroy();
ParaFac.erase(ParaFac.begin()+ParaFac.size()-1);
@@ -682,9 +682,9 @@ void ChoixCondition::RefreshFromCondition()
}
//Update parameters
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
if (InstructionMetadata.parameters[i].codeOnly)
if (instructionMetadata.parameters[i].codeOnly)
{
ParaFac.at(i)->Show(false);
ParaText.at(i)->Show(false);
@@ -693,21 +693,21 @@ void ChoixCondition::RefreshFromCondition()
}
else
{
ParaFac.at(i)->Show(InstructionMetadata.parameters[i].optional);
ParaFac.at(i)->Show(instructionMetadata.parameters[i].optional);
ParaFac.at(i)->SetValue(!ParaEdit.at( i )->GetValue().empty());
ParaText.at(i)->SetLabel( InstructionMetadata.parameters[i].description + _(" :") );
ParaText.at(i)->SetLabel( instructionMetadata.parameters[i].description + _(" :") );
ParaText.at( i )->Show();
if ( i < Param.size() ) ParaEdit.at( i )->SetValue(Param[i].GetPlainString());
ParaEdit.at( i )->Show();
ParaBmpBt.at(i)->SetBitmapLabel( TranslateCondition::BitmapFromType(InstructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->SetToolTip( TranslateCondition::LabelFromType(InstructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->Show( !InstructionMetadata.parameters[i].type.empty() );
ParaBmpBt.at(i)->SetBitmapLabel( TranslateCondition::BitmapFromType(instructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->SetToolTip( TranslateCondition::LabelFromType(instructionMetadata.parameters[i].type) );
ParaBmpBt.at(i)->Show( !instructionMetadata.parameters[i].type.empty() );
//De/activate widgets if parameter is optional
if ( InstructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() )
if ( instructionMetadata.parameters[i].optional && !ParaFac.at(i)->GetValue() && ParaEdit.at(i)->GetValue().empty() )
{
ParaBmpBt.at(i)->Enable(false);
ParaText.at(i)->Enable(false);
@@ -723,11 +723,11 @@ void ChoixCondition::RefreshFromCondition()
}
//Add defaults
if ( !InstructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) )
if ( !instructionMetadata.parameters[i].optional && (i >= Param.size() || Param[i].GetPlainString().empty()) )
{
if ( InstructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0");
else if ( InstructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\"");
else if ( InstructionMetadata.parameters[i].type == "file" ) ParaEdit.at( i )->SetValue("\"\"");
if ( instructionMetadata.parameters[i].type == "expression" ) ParaEdit.at( i )->SetValue("0");
else if ( instructionMetadata.parameters[i].type == "string" ) ParaEdit.at( i )->SetValue("\"\"");
else if ( instructionMetadata.parameters[i].type == "file" ) ParaEdit.at( i )->SetValue("\"\"");
}
}
}
@@ -779,29 +779,29 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
unsigned int i = atoi( num.c_str() );
GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance();
const InstructionMetadata & InstructionMetadata = extensionManager->GetConditionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = extensionManager->GetConditionInfos(Type);
if ( i < MaxPara && i < InstructionMetadata.parameters.size())
if ( i < MaxPara && i < instructionMetadata.parameters.size())
{
if ( InstructionMetadata.parameters[i].type == "object" )
if ( instructionMetadata.parameters[i].type == "object" )
{
ChooseObject dialog(this, game, scene, true, InstructionMetadata.parameters[i].supplementaryInformation);
ChooseObject dialog(this, game, scene, true, instructionMetadata.parameters[i].supplementaryInformation);
if ( dialog.ShowModal() == 1 )
{
ParaEdit.at(i)->ChangeValue(dialog.objectChosen);
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "automatism" )
else if ( instructionMetadata.parameters[i].type == "automatism" )
{
std::string object = ParaEdit.empty() ? "" : ParaEdit[0]->GetValue().mb_str();
ChooseAutomatismDlg dialog(this, game, scene, object, InstructionMetadata.parameters[i].supplementaryInformation);
ChooseAutomatismDlg dialog(this, game, scene, object, instructionMetadata.parameters[i].supplementaryInformation);
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.automatismChosen);
return;
}
else if ( InstructionMetadata.parameters[i].type == "expression" )
else if ( instructionMetadata.parameters[i].type == "expression" )
{
EditExpression dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene);
if ( dialog.ShowModal() == 1 )
@@ -810,7 +810,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "mouse" )
else if ( instructionMetadata.parameters[i].type == "mouse" )
{
ChoixBouton dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ));
if ( dialog.ShowModal() == 1 )
@@ -819,7 +819,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "key" )
else if ( instructionMetadata.parameters[i].type == "key" )
{
ChoixClavier dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ));
if ( dialog.ShowModal() == 1 )
@@ -828,7 +828,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "file" )
else if ( instructionMetadata.parameters[i].type == "file" )
{
ChoiceFile dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene, true);
if ( dialog.ShowModal() == 1 )
@@ -836,7 +836,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
return;
}
else if ( InstructionMetadata.parameters[i].type == "string" )
else if ( instructionMetadata.parameters[i].type == "string" )
{
EditTextDialog dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene);
if ( dialog.ShowModal() == 1 )
@@ -845,7 +845,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
}
return;
}
else if ( InstructionMetadata.parameters[i].type == "relationalOperator" )
else if ( instructionMetadata.parameters[i].type == "relationalOperator" )
{
SigneTest dialog(this);
int retour = dialog.ShowModal();
@@ -865,7 +865,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
return;
}
else if ( InstructionMetadata.parameters[i].type == "trueorfalse" )
else if ( instructionMetadata.parameters[i].type == "trueorfalse" )
{
TrueOrFalse dialog(this, _("Choisissez Vrai ou Faux pour remplir le paramètre"), _("Vrai ou Faux"));
if ( dialog.ShowModal() == 1 )
@@ -873,7 +873,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
else
ParaEdit.at(i)->ChangeValue(_("Faux"));
}
else if ( InstructionMetadata.parameters[i].type == "yesorno" )
else if ( instructionMetadata.parameters[i].type == "yesorno" )
{
if (wxMessageBox("Choisissez Oui ou Non pour compléter ce paramètre :", "Oui ou non",wxYES_NO ) == wxYES)
ParaEdit.at(i)->ChangeValue(_("oui"));
@@ -882,7 +882,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
return;
}
else if ( InstructionMetadata.parameters[i].type == "layer" )
else if ( instructionMetadata.parameters[i].type == "layer" )
{
ChooseLayer dialog(this, scene.initialLayers);
if( dialog.ShowModal() == 1 )
@@ -890,7 +890,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
return;
}
else if ( InstructionMetadata.parameters[i].type == "joyaxis" )
else if ( instructionMetadata.parameters[i].type == "joyaxis" )
{
ChoiceJoyAxis dialog(this, static_cast<string>( ParaEdit.at(i)->GetValue() ), game, scene, true);
if( dialog.ShowModal() == 1 )
@@ -898,7 +898,7 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
return;
}
else if ( InstructionMetadata.parameters[i].type == "objectvar" )
else if ( instructionMetadata.parameters[i].type == "objectvar" )
{
if ( ParaEdit.empty() ) return;
@@ -915,23 +915,23 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
else
return;
ChooseVariableDialog dialog(this, object->GetVariables());
gd::ChooseVariableDialog dialog(this, object->GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
return;
}
else if ( InstructionMetadata.parameters[i].type == "scenevar" )
else if ( instructionMetadata.parameters[i].type == "scenevar" )
{
ChooseVariableDialog dialog(this, scene.GetVariables());
gd::ChooseVariableDialog dialog(this, scene.GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
return;
}
else if ( InstructionMetadata.parameters[i].type == "globalvar" )
else if ( instructionMetadata.parameters[i].type == "globalvar" )
{
ChooseVariableDialog dialog(this, game.GetVariables());
gd::ChooseVariableDialog dialog(this, game.GetVariables());
if ( dialog.ShowModal() == 1 )
ParaEdit.at(i)->ChangeValue(dialog.selectedVariable);
@@ -943,12 +943,12 @@ void ChoixCondition::OnABtClick( wxCommandEvent& event )
void ChoixCondition::OnOkBtClick( wxCommandEvent& event )
{
GDpriv::ExtensionsManager * extensionManager = GDpriv::ExtensionsManager::GetInstance();
const InstructionMetadata & InstructionMetadata = extensionManager->GetConditionInfos(Type);
const gd::InstructionMetadata & instructionMetadata = extensionManager->GetConditionInfos(Type);
if ( Type == "" )
return;
if (ParaEdit.size() < InstructionMetadata.parameters.size())
if (ParaEdit.size() < instructionMetadata.parameters.size())
{
wxLogWarning(_("Trop peu de paramètres. Ceci peut être dû à un bug de Game Develop."));
return;
@@ -958,9 +958,9 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event )
bool parametersHaveErrors = false;
string message;
size_t parameterDisplayedNb = 0;
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
if ( !InstructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++;
if ( !instructionMetadata.parameters[i].codeOnly ) parameterDisplayedNb++;
//Do not check optional parameters which are desactivated
if ( !ParaFac.at(i)->IsShown() || (ParaFac.at(i)->IsShown() && ParaFac.at(i)->GetValue()))
@@ -968,12 +968,12 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event )
CallbacksForExpressionCorrectnessTesting callbacks(game, scene);
GDExpressionParser expressionParser(string(ParaEdit.at(i)->GetValue().mb_str())) ;
if ( (InstructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(InstructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks)))
if ( (instructionMetadata.parameters[i].type == "string" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "file" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "color" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "joyaxis" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "layer" && !expressionParser.ParseTextExpression(game, scene, callbacks))
||(instructionMetadata.parameters[i].type == "expression" && !expressionParser.ParseMathExpression(game, scene, callbacks)))
{
message = expressionParser.firstErrorStr;
@@ -997,9 +997,9 @@ void ChoixCondition::OnOkBtClick( wxCommandEvent& event )
//On ajoute les paramètres
Param.clear();
for ( unsigned int i = 0;i < InstructionMetadata.parameters.size();i++ )
for ( unsigned int i = 0;i < instructionMetadata.parameters.size();i++ )
{
Param.push_back( GDExpression(string(ParaEdit.at(i)->GetValue().mb_str())) );
Param.push_back( gd::Expression(string(ParaEdit.at(i)->GetValue().mb_str())) );
}
if ( ContraireCheck->GetValue() )
@@ -1025,7 +1025,7 @@ void ChoixCondition::OnCancelBtClick( wxCommandEvent& event )
void ChoixCondition::OnAideBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(23);
}
+2 -2
View File
@@ -22,7 +22,7 @@
//*)
#include <wx/srchctrl.h>
#include <wx/bmpbuttn.h>
#include "GDCore/Events/GDExpression.h"
#include "GDCore/Events/Expression.h"
class Scene;
class Game;
@@ -46,7 +46,7 @@ class ChoixCondition: public wxDialog
bool Contraire;
Game & game;
Scene & scene;
vector < GDExpression > Param;
vector < gd::Expression > Param;
unsigned static const int MaxPara = 8;
+3 -3
View File
@@ -202,7 +202,7 @@ void ChoixTemplateEvent::ProcessEvents(vector < gd::BaseEventSPtr > & events )
//Pour chaque évènement
for ( unsigned int j = 0;j < events.size() ; j++ )
{
vector < vector<Instruction>* > allConditionsVectors = events[j]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > allConditionsVectors = events[j]->GetAllConditionsVectors();
for ( unsigned int k = 0;k < allConditionsVectors.size() ;k++ )
{
for (unsigned int l = 0;l<allConditionsVectors[k]->size();++l)
@@ -220,7 +220,7 @@ void ChoixTemplateEvent::ProcessEvents(vector < gd::BaseEventSPtr > & events )
}
}
vector < vector<Instruction>* > allActionsVectors = events[j]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > allActionsVectors = events[j]->GetAllActionsVectors();
for ( unsigned int k = 0;k < allActionsVectors.size() ;k++ )
{
for (unsigned int l = 0;l<allActionsVectors[k]->size();++l)
@@ -384,6 +384,6 @@ string ChoixTemplateEvent::ConvertParam( string parameter, const string & toRepl
void ChoixTemplateEvent::OnAideBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(151);
}
+2 -2
View File
@@ -104,14 +104,14 @@ gd::ExternalEvents * Clipboard::GetExternalEvents()
return externalEventsCopied->Clone();
}
void Clipboard::SetConditions( const std::vector<Instruction> & conditions )
void Clipboard::SetConditions( const std::vector<gd::Instruction> & conditions )
{
hasInstructions = true;
instructionsAreConditions = true;
instructionsCopied = conditions;
}
void Clipboard::SetActions( const std::vector<Instruction> & actions )
void Clipboard::SetActions( const std::vector<gd::Instruction> & actions )
{
hasInstructions = true;
instructionsAreConditions = false;
+4 -4
View File
@@ -39,12 +39,12 @@ public:
gd::ExternalEvents * GetExternalEvents();
bool HasExternalEvents() { return hasExternalEvents; };
void SetConditions( const std::vector<Instruction> & conditions );
void SetActions( const std::vector<Instruction> & actions );
void SetConditions( const std::vector<gd::Instruction> & conditions );
void SetActions( const std::vector<gd::Instruction> & actions );
bool HasCondition() { return hasInstructions && instructionsAreConditions; };
bool HasAction() { return hasInstructions && !instructionsAreConditions; };
std::vector<Instruction> GetInstructions() const { return instructionsCopied; };
std::vector<gd::Instruction> GetInstructions() const { return instructionsCopied; };
void SetObjectGroup( const gd::ObjectGroup & group );
gd::ObjectGroup GetObjectGroup();
@@ -64,7 +64,7 @@ private:
std::vector<gd::BaseEventSPtr> eventsCopied;
bool hasEvents;
std::vector<Instruction> instructionsCopied;
std::vector<gd::Instruction> instructionsCopied;
bool hasInstructions;
bool instructionsAreConditions;
+3 -3
View File
@@ -342,19 +342,19 @@ void Compilation::OnOuvrirBtClick( wxCommandEvent& event )
void Compilation::OnAideBtClick( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(125);
}
void Compilation::OnCGShareBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(192);
}
void Compilation::OnDistribuerBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(158);
}
+7 -7
View File
@@ -287,38 +287,38 @@ void CreateTemplate::ProcessEvents(vector < gd::BaseEventSPtr > & eventsToProces
//On remplace dans chaque paramètre des actions et des conditions
for ( unsigned int i = 0;i < eventsToProcess.size() ;i++ )
{
vector < vector<Instruction>* > allConditionsVectors = eventsToProcess[i]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > allConditionsVectors = eventsToProcess[i]->GetAllConditionsVectors();
for (unsigned int c = 0;c<allConditionsVectors.size();++c)
{
for ( unsigned int nb = 0;nb < allConditionsVectors[c]->size() ;nb++ )
{
vector < GDExpression > parametres = allConditionsVectors[c]->at( nb ).GetParameters();
vector < gd::Expression > parametres = allConditionsVectors[c]->at( nb ).GetParameters();
for ( unsigned int j = 0;j < parametres.size() ;j++ )
{
//On respecte bien l'ordre, du plus grand au plus petit
for ( unsigned int k = 0; k < parameters.size() ;k++ )
{
string ReplaceBy = "_PARAM" +ToString( parameters.at( k ).second ) + "_";
parametres.at( j ) = GDExpression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) );
parametres.at( j ) = gd::Expression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) );
}
}
allConditionsVectors[c]->at( nb ).SetParameters(parametres);
}
}
vector < vector<Instruction>* > allActionsVectors = eventsToProcess[i]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > allActionsVectors = eventsToProcess[i]->GetAllActionsVectors();
for (unsigned int a = 0;a<allActionsVectors.size();++a)
{
for ( unsigned int nb = 0;nb < allActionsVectors[a]->size() ;nb++ )
{
vector < GDExpression > parametres = allActionsVectors[a]->at( nb ).GetParameters();
vector < gd::Expression > parametres = allActionsVectors[a]->at( nb ).GetParameters();
for ( unsigned int j = 0;j < parametres.size() ;j++ )
{
//On respecte bien l'ordre, du plus grand au plus petit
for ( unsigned int k = 0; k < parameters.size() ;k++ )
{
string ReplaceBy = "_PARAM" +ToString( parameters.at( k ).second ) + "_";
parametres.at( j ) = GDExpression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) );
parametres.at( j ) = gd::Expression( ConvertParam( parametres.at( j ).GetPlainString(), parameters.at( k ).first, ReplaceBy ) );
}
}
allActionsVectors[a]->at( nb ).SetParameters(parametres);
@@ -349,7 +349,7 @@ string CreateTemplate::ConvertParam( string Parametre, string ToReplace, string
void CreateTemplate::OnAideBtClick( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(151);
}
+1 -1
View File
@@ -227,7 +227,7 @@ Demarrage::~Demarrage()
Button1 = new wxButton(Panel1, ID_BUTTON6, _("Suivant"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON6"));
FlexGridSizer6->Add(Button1, 1, wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
FlexGridSizer2->Add(FlexGridSizer6, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
Panel1->SetSizer(FlexGridSizer2);
+2 -2
View File
@@ -361,7 +361,7 @@ void EditOptionsPosition::OnAnnulerBtClick(wxCommandEvent& event)
void EditOptionsPosition::OnAideBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(25);
}
@@ -381,7 +381,7 @@ void EditOptionsPosition::OnsizeCheckClick(wxCommandEvent& event)
void EditOptionsPosition::OneditInitialVariablesClick(wxCommandEvent& event)
{
ChooseVariableDialog dialog(this, initialVariables, /*editingOnly=*/true);
gd::ChooseVariableDialog dialog(this, initialVariables, /*editingOnly=*/true);
if ( dialog.ShowModal() == 1 )
UpdateInitialVariablesStatus();
}
+1 -1
View File
@@ -504,7 +504,7 @@ void EditPropJeu::OnOkBtClick( wxCommandEvent& event )
void EditPropJeu::OnAideBtClick( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(8);
}
+1 -1
View File
@@ -249,6 +249,6 @@ void EditPropScene::OnColorBtClick(wxCommandEvent& event)
StaticText5 = new wxStaticText(this, ID_STATICTEXT6, _("Distance du premier plan de coupe :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6"));
FlexGridSizer8->Add(StaticText5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer8->Add(StaticText5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
zNearEdit = new wxTextCtrl(this, ID_TEXTCTRL3, _("1"), wxDefaultPosition, wxSize(77,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
+1 -1
View File
@@ -161,7 +161,7 @@ void EditorLayers::OnMoreOptions(wxCommandEvent& event)
void EditorLayers::OnHelp(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(226);
}
+4 -4
View File
@@ -781,8 +781,8 @@ bool EditorObjectList::CheckObjectName(std::string name)
for(unsigned int j = 0;j<objectsTypes.size();++j)
{
//Add each object expression
std::map<string, ExpressionMetadata > allObjExpr = extensions[i]->GetAllExpressionsForObject(objectsTypes[j]);
for(std::map<string, ExpressionMetadata>::const_iterator it = allObjExpr.begin(); it != allObjExpr.end(); ++it)
std::map<string, gd::ExpressionMetadata > allObjExpr = extensions[i]->GetAllExpressionsForObject(objectsTypes[j]);
for(std::map<string, gd::ExpressionMetadata>::const_iterator it = allObjExpr.begin(); it != allObjExpr.end(); ++it)
{
if ( name == it->first )
nameUsedByExpression = true;
@@ -824,7 +824,7 @@ void EditorObjectList::OnChercherBtClick( wxCommandEvent& event )
////////////////////////////////////////////////////////////
void EditorObjectList::OnAideBtClick( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(10);
}
@@ -1062,7 +1062,7 @@ void EditorObjectList::OneditVarMenuISelected(wxCommandEvent& event)
return;
}
ChooseVariableDialog dialog(this, (*object)->GetVariables(), /*editingOnly=*/true);
gd::ChooseVariableDialog dialog(this, (*object)->GetVariables(), /*editingOnly=*/true);
if ( dialog.ShowModal() == 1 )
if ( scene ) scene->wasModified = true;
}
+1 -1
View File
@@ -323,7 +323,7 @@ void EditorObjetsGroups::DisableAll()
////////////////////////////////////////////////////////////
void EditorObjetsGroups::OnHelp(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(180);
}
+15 -15
View File
@@ -726,7 +726,7 @@ void EventsEditor::HandleSelectionAfterClick(int x, int y, bool allowLiveEditing
liveEdit->SetFocus();
liveEditingChangesMade = false;
}
//Instruction selection?
//gd::Instruction selection?
else if ( itemsAreas.IsOnInstruction(x, y) )
{
InstructionItem item = itemsAreas.GetInstructionAt(x, y);
@@ -773,7 +773,7 @@ void EventsEditor::HandleSelectionAfterClick(int x, int y, bool allowLiveEditing
void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event)
{
//Instruction selection?
//gd::Instruction selection?
if ( itemsAreas.IsOnInstruction(event.GetX(), event.GetY()) )
{
InstructionItem item = itemsAreas.GetInstructionAt(event.GetX(), event.GetY());
@@ -830,7 +830,7 @@ void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event)
ChoixCondition dialog(this, game, scene);
if ( dialog.ShowModal() == 0)
{
Instruction instruction;
gd::Instruction instruction;
instruction.SetType( dialog.Type );
instruction.SetParameters( dialog.Param );
instruction.SetInverted( dialog.Contraire );
@@ -846,7 +846,7 @@ void EventsEditor::OneventsPanelLeftDClick(wxMouseEvent& event)
ChoixAction dialog(this, game, scene);
if ( dialog.ShowModal() == 0)
{
Instruction instruction;
gd::Instruction instruction;
instruction.SetType( dialog.Type );
instruction.SetParameters( dialog.Param );
@@ -933,7 +933,7 @@ void EventsEditor::OneventsPanelMouseMove(wxMouseEvent& event)
selection.SetHighlighted(itemsAreas.GetParameterAt(event.GetX(), event.GetY()));
}
}
else if ( itemsAreas.IsOnParameter(event.GetX(), event.GetY()) ) //Parameter without list ( a simple GDExpression )
else if ( itemsAreas.IsOnParameter(event.GetX(), event.GetY()) ) //Parameter without list ( a simple gd::Expression )
selection.SetHighlighted(itemsAreas.GetParameterAt(event.GetX(), event.GetY()));
}
@@ -1104,7 +1104,7 @@ void EventsEditor::EndLiveEditing()
}
eventsPanel->SetFocusIgnoringChildren();
*liveEditedParameter.parameter = GDExpression(ToString(liveEdit->GetValue()));
*liveEditedParameter.parameter = gd::Expression(ToString(liveEdit->GetValue()));
liveEditedParameter.event->eventHeightNeedUpdate = true;
liveEditingPanel->Show(false);
@@ -1151,7 +1151,7 @@ void EventsEditor::OnaddInstrBtClick(wxCommandEvent& event)
ChoixCondition dialog(this, game, scene);
if ( dialog.ShowModal() == 0)
{
Instruction instruction;
gd::Instruction instruction;
instruction.SetType(dialog.Type);
instruction.SetParameters(dialog.Param);
instruction.SetInverted(dialog.Contraire);
@@ -1167,7 +1167,7 @@ void EventsEditor::OnaddInstrBtClick(wxCommandEvent& event)
ChoixAction dialog(this, game, scene);
if ( dialog.ShowModal() == 0)
{
Instruction instruction;
gd::Instruction instruction;
instruction.SetType(dialog.Type);
instruction.SetParameters(dialog.Param);
@@ -1392,7 +1392,7 @@ void EventsEditor::OneventCopyMenuSelected(wxCommandEvent& event)
if ( selection.HasSelectedConditions())
{
std::vector < InstructionItem > itemsSelected = selection.GetAllSelectedInstructions();
std::vector < Instruction > instructionsToCopy;
std::vector < gd::Instruction > instructionsToCopy;
for (unsigned int i = 0;i<itemsSelected.size();++i)
{
if (itemsSelected[i].instruction != NULL)
@@ -1404,7 +1404,7 @@ void EventsEditor::OneventCopyMenuSelected(wxCommandEvent& event)
else if ( selection.HasSelectedActions())
{
std::vector < InstructionItem > itemsSelected = selection.GetAllSelectedInstructions();
std::vector < Instruction > instructionsToCopy;
std::vector < gd::Instruction > instructionsToCopy;
for (unsigned int i = 0;i<itemsSelected.size();++i)
{
if (itemsSelected[i].instruction != NULL)
@@ -1447,13 +1447,13 @@ void EventsEditor::OneventPasteMenuSelected(wxCommandEvent& event)
if ( !Clipboard::GetInstance()->HasCondition() ) return;
//Get information about list where conditions must be pasted
std::vector<Instruction> * instructionList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList;
std::vector<gd::Instruction> * instructionList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList;
size_t positionInThisList = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().positionInList : std::string::npos;
gd::BaseEvent * event = selection.HasSelectedConditions() ? selection.GetAllSelectedInstructions().back().event : selection.GetHighlightedInstructionList().event;
if (instructionList == NULL) return;
//Paste all conditions
const vector < Instruction > & instructions = Clipboard::GetInstance()->GetInstructions();
const vector < gd::Instruction > & instructions = Clipboard::GetInstance()->GetInstructions();
for (unsigned int i = 0;i<instructions.size();++i)
{
if ( positionInThisList < instructionList->size() )
@@ -1471,13 +1471,13 @@ void EventsEditor::OneventPasteMenuSelected(wxCommandEvent& event)
if ( !Clipboard::GetInstance()->HasAction() ) return;
//Get information about list where actions must be pasted
std::vector<Instruction> * instructionList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList;
std::vector<gd::Instruction> * instructionList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().instructionList : selection.GetHighlightedInstructionList().instructionList;
size_t positionInThisList = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().positionInList : std::string::npos;
gd::BaseEvent * event = selection.HasSelectedActions() ? selection.GetAllSelectedInstructions().back().event : selection.GetHighlightedInstructionList().event;
if (instructionList == NULL) return;
//Paste all actions
const vector < Instruction > & instructions = Clipboard::GetInstance()->GetInstructions();
const vector < gd::Instruction > & instructions = Clipboard::GetInstance()->GetInstructions();
for (unsigned int i = 0;i<instructions.size();++i)
{
if ( positionInThisList < instructionList->size() )
@@ -1541,7 +1541,7 @@ void EventsEditor::OnredoMenuSelected(wxCommandEvent& event)
void EventsEditor::OnHelpBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(11);
}
+46 -46
View File
@@ -34,7 +34,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
plainExpression += text;
};
virtual void OnStaticFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnStaticFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
std::string parametersStr;
for (unsigned int i = 0;i<parameters.size();++i)
@@ -48,7 +48,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
plainExpression += functionName+"("+parametersStr+")";
};
virtual void OnStaticFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnStaticFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
//Special case : Function without name is a litteral string.
if ( functionName.empty() )
@@ -71,7 +71,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
plainExpression += functionName+"("+parametersStr+")";
};
virtual void OnObjectFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnObjectFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
@@ -88,7 +88,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
+"."+functionName+"("+parametersStr+")";
};
virtual void OnObjectFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnObjectFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
@@ -105,7 +105,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
+"."+functionName+"("+parametersStr+")";
};
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
if ( parameters.size() < 2 ) return;
@@ -122,7 +122,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
+"."+parameters[1].GetPlainString()+"::"+functionName+"("+parametersStr+")";
};
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
if ( parameters.size() < 2 ) return;
@@ -139,7 +139,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
+"."+parameters[1].GetPlainString()+"::"+functionName+"("+parametersStr+")";
};
virtual bool OnSubMathExpression(const Game & game, const Scene & scene, GDExpression & expression)
virtual bool OnSubMathExpression(const Game & game, const Scene & scene, gd::Expression & expression)
{
std::string newExpression;
@@ -149,11 +149,11 @@ class CallbacksForRenamingObject : public ParserCallbacks
if ( !parser.ParseMathExpression(game, scene, callbacks) )
return false;
expression = GDExpression(newExpression);
expression = gd::Expression(newExpression);
return true;
}
virtual bool OnSubTextExpression(const Game & game, const Scene & scene, GDExpression & expression)
virtual bool OnSubTextExpression(const Game & game, const Scene & scene, gd::Expression & expression)
{
std::string newExpression;
@@ -163,7 +163,7 @@ class CallbacksForRenamingObject : public ParserCallbacks
if ( !parser.ParseTextExpression(game, scene, callbacks) )
return false;
expression = GDExpression(newExpression);
expression = gd::Expression(newExpression);
return true;
}
@@ -190,43 +190,43 @@ class CallbacksForRemovingObject : public ParserCallbacks
virtual void OnOperator(std::string text){};
virtual void OnNumber(std::string text){};
virtual void OnStaticFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnStaticFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
};
virtual void OnStaticFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnStaticFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
};
virtual void OnObjectFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnObjectFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
if ( parameters[0].GetPlainString() == name ) objectPresent = true;
};
virtual void OnObjectFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnObjectFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
if ( parameters[0].GetPlainString() == name ) objectPresent = true;
};
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<GDExpression> & parameters, const ExpressionMetadata & expressionInfo)
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::ExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
if ( parameters[0].GetPlainString() == name ) objectPresent = true;
};
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<GDExpression> & parameters, const StrExpressionMetadata & expressionInfo)
virtual void OnObjectAutomatismFunction(std::string functionName, const std::vector<gd::Expression> & parameters, const gd::StrExpressionMetadata & expressionInfo)
{
if ( parameters.empty() ) return;
if ( parameters[0].GetPlainString() == name ) objectPresent = true;
};
virtual bool OnSubMathExpression(const Game & game, const Scene & scene, GDExpression & expression)
virtual bool OnSubMathExpression(const Game & game, const Scene & scene, gd::Expression & expression)
{
CallbacksForRemovingObject callbacks(name);
@@ -238,7 +238,7 @@ class CallbacksForRemovingObject : public ParserCallbacks
return true;
}
virtual bool OnSubTextExpression(const Game & game, const Scene & scene, GDExpression & expression)
virtual bool OnSubTextExpression(const Game & game, const Scene & scene, gd::Expression & expression)
{
CallbacksForRemovingObject callbacks(name);
@@ -255,18 +255,18 @@ class CallbacksForRemovingObject : public ParserCallbacks
std::string name;
};
bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string oldName, std::string newName)
bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string oldName, std::string newName)
{
bool somethingModified = false;
for (unsigned int aId = 0;aId < actions.size();++aId)
{
InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType());
gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType());
for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb)
{
//Replace object's name in parameters
if ( instrInfos.parameters[pNb].type == "object" && actions[aId].GetParameter(pNb).GetPlainString() == oldName )
actions[aId].SetParameter(pNb, GDExpression(newName));
actions[aId].SetParameter(pNb, gd::Expression(newName));
//Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression")
{
@@ -279,7 +279,7 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector
if ( parser.ParseMathExpression(game, scene, callbacks) && newExpression != oldExpression )
{
somethingModified = true;
actions[aId].SetParameter(pNb, GDExpression(newExpression));
actions[aId].SetParameter(pNb, gd::Expression(newExpression));
}
}
//Replace object's name in text expressions
@@ -294,7 +294,7 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector
if ( parser.ParseTextExpression(game, scene, callbacks) && newExpression != oldExpression )
{
somethingModified = true;
actions[aId].SetParameter(pNb, GDExpression(newExpression));
actions[aId].SetParameter(pNb, gd::Expression(newExpression));
}
}
}
@@ -306,18 +306,18 @@ bool EventsRefactorer::RenameObjectInActions(Game & game, Scene & scene, vector
return somethingModified;
}
bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string oldName, std::string newName)
bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string oldName, std::string newName)
{
bool somethingModified = false;
for (unsigned int cId = 0;cId < conditions.size();++cId)
{
InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType());
gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType());
for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb)
{
//Replace object's name in parameters
if ( instrInfos.parameters[pNb].type == "object" && conditions[cId].GetParameter(pNb).GetPlainString() == oldName )
conditions[cId].SetParameter(pNb, GDExpression(newName));
conditions[cId].SetParameter(pNb, gd::Expression(newName));
//Replace object's name in expressions
else if (instrInfos.parameters[pNb].type == "expression")
{
@@ -330,7 +330,7 @@ bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vect
if ( parser.ParseMathExpression(game, scene, callbacks) )
{
somethingModified = true;
conditions[cId].SetParameter(pNb, GDExpression(newExpression));
conditions[cId].SetParameter(pNb, gd::Expression(newExpression));
}
}
//Replace object's name in text expressions
@@ -345,7 +345,7 @@ bool EventsRefactorer::RenameObjectInConditions(Game & game, Scene & scene, vect
if ( parser.ParseMathExpression(game, scene, callbacks) )
{
somethingModified = true;
conditions[cId].SetParameter(pNb, GDExpression(newExpression));
conditions[cId].SetParameter(pNb, gd::Expression(newExpression));
}
}
}
@@ -361,7 +361,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector <
{
for (unsigned int i = 0;i<events.size();++i)
{
vector < vector<Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
for (unsigned int j = 0;j < conditionsVectors.size();++j)
{
bool somethingModified = RenameObjectInConditions(game, scene, *conditionsVectors[j], oldName, newName);
@@ -370,7 +370,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector <
#endif
}
vector < vector<Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
for (unsigned int j = 0;j < actionsVectors.size();++j)
{
bool somethingModified = RenameObjectInActions(game, scene, *actionsVectors[j], oldName, newName);
@@ -383,7 +383,7 @@ void EventsRefactorer::RenameObjectInEvents(Game & game, Scene & scene, vector <
}
}
bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string name)
bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string name)
{
bool somethingModified = false;
@@ -391,7 +391,7 @@ bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector
{
bool deleteMe = false;
InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType());
gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetActionInfos(actions[aId].GetType());
for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb)
{
//Replace object's name in parameters
@@ -439,7 +439,7 @@ bool EventsRefactorer::RemoveObjectInActions(Game & game, Scene & scene, vector
return somethingModified;
}
bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string name)
bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string name)
{
bool somethingModified = false;
@@ -447,7 +447,7 @@ bool EventsRefactorer::RemoveObjectInConditions(Game & game, Scene & scene, vect
{
bool deleteMe = false;
InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType());
gd::InstructionMetadata instrInfos = GDpriv::ExtensionsManager::GetInstance()->GetConditionInfos(conditions[cId].GetType());
for (unsigned int pNb = 0;pNb < instrInfos.parameters.size();++pNb)
{
//Replace object's name in parameters
@@ -497,7 +497,7 @@ void EventsRefactorer::RemoveObjectInEvents(Game & game, Scene & scene, vector <
{
for (unsigned int i = 0;i<events.size();++i)
{
vector < vector<Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
for (unsigned int j = 0;j < conditionsVectors.size();++j)
{
bool conditionsModified = RemoveObjectInConditions(game, scene, *conditionsVectors[j], name);
@@ -506,7 +506,7 @@ void EventsRefactorer::RemoveObjectInEvents(Game & game, Scene & scene, vector <
#endif
}
vector < vector<Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
for (unsigned int j = 0;j < actionsVectors.size();++j)
{
bool actionsModified = RemoveObjectInActions(game, scene, *actionsVectors[j], name);
@@ -530,7 +530,7 @@ void EventsRefactorer::ReplaceStringInEvents(Game & game, Scene & scene, std::ve
{
if ( inConditions )
{
vector < vector<Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
for (unsigned int j = 0;j < conditionsVectors.size();++j)
{
bool conditionsModified = ReplaceStringInConditions(game, scene, *conditionsVectors[j], toReplace, newString, matchCase);
@@ -542,7 +542,7 @@ void EventsRefactorer::ReplaceStringInEvents(Game & game, Scene & scene, std::ve
if ( inActions )
{
vector < vector<Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
for (unsigned int j = 0;j < actionsVectors.size();++j)
{
bool actionsModified = ReplaceStringInActions(game, scene, *actionsVectors[j], toReplace, newString, matchCase);
@@ -584,7 +584,7 @@ std::string ReplaceAllOccurencesCaseUnsensitive(string context, string from, con
return context;
}
bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string toReplace, std::string newString, bool matchCase)
bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string toReplace, std::string newString, bool matchCase)
{
bool somethingModified = false;
@@ -597,7 +597,7 @@ bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector
if ( newParameter != actions[aId].GetParameter(pNb).GetPlainString())
{
actions[aId].SetParameter(pNb, GDExpression(newParameter));
actions[aId].SetParameter(pNb, gd::Expression(newParameter));
somethingModified = true;
#if defined(GD_IDE_ONLY)
actions[aId].renderedHeightNeedUpdate = true;
@@ -611,7 +611,7 @@ bool EventsRefactorer::ReplaceStringInActions(Game & game, Scene & scene, vector
return somethingModified;
}
bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase)
bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase)
{
bool somethingModified = false;
@@ -624,7 +624,7 @@ bool EventsRefactorer::ReplaceStringInConditions(Game & game, Scene & scene, vec
if ( newParameter != conditions[cId].GetParameter(pNb).GetPlainString())
{
conditions[cId].SetParameter(pNb, GDExpression(newParameter));
conditions[cId].SetParameter(pNb, gd::Expression(newParameter));
somethingModified = true;
#if defined(GD_IDE_ONLY)
conditions[cId].renderedHeightNeedUpdate = true;
@@ -652,7 +652,7 @@ vector < boost::weak_ptr<gd::BaseEvent> > EventsRefactorer::SearchInEvents(Game
if ( inConditions )
{
vector < vector<Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
vector < vector<gd::Instruction>* > conditionsVectors = events[i]->GetAllConditionsVectors();
for (unsigned int j = 0;j < conditionsVectors.size();++j)
{
if (!eventAddedInResults && SearchStringInConditions(game, scene, *conditionsVectors[j], search, matchCase))
@@ -664,7 +664,7 @@ vector < boost::weak_ptr<gd::BaseEvent> > EventsRefactorer::SearchInEvents(Game
if ( inActions )
{
vector < vector<Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
vector < vector<gd::Instruction>* > actionsVectors = events[i]->GetAllActionsVectors();
for (unsigned int j = 0;j < actionsVectors.size();++j)
{
if (!eventAddedInResults && SearchStringInActions(game, scene, *actionsVectors[j], search, matchCase))
@@ -684,7 +684,7 @@ vector < boost::weak_ptr<gd::BaseEvent> > EventsRefactorer::SearchInEvents(Game
return results;
}
bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector < Instruction > & actions, std::string search, bool matchCase)
bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector < gd::Instruction > & actions, std::string search, bool matchCase)
{
if ( !matchCase ) boost::to_upper(search);
@@ -705,7 +705,7 @@ bool EventsRefactorer::SearchStringInActions(Game & game, Scene & scene, vector
return false;
}
bool EventsRefactorer::SearchStringInConditions(Game & game, Scene & scene, vector < Instruction > & conditions, std::string search, bool matchCase)
bool EventsRefactorer::SearchStringInConditions(Game & game, Scene & scene, vector < gd::Instruction > & conditions, std::string search, bool matchCase)
{
if ( !matchCase ) boost::to_upper(search);
+9 -9
View File
@@ -10,7 +10,7 @@ namespace gd {class ExternalEvents; }
namespace gd { class BaseEvent; }
class Game;
class Scene;
class Instruction;
namespace gd { class Instruction; }
class ExternalEvents;
namespace gd {typedef boost::shared_ptr<gd::BaseEvent> BaseEventSPtr;}
@@ -62,7 +62,7 @@ class EventsRefactorer
*
* \return true if something was modified.
*/
static bool RenameObjectInActions(Game & game, Scene & scene, std::vector < Instruction > & instructions, std::string oldName, std::string newName);
static bool RenameObjectInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName);
/**
* Replace all occurences of an object name by another name in a condition
@@ -70,38 +70,38 @@ class EventsRefactorer
*
* \return true if something was modified.
*/
static bool RenameObjectInConditions(Game & game, Scene & scene, std::vector < Instruction > & instructions, std::string oldName, std::string newName);
static bool RenameObjectInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName);
/**
* Remove all conditions of the list using an object
*
* \return true if something was modified.
*/
static bool RemoveObjectInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string name);
static bool RemoveObjectInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string name);
/**
* Remove all actions of the list using an object
*
* \return true if something was modified.
*/
static bool RemoveObjectInActions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string name);
static bool RemoveObjectInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string name);
/**
* Replace all occurences of a string in conditions
*
* \return true if something was modified.
*/
static bool ReplaceStringInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
static bool ReplaceStringInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
/**
* Replace all occurences of a string in actions
*
* \return true if something was modified.
*/
static bool ReplaceStringInActions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
static bool ReplaceStringInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
static bool SearchStringInActions(Game & game, Scene & scene, std::vector < Instruction > & actions, std::string search, bool matchCase);
static bool SearchStringInConditions(Game & game, Scene & scene, std::vector < Instruction > & conditions, std::string search, bool matchCase);
static bool SearchStringInActions(Game & game, Scene & scene, std::vector < gd::Instruction > & actions, std::string search, bool matchCase);
static bool SearchStringInConditions(Game & game, Scene & scene, std::vector < gd::Instruction > & conditions, std::string search, bool matchCase);
/**
* Fill layouts and externalEvents vector with pointers to layouts and external events linked (even indirectly) by the events.
+2 -2
View File
@@ -229,7 +229,7 @@ bool Game_Develop_EditorApp::OnInit()
//Set help file
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
if ( GDpriv::LocaleManager::GetInstance()->locale->GetLanguage() == wxLANGUAGE_ENGLISH )
helpFileAccess->InitWithHelpFile("help.chm");
else if ( GDpriv::LocaleManager::GetInstance()->locale->GetLanguage() == wxLANGUAGE_FRENCH )
@@ -421,7 +421,7 @@ int Game_Develop_EditorApp::OnExit()
clipboard->DestroySingleton();
FontManager * fontManager = FontManager::GetInstance();
fontManager->DestroySingleton();
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DestroySingleton();
#if defined(LINUX) || defined(MAC)
+1 -1
View File
@@ -15,7 +15,7 @@
*/
void Game_Develop_EditorFrame::OnMenuAideSelected( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplayContents();
}
+1 -1
View File
@@ -8,7 +8,7 @@
#include "GDL/Object.h"
#include "GDL/RuntimeGame.h"
#include "GDL/RuntimeScene.h"
#include "GDCore/Events/GDExpression.h"
#include "GDCore/Events/Expression.h"
#ifdef ___WXMSW___
#include "windows.h"
+1 -1
View File
@@ -1228,7 +1228,7 @@ void Preferences::OnInactifColor2PnlRightUp( wxMouseEvent& event )
void Preferences::OnAideBtClick( wxCommandEvent& event )
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplayContents();
}
+2 -2
View File
@@ -705,7 +705,7 @@ void ProjectManager::OnmodVarSceneMenuISelected(wxCommandEvent& event)
return;
}
ChooseVariableDialog dialog(this, (*scene)->GetVariables(), /*editingOnly=*/true);
gd::ChooseVariableDialog dialog(this, (*scene)->GetVariables(), /*editingOnly=*/true);
if ( dialog.ShowModal() == 1 )
{
(*scene)->wasModified = true;
@@ -1062,7 +1062,7 @@ void ProjectManager::OneditGblVarMenuItemSelected(wxCommandEvent& event)
gdTreeItemGameData * data;
if ( !GetGameOfSelectedItem(game, data) ) return;
ChooseVariableDialog dialog(this, game->GetVariables(), /*editingOnly=*/true);
gd::ChooseVariableDialog dialog(this, game->GetVariables(), /*editingOnly=*/true);
if ( dialog.ShowModal() == 1 )
{
for (unsigned int i = 0;i<game->GetLayouts().size();++i)
+1 -1
View File
@@ -395,7 +395,7 @@ void SceneCanvas::OnEditionBtClick( wxCommandEvent & event )
void SceneCanvas::OnHelpBtClick( wxCommandEvent & event )
{
HelpFileAccess::GetInstance()->DisplaySection(12);
gd::HelpFileAccess::GetInstance()->DisplaySection(12);
}
void SceneCanvas::OnLayersEditor( wxCommandEvent & event )
+1 -1
View File
@@ -300,5 +300,5 @@ void SearchEvents::OnpreviousBtClick(wxCommandEvent&)
void SearchEvents::OnhelpBtClick(wxCommandEvent& event)
{
HelpFileAccess::GetInstance()->DisplaySection(58);
gd::HelpFileAccess::GetInstance()->DisplaySection(58);
}
+1 -1
View File
@@ -286,7 +286,7 @@ void StartHerePage::Onrecent9BtClick(wxCommandEvent& event)
void StartHerePage::OnguideBtClick(wxCommandEvent& event)
{
HelpFileAccess * helpFileAccess = HelpFileAccess::GetInstance();
gd::HelpFileAccess * helpFileAccess = gd::HelpFileAccess::GetInstance();
helpFileAccess->DisplaySection(16);
}