Skip to content

Commit

Permalink
[codemod] Adapt sentences of action/conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
4ian committed Dec 27, 2019
1 parent 5df3afd commit 2f8840b
Show file tree
Hide file tree
Showing 28 changed files with 760 additions and 1,428 deletions.
118 changes: 41 additions & 77 deletions Core/GDCore/Extensions/Builtin/AudioExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,117 +143,97 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Volume of the sound on a channel"),
_("This action modifies the volume of the sound on the "
"specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the sound on channel "
"_PARAM1_"),
_("the volume of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/sonVolume24.png",
"res/actions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("ModVolumeMusicCanal",
_("Volume of the music on a channel"),
_("This action modifies the volume of the music on the "
"specified channel. The volume is between 0 and 100."),
_("Do _PARAM2__PARAM3_ to the volume of the music on channel "
"_PARAM1_"),
_("the volume of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/musicVolume24.png",
"res/actions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("ModGlobalVolume",
_("Game global volume"),
_("This action modifies the global volume of the game. The "
"volume is between 0 and 100."),
_("Do _PARAM1__PARAM2_ to global sound level"),
_("the global sound level"),
_("Audio"),
"res/actions/volume24.png",
"res/actions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsSimple()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsSimple();

extension
.AddAction("ModPitchSoundChannel",
_("Pitch of the sound of a channel"),
_("This action modifies the pitch (speed) of the sound on a "
"channel.\n1 is the default pitch."),
_("Do _PARAM2__PARAM3_ to the pitch of the sound on channel "
"_PARAM1_"),
_("the pitch of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("ModPitchMusicChannel",
_("Pitch of the music on a channel"),
_("This action modifies the pitch of the music on the "
"specified channel. 1 is the default pitch"),
_("Do _PARAM2__PARAM3_ to the pitch of the music on channel "
"_PARAM1_"),
_("the pitch of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("ModPlayingOffsetSoundChannel",
_("Playing offset of the sound on a channel"),
_("This action modifies the playing offset of the sound on a "
"channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the sound on "
"channel _PARAM1_"),
_("the playing offset of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/actions/son24.png",
"res/actions/son.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("ModPlayingOffsetMusicChannel",
_("Playing offset of the music on a channel"),
_("This action modifies the playing offset of the music on "
"the specified channel"),
_("Do _PARAM2__PARAM3_ to the playing offset of the music on "
"channel _PARAM1_"),
_("the playing offset of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/actions/music24.png",
"res/actions/music.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddAction("PlaySound",
Expand Down Expand Up @@ -373,115 +353,99 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
_("Volume of the sound on a channel"),
_("Test the volume of the sound on the specified channel. The volume "
"is between 0 and 100."),
_("The volume of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("the volume of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddCondition(
"MusicCanalVolume",
_("Volume of the music on a channel"),
_("Test the volume of the music on a specified channel. The volume "
"is between 0 and 100."),
_("The volume of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("the volume of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddCondition(
"GlobalVolume",
_("Global volume"),
_("Test the global sound level. The volume is between 0 and 100."),
_("The global game volume is _PARAM1__PARAM2_"),
_("the global game volume"),
_("Audio"),
"res/conditions/volume24.png",
"res/conditions/volume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Volume to test"))
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number");

extension
.AddCondition(
"SoundChannelPitch",
_("Pitch of the sound of a channel"),
_("Test the pitch of the sound on the specified channel. 1 is the "
"default pitch."),
_("The pitch of the sound on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("the pitch of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddCondition(
"MusicChannelPitch",
_("Pitch of the music on a channel"),
_("Test the pitch (speed) of the music on a specified channel. 1 is "
"the default pitch."),
_("The pitch of the music on channel _PARAM1_ is _PARAM2__PARAM3_"),
_("the pitch of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Pitch to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddCondition(
"SoundChannelPlayingOffset",
_("Playing offset of the sound on a channel"),
_("Test the playing offset of the sound on the specified channel."),
_("The playing offset of the sound on channel _PARAM1_ is "
"_PARAM2__PARAM3_"),
_("the playing offset of the sound on channel _PARAM1_"),
_("Audio/Sounds on channels"),
"res/conditions/sonVolume24.png",
"res/conditions/sonVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddCondition(
"MusicChannelPlayingOffset",
_("Playing offset of the music on a channel"),
_("Test the playing offset of the music on the specified channel."),
_("The playing offset of the music on channel _PARAM1_ is "
"_PARAM2__PARAM3_"),
_("the playing offset of the music on channel _PARAM1_"),
_("Audio/Music on channels"),
"res/conditions/musicVolume24.png",
"res/conditions/musicVolume.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("expression", _("Channel identifier"))
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Playing position (in seconds)"))
.MarkAsAdvanced()
.SetManipulatedType("number");
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();

extension
.AddExpression("SoundChannelPlayingOffset",
Expand Down
Loading

8 comments on commit 2f8840b

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at my video extension, and your commit has put a lot of descriptions in bulk!

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One case for example:
_("Do _PARAM1__PARAM2_ to the volume of _PARAM0_"),
go to
_("the volume"),
There are lot of cases like this one.

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will open a PR for recover all these issues.

@4ian
Copy link
Owner Author

@4ian 4ian commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bouh Weird, useStandardRelationalOperatorParameters should make the proper sentences..

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no useStandardRelationalOperatorParameters on actions with an getter in JS extensions.

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if i set useStandardRelationalOperatorParameters nothing happend.

This doesn't work:

object
      .addAction(
        "SetVolume",
        _("Set volume"),
        _(
          "Set the volume of the video object, between 0 (muted) and 100 (maximum)."
        ),
        _("the volume"),
        "",
        "JsPlatform/Extensions/videoicon24.png",
        "JsPlatform/Extensions/videoicon16.png"
      )
      .addParameter("object", _("Video object"), "VideoObject", false)
      .useStandardRelationalOperatorParameters("number")
      .getCodeExtraInformation()
      .setFunctionName("setVolume")
      .setGetter("getVolume");

image

@4ian
Copy link
Owner Author

@4ian 4ian commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For actions, use useStandardOperatorParameters

@Bouh
Copy link
Collaborator

@Bouh Bouh commented on 2f8840b Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK good for useStandardOperatorParameters This add "Change" at the start of sentence. 👍
Working, i will fix that, thank you!

EDIT: Fix here #1552

Please sign in to comment.