Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Listener2D/Listener3D to AudioListener2D/AudioListener3D #52751

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

Rubonnek
Copy link
Member

@Rubonnek Rubonnek commented Sep 16, 2021

Closes:

This PR was achieved by running the following shell script in Linux at the root of the repository:

# Rename Class
rg -l Listener2D | xargs sed -e 's/Listener2D/AudioListener2D/g' -i
rg -l Listener3D | xargs sed -e 's/Listener3D/AudioListener3D/g' -i

# Rename variables and functions
rg -l listener_3d | xargs sed -e 's/listener_3d/audio_listener_3d/g' -i
rg -l listener_2d | xargs sed -e 's/listener_2d/audio_listener_2d/g' -i

# Fix the viewport boolean variables for clarity (and avoid duplicate definitions after the last substitution)
sed -e 's/\<audio_audio_listener_2d\>/is_audio_listener_2d_enabled/g' -i scene/main/viewport.h scene/main/viewport.cpp
sed -e 's/\<audio_audio_listener_3d\>/is_audio_listener_3d_enabled/g' -i scene/main/viewport.h scene/main/viewport.cpp

# Rename files
git mv scene/2d/listener_2d.h scene/2d/audio_listener_2d.h
git mv scene/2d/listener_2d.cpp scene/2d/audio_listener_2d.cpp

git mv scene/3d/listener_3d.h scene/3d/audio_listener_3d.h
git mv scene/3d/listener_3d.cpp scene/3d/audio_listener_3d.cpp

git mv doc/classes/Listener2D.xml doc/classes/AudioListener2D.xml
git mv doc/classes/Listener3D.xml doc/classes/AudioListener3D.xml

git mv editor/icons/GizmoListener3D.svg editor/icons/GizmoAudioListener3D.svg
git mv editor/icons/Listener2D.svg editor/icons/AudioListener2D.svg
git mv editor/icons/Listener3D.svg editor/icons/AudioListener3D.svg

# Clear the remaining duplicated audio keywords
rg -l audio_audio | xargs sed -e 's/audio_audio/audio/g' -i

# Drop changes to translations
git checkout doc/translations/

and clang-format should take care of the rest.

I'm not sure if I missed anything else that needed renaming, but that doesn't seem to be the case.

@Rubonnek Rubonnek requested review from a team as code owners September 16, 2021 19:33
@Rubonnek Rubonnek changed the title Renamed Listener2D/Listener3D to AudioListener2D/AudioListener3D Rename Listener2D/Listener3D to AudioListener2D/AudioListener3D Sep 16, 2021
@KoBeWi KoBeWi added this to the 4.0 milestone Sep 16, 2021
@AaronRecord
Copy link
Contributor

AaronRecord commented Sep 16, 2021

Do the translation files (.po) need to be updated?

@Rubonnek
Copy link
Member Author

Rubonnek commented Sep 16, 2021

Looks like there's only one msgid that contains references to Listener2D and Listener3D that needs to be updated.
Here it is:

msgid ""
"Returns [code]true[/code] if the listener was made current using [method "
"make_current], [code]false[/code] otherwise.\n"
"[b]Note:[/b] There may be more than one Listener3D marked as \"current\" in "
"the scene tree, but only the one that was made current last will be used."

Outside of that, the rest of the references are located within comments:

#: doc/classes/Listener3D.xml

Are any of these changes undesired?

@akien-mga
Copy link
Member

It's better not to update the translations, I do that myself.

@Rubonnek
Copy link
Member Author

Changes to translations dropped.

@akien-mga akien-mga merged commit 5ebc5a7 into godotengine:master Sep 17, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants