-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
Conversation
There was a problem hiding this 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.
src/supertux/level_parser.cpp
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
src/supertux/levelintro.cpp
Outdated
@@ -182,6 +182,11 @@ LevelIntro::draw(Compositor& compositor) | |||
Statistics::time_to_string(m_level.m_target_time), targetTimeBeaten); | |||
} | |||
} | |||
py+=32; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Changes from original repo
There was a problem hiding this 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?)
data/locale/pl.po
Outdated
#: src/supertux/levelintro.cpp:187 | ||
msgid "Level Note" | ||
msgstr "Informacja o poziome" |
There was a problem hiding this comment.
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
src/audio/sound_manager.cpp
Outdated
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); | ||
} |
There was a problem hiding this comment.
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
src/audio/sound_manager.cpp
Outdated
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); | ||
} |
There was a problem hiding this comment.
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...
src/supertux/level.cpp
Outdated
if(!m_note.empty()){ | ||
writer.write("note",m_note,false); | ||
} |
There was a problem hiding this comment.
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)
src/supertux/levelintro.cpp
Outdated
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); | ||
} |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
src/supertux/menu/game_menu.cpp
Outdated
|
||
There was a problem hiding this comment.
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
Added bonus lightboxes that are on by default (#1683)
src/supertux/levelintro.cpp
Outdated
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
No description provided.