@@ -898,22 +898,29 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
898898 argOutput = GenerateGetBehaviorNameCode (parameter.GetPlainString ());
899899 } else if (metadata.GetType () == " key" ) {
900900 argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
901- } else if (metadata.GetType () == " audioResource" ||
902- metadata.GetType () == " bitmapFontResource" ||
903- metadata.GetType () == " fontResource" ||
904- metadata.GetType () == " imageResource" ||
905- metadata.GetType () == " jsonResource" ||
906- metadata.GetType () == " tilemapResource" ||
907- metadata.GetType () == " tilesetResource" ||
908- metadata.GetType () == " videoResource" ||
909- metadata.GetType () == " model3DResource" ||
910- metadata.GetType () == " atlasResource" ||
911- metadata.GetType () == " spineResource" ||
912- // Deprecated, old parameter names:
913- metadata.GetType () == " password" ||
914- metadata.GetType () == " musicfile" ||
915- metadata.GetType () == " soundfile" ) {
916- argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
901+ } else if (ParameterMetadata::IsExpression (" resource" , metadata.GetType ())) {
902+ const auto &resourceName = parameter.GetPlainString ();
903+ const auto &resourcesContainersList =
904+ GetProjectScopedContainers ().GetResourcesContainersList ();
905+ const auto sourceType =
906+ resourcesContainersList.GetResourcesContainerSourceType (resourceName);
907+ if (sourceType == ResourcesContainer::SourceType::Properties) {
908+ const auto & propertiesContainersList =
909+ GetProjectScopedContainers ().GetPropertiesContainersList ();
910+ const auto & propertiesContainerAndProperty =
911+ propertiesContainersList.Get (resourceName);
912+ argOutput = GeneratePropertyGetterWithoutCasting (
913+ propertiesContainerAndProperty.first ,
914+ propertiesContainerAndProperty.second );
915+ } else if (sourceType == ResourcesContainer::SourceType::Parameters) {
916+ const auto & parametersVectorsList =
917+ GetProjectScopedContainers ().GetParametersVectorsList ();
918+ const auto & parameter =
919+ gd::ParameterMetadataTools::Get (parametersVectorsList, resourceName);
920+ argOutput = GenerateParameterGetterWithoutCasting (parameter);
921+ } else {
922+ argOutput = " \" " + ConvertToString (resourceName) + " \" " ;
923+ }
917924 } else if (metadata.GetType () == " mouse" ) {
918925 argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
919926 } else if (metadata.GetType () == " yesorno" ) {
0 commit comments