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

Additional information can now be specified for levels. #1729

Merged
merged 23 commits into from
Jun 7, 2021
Merged

Additional information can now be specified for levels. #1729

merged 23 commits into from
Jun 7, 2021

Conversation

mrkubax10
Copy link
Member

No description provided.

Copy link
Member

@slackstone slackstone left a comment

Choose a reason for hiding this comment

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

This looks OK to me, seems like a nice addition. I will test the PR on a clean tree build.

@@ -167,6 +167,7 @@ LevelParser::load(const ReaderDocument& doc)
level.get("license", m_level.m_license);
level.get("target-time", m_level.m_target_time);
level.get("suppress-pause-menu", m_level.m_suppress_pause_menu);
level.get("note",m_level.m_note);
Copy link
Member

Choose a reason for hiding this comment

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

add a space

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@@ -182,6 +182,11 @@ LevelIntro::draw(Compositor& compositor)
Statistics::time_to_string(m_level.m_target_time), targetTimeBeaten);
}
}
py+=32;
Copy link
Member

Choose a reason for hiding this comment

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

spaces around operators and in between arguments

Copy link
Member Author

@mrkubax10 mrkubax10 Apr 22, 2021

Choose a reason for hiding this comment

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

updated

Copy link
Member

@Semphriss Semphriss left a comment

Choose a reason for hiding this comment

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

A few more things to change (It seems some unrelated changes slipped in?)

Comment on lines 1186 to 1188
#: src/supertux/levelintro.cpp:187
msgid "Level Note"
msgstr "Informacja o poziome"
Copy link
Member

Choose a reason for hiding this comment

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

Please don't add translations manually, use Transifex instead

Comment on lines 350 to 353
if (m_music_source
&& m_music_source->get_fade_state() != StreamSoundSource::FadingPause)
m_music_source->set_fading(StreamSoundSource::FadingPause, fadetime);
&& m_music_source->get_fade_state() != StreamSoundSource::FadingPause){
m_music_source->set_fading(StreamSoundSource::FadingPause, fadetime);
}
Copy link
Member

Choose a reason for hiding this comment

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

Tab alignment with the closing bracket

Comment on lines 404 to 407
if (m_music_source
&& m_music_source->get_fade_state() != StreamSoundSource::FadingResume)
m_music_source->set_fading(StreamSoundSource::FadingResume, fadetime);
&& m_music_source->get_fade_state() != StreamSoundSource::FadingResume){
m_music_source->set_fading(StreamSoundSource::FadingResume, fadetime);
}
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Why have these lines changes? They don't seem related to the PR...

Comment on lines 129 to 131
if(!m_note.empty()){
writer.write("note",m_note,false);
}
Copy link
Member

Choose a reason for hiding this comment

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

Spacing (before open brackets and after commas)

Comment on lines 186 to 188
if(!m_level.m_note.empty()){
context.color().draw_center_text(Resources::normal_font, _("Level Note")+": "+m_level.m_note, Vector(0,py), LAYER_FOREGROUND1);
}
Copy link
Member

Choose a reason for hiding this comment

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

Spacing (same as above, and around operators)

@@ -34,6 +34,7 @@ EditorLevelMenu::EditorLevelMenu() :
add_textfield(_("Author"), &(level->m_author));
add_textfield(_("Contact"), &(level->m_contact));
add_textfield(_("License"), &(level->m_license));
add_textfield(_("Level Note"),(&level->m_note));
Copy link
Member

Choose a reason for hiding this comment

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

Space after comma

Also, ampersand outside parentheses


Copy link
Member

Choose a reason for hiding this comment

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

No spaces on empty line

@mrkubax10 mrkubax10 requested a review from Semphriss May 23, 2021 15:43
@@ -182,6 +182,11 @@ LevelIntro::draw(Compositor& compositor)
Statistics::time_to_string(m_level.m_target_time), targetTimeBeaten);
}
}
py += 32;
if (!m_level.m_note.empty()) {
context.color().draw_center_text(Resources::normal_font, _("Level Note") + std::string(": ") + m_level.m_note, Vector(0, py), LAYER_FOREGROUND1);
Copy link
Member

Choose a reason for hiding this comment

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

Don't do this. Put Level Note: %s (%s being a placeholder) in one string. Otherwise rtl languages will hate us forever.

I don't know at the top of my head how placeholders work, but you can find other examples in our code.

@mrkubax10 mrkubax10 requested a review from tobbi May 29, 2021 13:22
Copy link
Member

@tobbi tobbi left a comment

Choose a reason for hiding this comment

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

Looking good, from what I can see.

@tobbi tobbi merged commit 90e0345 into SuperTux:master Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants