@@ -923,22 +923,29 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
923923 argOutput = GenerateGetBehaviorNameCode (parameter.GetPlainString ());
924924 } else if (metadata.GetType () == " key" ) {
925925 argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
926- } else if (metadata.GetType () == " audioResource" ||
927- metadata.GetType () == " bitmapFontResource" ||
928- metadata.GetType () == " fontResource" ||
929- metadata.GetType () == " imageResource" ||
930- metadata.GetType () == " jsonResource" ||
931- metadata.GetType () == " tilemapResource" ||
932- metadata.GetType () == " tilesetResource" ||
933- metadata.GetType () == " videoResource" ||
934- metadata.GetType () == " model3DResource" ||
935- metadata.GetType () == " atlasResource" ||
936- metadata.GetType () == " spineResource" ||
937- // Deprecated, old parameter names:
938- metadata.GetType () == " password" ||
939- metadata.GetType () == " musicfile" ||
940- metadata.GetType () == " soundfile" ) {
941- argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
926+ } else if (ParameterMetadata::IsExpression (" resource" , metadata.GetType ())) {
927+ const auto &resourceName = parameter.GetPlainString ();
928+ const auto &resourcesContainersList =
929+ GetProjectScopedContainers ().GetResourcesContainersList ();
930+ const auto sourceType =
931+ resourcesContainersList.GetResourcesContainerSourceType (resourceName);
932+ if (sourceType == ResourcesContainer::SourceType::Parameters) {
933+ const auto ¶metersVectorsList =
934+ GetProjectScopedContainers ().GetParametersVectorsList ();
935+ const auto ¶meter =
936+ gd::ParameterMetadataTools::Get (parametersVectorsList, resourceName);
937+ argOutput = GenerateParameterGetterWithoutCasting (parameter);
938+ } else if (sourceType == ResourcesContainer::SourceType::Properties) {
939+ const auto &propertiesContainersList =
940+ GetProjectScopedContainers ().GetPropertiesContainersList ();
941+ const auto &propertiesContainerAndProperty =
942+ propertiesContainersList.Get (resourceName);
943+ argOutput = GeneratePropertyGetterWithoutCasting (
944+ propertiesContainerAndProperty.first ,
945+ propertiesContainerAndProperty.second );
946+ } else {
947+ argOutput = " \" " + ConvertToString (resourceName) + " \" " ;
948+ }
942949 } else if (metadata.GetType () == " mouse" ) {
943950 argOutput = " \" " + ConvertToString (parameter.GetPlainString ()) + " \" " ;
944951 } else if (metadata.GetType () == " yesorno" ) {
0 commit comments