/*------------------------------------------------------------------- Procedure : Test all Conditions.. Input : TRIGGER * Trig Output : nothing -------------------------------------------------------------------*/ void TestAllConditions( TRIGGER * Trig ) { int i,e; TRIGGER * Trig2; CONDITION * Con; for( i = 0 ; i < Trig->NumOfConditions ; i ++ ) { Con = Trig->Conditions[i]; for( e = 0 ; e < Con->NumOfTriggers ; e ++ ) { Trig2 = Con->Triggers[e]; if( !Trig2->Active ) break; } if( e == Con->NumOfTriggers ) { AddCondition( Con ); } } }
void ConditionAttribute::AddConditions(const char *classnames) { strcpy(buffer, classnames); char *p = buffer; char *cur = p; while (p != 0) { p = strchr(p, ' '); if (p != 0) *p = 0; AddCondition(cur); if (!p) break; cur = ++p; } }
void CInputDeviceVariableValueDesc::Copy(CInputDeviceVariableValueDesc* pcSource, CInputDeviceCopyContext* pcContext) { CInputDeviceVariableValueConditionDesc* pcSourceConditionDesc; int i; CInputDeviceVariableValueDesc* pcValueDesc; CInputChordDesc* pcChordDesc; mbInitial = pcSource->mbInitial; for (i = 0; i < pcSource->mapcConditions.NumElements(); i++) { pcSourceConditionDesc = (CInputDeviceVariableValueConditionDesc*)pcSource->mapcConditions.Get(i); if (pcSourceConditionDesc->IsChord()) { pcChordDesc = (CInputChordDesc*)pcContext->mmppChords.Get(((CInputDeviceVariableValueConditionChordDesc*)pcSourceConditionDesc)->mpcChordDesc); AddCondition(pcChordDesc); } else if (pcSourceConditionDesc->IsVariable()) { pcValueDesc = (CInputDeviceVariableValueDesc*)pcContext->mmppValues.Get(((CInputDeviceVariableValueConditionVariableDesc*)pcSourceConditionDesc)->mpcVariableValueDesc); AddCondition(pcValueDesc); } } }
void ParseConfig(FILE* Handle) { condType CondType; char CondVar[MAX_NAME], CondValue[MAX_NAME]; char Token[MAX_NAME]; while(!feof(Handle)) { fscanf(Handle, "%s", Token); if(feof(Handle)) return; CondType=condNULL; CondVar[0]='\0'; CondValue[0]='\0'; if(!strcmp(Token, "Remember")) { fscanf(Handle, "%s", Token); strcpy(RememberedVars.Elements[RememberedVars.Count++].Name, Token); } else { if(!strcmp(Token, "If")) { fscanf(Handle, "%s", Token); if(!strcmp(Token, "Eq")) { fscanf(Handle, "%s", CondVar); ScanValue(Handle, CondValue); fscanf(Handle, "%s", Token); CondType=condEQUAL; } else if(!strcmp(Token, "NotEq")) { fscanf(Handle, "%s", CondVar); ScanValue(Handle, CondValue); fscanf(Handle, "%s", Token); CondType=condDIFFERENT; } else if(Token[0]=='!') { strcpy(CondVar, &Token[1]); fscanf(Handle, "%s", Token); CondType=condFALSE; } else { strcpy(CondVar, Token); fscanf(Handle, "%s", Token); CondType=condTRUE; } } if(!strcmp(Token, "Ignore")) { fscanf(Handle, "%s", Token); AddCondition(CondType, CondVar, CondValue, Token); } else { fprintf(stderr, "Wrong command '%s'\n", Token); exit(1); } } } }
/** * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions. */ 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 GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION(); };
ConditionAttribute::ConditionAttribute(const char *classnames) { AddCondition(classnames); }
void Conditions::add(const Conditions& cdts) { std::for_each(cdts.conditionlist().begin(), cdts.conditionlist().end(), AddCondition(*this)); }
/** * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions. */ Extension() { SetExtensionInformation("AdvancedXML", _("Advanced XML 1.0"), _("Extension allowing to manipulate XML files."), "Victor Levasseur", "Open source (MIT License)"); #if defined(GD_IDE_ONLY) AddAction("NewFile", _("Create an XML document"), _("Create an XML document"), _("Create an XML document into reference _PARAM0_"), _("Advanced XML : Documents"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference (allow to access later to the element)")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::CreateNewDocument").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("LoadFile", _("Load an XML file"), _("Load an XML file."), _("Load XML File _PARAM0_ into reference _PARAM1_"), _("Advanced XML : Documents"), "res/AdvancedXML/AdvancedXMLOpen.png", "res/AdvancedXML/AdvancedXMLOpen16.png") .AddParameter("file", _("Source file")) .AddParameter("string", _("Reference (allow to access later to the element)")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::LoadXmlFile").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("SaveFile", _("Save an XML file"), _("Save an XML file."), _("Save XML file _PARAM1_ into _PARAM0_"), _("Advanced XML : Documents"), "res/AdvancedXML/AdvancedXMLSave.png", "res/AdvancedXML/AdvancedXMLSave16.png") .AddParameter("file", _("File where to save the document")) .AddParameter("string", _("Reference to the XML document")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::SaveXmlFile").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("BrowseTo", _("Load an element into a reference"), _("Load an element (relative to another) in a reference.\nNote: References allows to access to an element using the name of the reference pointing to it."), _("Load path _PARAM2_ (relative to the element _PARAM0_) into reference _PARAM1_"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXMLRef.png", "res/AdvancedXML/AdvancedXMLRef16.png") .AddParameter("string", _("Reference of an existing element ( The path of the element will be relative to this element )")) .AddParameter("string", _("Name of the reference to the newly created element")) .AddParameter("string", _("Path ( tags can be browsed by separating them using /. Use * to go to the first child element without knowing the tag name )")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::BrowseTo").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("NextSibling", _("Go to next element"), _("Create a reference on the element following the specified element.\nNote: The reference will be invalid if there is no valid element following the specified one.Conditions are available to check if an element is valid."), _("Load the element called _PARAM2_ following _PARAM1_ into reference _PARAM0_"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXMLRef.png", "res/AdvancedXML/AdvancedXMLRef16.png") .AddParameter("string", _("Reference to create")) .AddParameter("string", _("Reference to the element preceeding the element to be accessed")) .AddParameter("string", _("Tag name filter "), "", true) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::NextSibling").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddCondition("IsRefValid", _("The reference is valid"), _("Is valid only when the reference is pointing to an existing and valid element."), _("_PARAM0_ exists and is valid"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element to be tested")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::IsRefValid").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddCondition("GetElementType", _("Element type"), _("Test the type of the element.\n(0-> Tag, 1-> Text, 2-> Comment, 3-> XML Document, -1 -> Unknown )"), _("Type of _PARAM0_ _PARAM1__PARAM2_"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element to be tested")) .AddParameter("relationalOperator", _("Comparison sign")) .AddParameter("expression", _("Type")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetRefType").SetManipulatedType("number").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddExpression("GetElementType", _("Element type"), _("Return the type of the element.\n(0-> Tag, 1-> Text, 2-> Comment, 3-> XML Document, -1 -> Unknown )"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Element reference")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetRefType").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("CreateNewElement", _("Create a new element"), _("Create a new element.\nNote: References allows to access to an element using the name of the reference pointing to it."), _("Create a new element of type _PARAM1_ and attach to it the reference _PARAM0_"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXMLAdd.png", "res/AdvancedXML/AdvancedXMLAdd16.png") .AddParameter("string", _("Reference which will be used to access to the element")) .AddParameter("expression", _("Tye of the element to be created\n(0-> Tag, 1-> Text, 2-> Comment )")) .AddParameter("string", _("Text of the element\nIf the element is a tag, it will be the tag name,if the element is a text or a comment, it will be the content.")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::CreateNewElement").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("DeleteAnElement", _("Delete an element"), _("Delete an element (The element will be removed from its parent and will be destroyed)."), _("Delete element _PARAM0_"), _("Advanced XML: General"), "res/AdvancedXML/AdvancedXMLRemove.png", "res/AdvancedXML/AdvancedXMLRemove16.png") .AddParameter("string", _("Reference to the element to be deleted")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::DeleteAnElement").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("InsertElementIntoAnother", _("Add an element inside another"), _("Add an element into another: The element will be a \"child\" of its \"parent\"."), _("Add _PARAM0_ as a child of _PARAM1_ (before _PARAM2_)"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element to be added")) .AddParameter("string", _("Reference to the parent element (must be a Tag element)")) .AddParameter("string", _("The element will be added before this element (if not defined, the element will be added at the end)"), "", true) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::InsertElementIntoAnother").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("SetTagName", _("Change the tag name"), _("Change the tag name"), _("Do _PARAM1__PARAM2_ to the name of tag _PARAM0_"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the Tag element")) .AddParameter("operator", _("Modification sign")) .AddParameter("string", _("Tag name")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::SetText").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h").SetAssociatedGetter("AdvancedXML::GetText").SetManipulatedType("string"); AddStrExpression("GetTagName", _("Tag name"), _("Get the name of a tag"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Element reference")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetText").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("SetContent", _("Change the content of the element"), _("Change the content (text) of the element ( For text and comments elements only )."), _("Do _PARAM1__PARAM2_ to the content of _PARAM0_"), _("Advanced XML : Text and comments"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element")) .AddParameter("operator", _("Modification sign")) .AddParameter("string", _("Contents")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::SetText").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h").SetAssociatedGetter("AdvancedXML::GetText").SetManipulatedType("string"); AddStrExpression("GetContent", _("Contents"), _("Get the content of a text or comment element"), _("Advanced XML : Text and comments"), "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Element reference")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetText").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddExpression("GetAttributeNumber", _("Value of an attribute of an element"), _("Get the value of an attribute of an element"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Element reference")) .AddParameter("string", _("Name of the attribute")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetAttributeNumber").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("SetAttributeNumber", _("Change the value of an attribute"), _("Change the value of an attribute of an element ( which must be a Tag element )."), _("Do _PARAM2__PARAM3_ to the attribute _PARAM1_ of element _PARAM0_"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element")) .AddParameter("string", _("Name of the attribute")) .AddParameter("operator", _("Modification sign")) .AddParameter("expression", _("Value")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::SetAttributeNumber").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h").SetAssociatedGetter("AdvancedXML::GetAttributeNumber").SetManipulatedType("number"); AddStrExpression("GetAttributeString", _("Text of an attribute of an element"), _("Get the text of an attribute of an element"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Element reference")) .AddParameter("string", _("Name of the attribute")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::GetAttributeString").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); AddAction("SetAttributeString", _("Change the text of an attribute"), _("Change the text of an attribute of an element ( which must be a Tag element )."), _("Do _PARAM2__PARAM3_ to the attribute _PARAM1_ of element _PARAM0_"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element")) .AddParameter("string", _("Name of the attribute")) .AddParameter("operator", _("Modification sign")) .AddParameter("string", _("Value")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::SetAttributeString").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h").SetAssociatedGetter("AdvancedXML::GetAttributeString").SetManipulatedType("string"); AddAction("RemoveAttribute", _("Delete an attribute"), _("Delete an attribute from an element ( which must be a Tag element)."), _("Delete attribute _PARAM1_ from the element _PARAM0_"), _("Advanced XML: Tag"), "res/AdvancedXML/AdvancedXML.png", "res/AdvancedXML/AdvancedXML16.png") .AddParameter("string", _("Reference to the element")) .AddParameter("string", _("Name of the attribute")) .AddCodeOnlyParameter("currentScene", "") .codeExtraInformation.SetFunctionName("AdvancedXML::RemoveAttribute").SetIncludeFile("AdvancedXML/src/AdvancedXMLTools.h"); #endif GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION(); };
/** * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions. */ Extension() { SetExtensionInformation("SoundObject", _("Sound object"), _("Extension allowing to use spatialized sounds."), "Thomas Flecy, Victor Levasseur et al.", "Open source (MIT License)"); //Declaration of all objects available { gd::ObjectMetadata & obj = AddObject("Sound", _("Sound"), _("Invisible object emitting a sound which can be moved in the space."), "CppPlatform/Extensions/soundicon32.png", &CreateSoundObject); AddRuntimeObject(obj, "RuntimeSoundObject", CreateRuntimeSoundObject); #if defined(GD_IDE_ONLY) SoundObject::LoadEdittimeIcon(); obj.SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Volume", _("Sound level"), _("Modify the sound level of a Sound object."), _("Do _PARAM1__PARAM2_ to the sound level of _PARAM0_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetVolume").SetManipulatedType("number").SetAssociatedGetter("GetVolume").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Pitch", _("Pitch"), _("Change the pitch of a sound object."), _("Do _PARAM1__PARAM2_ to Pitch of _PARAM0_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetPitch").SetManipulatedType("number").SetAssociatedGetter("GetPitch").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Attenuation", _("Attenuation"), _("Change the attenuation of a sound object."), _("Do _PARAM1__PARAM2_ to the attenuation of _PARAM0_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetAttenuation").SetManipulatedType("number").SetAssociatedGetter("GetAttenuation").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("ZPos", _("Z Position"), _("Modify the sound level of a Sound object."), _("Do _PARAM1__PARAM2_ to the sound level of _PARAM0_"), _("Position"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetZPos").SetManipulatedType("number").SetAssociatedGetter("GetZPos").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Loop", _("Automatic restart"), _("Activate or desactivate the looping of a sound."), _("Activate looping for _PARAM0_: _PARAM1_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("yesorno", _("Loop")) .codeExtraInformation.SetFunctionName("SetLoop").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("RelativeToListener", _("Listener relation"), _("Activate or desactivate the sound spatialisation relative to the listener."), _("Set _PARAM0_ as relative to the listener position: _PARAM1_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("yesorno", _("Relative to the listener")) .codeExtraInformation.SetFunctionName("SetRelativeToListener").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Play", _("Play"), _("Play a sound."), _("Play sound _PARAM0_"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("Play").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Stop", _("Stop"), _("Stop a sound."), _("Stop _PARAM0_"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("Stop").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddAction("Pause", _("Pause"), _("Pause a sound."), _("Pause _PARAM0_"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("Pause").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Volume", _("Sound level"), _("Test the sound level of a Sound object."), _("Th sound level of _PARAM0_ is _PARAM2_ _PARAM1_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetVolume").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Pitch", _("Pitch"), _("Test the pitch value of a sound."), _("Pitch of _PARAM0_ is _PARAM1__PARAM2_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetPitch").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Attenuation", _("Attenuation"), _("Test the attenuation of a sound."), _("The attenuation of _PARAM0_ is _PARAM1__PARAM2_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetAttenuation").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("MinDistance", _("Minimal distance"), _("Test the minimal distance of a sound"), _("The minimal distance of _PARAM0_ is _PARAM1__PARAM2_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetMinDistance").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("ZPos", _("Z Position"), _("Test Z position of a sound."), _("The Z position of _PARAM0_ is _PARAM1__PARAM2_"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetZPos").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Loop", _("Automatic restart"), _("Test if an sound is looping."), _("_PARAM0_ is looping"), _("Parameters"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetLoop").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Playing", _("Being played"), _("Test if a sound is being played."), _("_PARAM0_ is being played"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("IsPlaying").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Paused", _("Paused"), _("A sound is paused"), _("_PARAM0_ is paused"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("IsPaused").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("Stopped", _("Stopped"), _("Test if a sound is stopped."), _("_PARAM0_ is stopped"), "", "res/actions/son24.png", "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("IsStopped").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddCondition("RelativeToListener", _("Listener relation"), _("Test if a sound is relative to the listener."), _("_PARAM0_ is relative to the listener"), _("Parameters"), "res/conditions/son24.png", "res/conditions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("IsRelativeToListener").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddExpression("Volume", _("Sound level"), _("Sound level"), _("Parameters"), "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetVolume").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddExpression("Pitch", _("Pitch"), _("Pitch"), _("Parameters"), "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetPitch").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddExpression("Attenuation", _("Attenuation"), _("Attenuation"), _("Parameters"), "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetAttenuation").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddExpression("MinDistance", _("Minimal distance"), _("Minimal distance"), _("Parameters"), "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetMinDistance").SetIncludeFile("SoundObject/SoundObject.h"); obj.AddExpression("ZPos", _("Z Position"), _("Z Position"), _("Position"), "res/actions/son.png") .AddParameter("object", _("Object"), "Sound", false) .codeExtraInformation.SetFunctionName("GetZPos").SetIncludeFile("SoundObject/SoundObject.h"); #endif } // Actions liées à l'écouteur #if defined(GD_IDE_ONLY) AddAction("ListenerX", _("X position"), _("Modify the X position of the listener."), _("Do _PARAM0__PARAM1_ to the X position of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerX").SetManipulatedType("number").SetAssociatedGetter("GetListenerX").SetIncludeFile("SoundObject/SoundListener.h"); AddAction("ListenerY", _("Y position"), _("Modify the Y position of the listener."), _("Do _PARAM0__PARAM1_ to the Y position of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerY").SetManipulatedType("number").SetAssociatedGetter("GetListenerY").SetIncludeFile("SoundObject/SoundListener.h"); AddAction("ListenerZ", _("Z position"), _("Modify the Z position of the listener."), _("Do _PARAM0__PARAM1_ to the Z position of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerZ").SetManipulatedType("number").SetAssociatedGetter("GetListenerZ").SetIncludeFile("SoundObject/SoundListener.h"); AddAction("ListenerDirectionX", _("Direction on X axis"), _("Change the direction of the listener on X axis."), _("Do _PARAM1__PARAM2_ to the direction on X axis of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerDirectionX").SetManipulatedType("number").SetAssociatedGetter("GetListenerDirectionX").SetIncludeFile("SoundObject/SoundListener.h"); AddAction("ListenerDirectionY", _("Direction on Y axis"), _("Change the direction of the listener on Y axis."), _("Do _PARAM1__PARAM2_ to the direction on Y axis of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerDirectionY").SetManipulatedType("number").SetAssociatedGetter("GetListenerDirectionY").SetIncludeFile("SoundObject/SoundListener.h"); AddAction("ListenerDirectionZ", _("Direction on Z axis"), _("Change the direction of the listener on Z axis."), _("Do _PARAM1__PARAM2_ to the direction on Z axis of the listener"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("operator", _("Modification's sign")) .AddParameter("expression", _("Value")) .codeExtraInformation.SetFunctionName("SetListenerDirectionZ").SetManipulatedType("number").SetAssociatedGetter("GetListenerDirectionZ").SetIncludeFile("SoundObject/SoundListener.h"); // Conditions liées à l'écouteur AddCondition("ListenerX", _("X position"), _("Test the position of the listener on X axis."), _("The listener X position is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerX").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddCondition("ListenerY", _("Y position"), _("Test the position of the listener on Y axis."), _("The listener Y position is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerY").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddCondition("ListenerZ", _("Z position"), _("Test the position of the listener on Z axis."), _("The listener Z position is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerZ").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddCondition("ListenerDirectionX", _("X direction"), _("Test the direction of the listener on X axis."), _("The listener X direction is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerDirectionX").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddCondition("ListenerDirectionY", _("Y direction"), _("Test the direction of the listener on Y axis."), _("The listener Y direction is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerDirectionY").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddCondition("ListenerDirectionZ", _("Z direction"), _("Test the direction of the listener on Z axis."), _("The listener Z direction is _PARAM1__PARAM0_"), _("Listener"), "res/actions/son24.png", "res/actions/son.png") .AddParameter("relationalOperator", _("Sign of the test")) .AddParameter("expression", _("Value to test")) .codeExtraInformation.SetFunctionName("GetListenerDirectionZ").SetManipulatedType("number").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerX", _("X position"), _("Listener X position"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerX").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerY", _("Y position"), _("Listener Y position"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerY").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerZ", _("Z position"), _("Listener Z position"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerZ").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerDirectionX", _("Direction on X axis"), _("Listener x direction"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerDirectionX").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerDirectionY", _("Direction on Y axis"), _("Listener y direction"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerDirectionY").SetIncludeFile("SoundObject/SoundListener.h"); AddExpression("ListenerDirectionZ", _("Direction on Z axis"), _("Listener z direction"), _("Listener"), "res/actions/son.png") .codeExtraInformation.SetFunctionName("GetListenerDirectionZ").SetIncludeFile("SoundObject/SoundListener.h"); #endif GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION(); };
/** * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions. */ 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) 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 GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION(); };
void EventSheetEditor::OnLButtonDown(UINT nFlags, CPoint pt) { if (!(pt.x >= m_pHeader->m_Split - 2 && pt.x <= m_pHeader->m_Split + 5)) { CEditorEvent* pEvent = EventAt(pt); if(pEvent) { if(pEvent->canAddActions()) { if(pEvent->mouseOverNewAction) { AddAction(pEvent, -1); return; } if(pEvent->mouseOverFooter) { AddCondition(false, NULL, true, pEvent); return; } } } } if(KillFocusOnInlineEditor()) return; m_ActionTooltip.Hide(); CEditorEvent* pMyEventParent = NULL; CEditorEvent* pMyEvent = EventAt(pt, &pMyEventParent); m_leftDown = true; //if(m_pHeader->m_rect.PtInRect(pt)) if(pt.x >= m_pHeader->m_Split - 2 && pt.x <= m_pHeader->m_Split + 5) { m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); m_ActionTooltip.Hide(); m_pHeader->OnLeftClick(pt); if(m_pHeader->m_isDrag) { SetCapture(); } else // basically just if we arn't doing something interesting in the header... { if(!m_CtrlDown) { DeselectEvents(); DeselectActions(); DeselectConditions(); } } for(int a = 0; a < m_pHeader->m_Objects.size(); a ++ ) { if(m_pHeader->m_Objects.at(a).m_rect.PtInRect(pt)) { m_Drag.dragtype = OBJECT; m_Drag.StoredPos = pt; m_Drag.CtrlDown = false; } } } else if(pMyEvent) { if(pMyEvent->PtInOnOffButton(pt, this)) { // The user is clicked the + button pMyEvent->m_open(this) = pMyEvent->m_open(this) ? false:true; Invalidate(); } else { /////////////// // Select Condition CEditorCondition* pMyCondition = pMyEvent->conditionAt(pt, this); if(pMyCondition) { // find index int index = 0; for(int a = 0; a < pMyEvent->m_Conditions.size() ; a ++ ) if(pMyEvent->m_Conditions[a] == pMyCondition) index = a; //Deselect selected events or actions DeselectEvents(); DeselectActions(); // Now the conditions if(pMyCondition->m_select(this)) // if we clicked on something already selected...wait till release m_ClickedSelectedCondition = true; else { if(!m_CtrlDown) { DeselectConditions(); } pMyCondition->m_select(this) = true; InvalidateRect(pMyCondition->m_rect(this)); } if( m_ShiftDown && m_FocusCondition) { bool b1 = false, b2 = false, b3 = false; RecursiveSelect(NULL, m_FocusCondition,NULL ,NULL ,pMyCondition ,NULL,b1,b2,b3, this->m_pEventList); } m_FocusCondition = pMyCondition; m_FocusEvent = pMyEvent; if(m_CtrlDown) { m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); } else { if(m_ClickedSelectedCondition) { CPoint point = pMyCondition->m_rect(this).TopLeft(); point.x = pt.x - 50; point.y -= 19; if(pMyEvent->m_displayConditionType(this) == 1) { point.y += 19; point.x = pMyCondition->m_rect(this).TopLeft().x - 100; } m_InsertBefore.ShowAt(point, pMyCondition, *this); m_InsertBefore.pEventEditor = (EventSheetEditor*)(this); point.y += 19 + pMyCondition->m_rect(this).Height(); if(pMyEvent->m_displayConditionType(this) == 1) { point.y -= 19 + pMyCondition->m_rect(this).Height(); point.x = pMyCondition->m_rect(this).right; } m_InsertAfter.ShowAt(point, pMyCondition, *this); m_InsertAfter.pEventEditor = (EventSheetEditor*)(this); m_InsertAfter.m_pInsertEventSpot = m_InsertBefore.m_pInsertEventSpot = pMyEvent; m_InsertAfter.m_InsertType = m_InsertBefore.m_InsertType = CONDITION; m_InsertAfter.m_InsertIndex = m_InsertBefore.m_InsertIndex = index; m_InsertAfter.m_IsAfter = true; m_InsertBefore.m_IsAfter = false; m_ActionTooltip.Hide(); } } // We may be wanting to drag these conditions... m_Drag.dragtype = CONDITION; m_Drag.StoredPos = pt; m_Drag.IsDragging = false; } else { ///////////////////// // Select Action SelectedActionVector actions; CEditorAction* pMyAction = pMyEvent->actionAt(pt, actions, this); if(pMyAction) { int index = 0; for(int a = 0; a < pMyEvent->m_Actions.size() ; a ++ ) if (pMyEvent->m_Actions[a] == pMyAction) index = a; //Deselect selected events or conditions DeselectEvents(); DeselectConditions(); if(pMyAction->m_select(this)) // if we clicked on something already selected...wait till release m_ClickedSelectedAction = true; else { if(!m_CtrlDown) { DeselectActions(); } pMyAction->m_select(this) = true; InvalidateRect(pMyAction->m_rect(this)); } if( m_ShiftDown && m_FocusAction) { bool b1 = false, b2 = false, b3 = false; RecursiveSelect(m_FocusAction,NULL ,NULL ,pMyAction , NULL ,NULL,b1,b2,b3, this->m_pEventList); } m_FocusAction = pMyAction; m_FocusEvent = pMyEvent; // We may be wanting to drag these conditions... m_Drag.dragtype = ACTION; m_Drag.StoredPos = pt; m_Drag.IsDragging = false; if(m_CtrlDown) { m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); } else { if(m_ClickedSelectedAction) { CPoint point = pMyAction->m_rect(this).TopLeft(); point.x = pt.x - 50; point.y -= 19; if(pMyEvent->m_displayActionType(this) == 1) { point.y += 19; point.x = pMyAction->m_rect(this).TopLeft().x - 100; } m_InsertBefore.ShowAt(point, pMyAction, *this); m_InsertBefore.pEventEditor = (EventSheetEditor*)(this); point.y += 19 + pMyAction->m_rect(this).Height(); if(pMyEvent->m_displayActionType(this) == 1) { point.y -= 19 + pMyAction->m_rect(this).Height(); point.x = pMyAction->m_rect(this).right; } m_InsertAfter.ShowAt(point, pMyCondition, *this); m_InsertAfter.pEventEditor = (EventSheetEditor*)(this); m_InsertAfter.m_pInsertEventSpot = m_InsertBefore.m_pInsertEventSpot = pMyEvent; m_InsertAfter.m_InsertType = m_InsertBefore.m_InsertType = ACTION; m_InsertAfter.m_InsertIndex = m_InsertBefore.m_InsertIndex = index; m_InsertAfter.m_IsAfter = true; m_InsertBefore.m_IsAfter = false; m_ActionTooltip.Hide(); } } } ///////////////////// // Select Event else if(pMyEvent->m_handle(this).PtInRect(pt)) { //Deselect selected actions or conditions DeselectActions(); DeselectConditions(); m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); m_ActionTooltip.Hide(); // Now select the events if(pMyEvent->m_select(this)) // if we clicked on something already selected...wait till release m_ClickedSelectedEvent = true; else { // User is clicking on an event if(!m_CtrlDown) { DeselectEvents(); } pMyEvent->Select(true, this); InvalidateRect(pMyEvent->m_rect(this)); } if( m_ShiftDown && m_FocusEvent) { bool b1 = false, b2 = false, b3 = false; RecursiveSelect(NULL, NULL, m_FocusEvent, NULL,NULL, pMyEvent,b1,b2,b3, this->m_pEventList); } m_FocusEvent = pMyEvent; // We may be wanting to drag these events... m_Drag.dragtype = EVENT; m_Drag.StoredPos = pt; m_Drag.IsDragging = false; if(pt.x > this->m_pHeader->m_Split) //prevent dragging events unless the mouse is in condition column m_Drag.dragtype = -1; if(m_CtrlDown) { m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); } else { if(m_ClickedSelectedEvent) { // find index int index = 0; FindEventListEventExistsIn(pMyEvent, m_pEventList, index); CPoint point = pMyEvent->m_rect(this).TopLeft(); point.x += 24; point.y -= 20; m_InsertBefore.ShowAt(point, pMyEvent, *this); m_InsertBefore.pEventEditor = (EventSheetEditor*)(this); point.y += 20 + pMyEvent->m_rect(this).Height(); m_InsertAfter.ShowAt(point, pMyEvent, *this); m_InsertAfter.pEventEditor = (EventSheetEditor*)(this); point.x += 101; if(pMyEvent->canAddEvents()) { m_InsertSub.ShowAt(point, pMyEvent, *this); m_InsertSub.pEventEditor = (EventSheetEditor*)(this); } m_InsertAfter.m_pInsertEventSpot = m_InsertBefore.m_pInsertEventSpot = pMyEventParent; m_InsertSub.m_pInsertEventSpot = pMyEvent; m_InsertAfter.m_InsertType = m_InsertBefore.m_InsertType = m_InsertSub.m_InsertType = EVENT; m_InsertAfter.m_InsertIndex = m_InsertBefore.m_InsertIndex = m_InsertSub.m_InsertIndex = index; m_InsertAfter.m_IsAfter = true; m_InsertBefore.m_IsAfter = false; m_InsertSub.m_IsAfter = true; m_InsertSub.m_IsSub = true; m_ActionTooltip.Hide(); } } } else { if(!m_CtrlDown) { DeselectEvents(); DeselectActions(); DeselectConditions(); } } } } } else { if(!m_CtrlDown) { DeselectActions(); DeselectConditions(); DeselectEvents(); m_InsertAfter.Hide(); m_InsertBefore.Hide(); m_InsertSub.Hide(); m_ActionTooltip.Hide(); } } CScrollView::OnLButtonDown(nFlags, pt); }