-
-
Notifications
You must be signed in to change notification settings - Fork 516
Additional information can now be specified for levels. #1729
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
Changes from 5 commits
d38c0e1
43d34cb
fc904f1
be46f4c
ffd98bf
2fac060
85ac65b
2102de5
cae3d3e
6d212b7
8fea9da
0c11d04
293efcd
1970014
71053fa
ee10c77
9889b9e
e1038f3
f658456
36b314e
ad959ca
564a75f
ea23212
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,13 +324,13 @@ SoundManager::play_music(const std::string& filename, float fadetime) | |
if (fadetime > 0) | ||
newmusic->set_fading(StreamSoundSource::FadingOn, fadetime); | ||
newmusic->play(); | ||
|
||
m_music_source = std::move(newmusic); | ||
} catch(std::exception& e) { | ||
log_warning << "Couldn't play music file '" << filename << "': " << e.what() << std::endl; | ||
// When this happens, previous music continued playing, stop it, just in case. | ||
stop_music(0); | ||
} | ||
|
||
} | ||
|
||
void | ||
|
@@ -344,11 +344,13 @@ SoundManager::pause_music(float fadetime) | |
{ | ||
if (m_music_source == nullptr) | ||
return; | ||
|
||
|
||
if (fadetime > 0) { | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Tab alignment with the closing bracket |
||
} else { | ||
m_music_source->pause(); | ||
} | ||
|
@@ -394,13 +396,15 @@ SoundManager::set_sound_volume(int volume) | |
void | ||
SoundManager::resume_music(float fadetime) | ||
{ | ||
|
||
if (m_music_source == nullptr) | ||
return; | ||
|
||
if (fadetime > 0) { | ||
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 commentThe 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... |
||
} else { | ||
m_music_source->resume(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ Level::Level(bool worldmap) : | |
m_filename(), | ||
m_sectors(), | ||
m_stats(), | ||
m_note(), | ||
m_target_time(), | ||
m_tileset("images/tiles.strf"), | ||
m_suppress_pause_menu(), | ||
|
@@ -125,6 +126,9 @@ Level::save(Writer& writer) | |
writer.write("version", 3); | ||
writer.write("name", m_name, true); | ||
writer.write("author", m_author, false); | ||
if(!m_note.empty()){ | ||
writer.write("note",m_note,false); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing (before open brackets and after commas) |
||
if (!m_contact.empty()) { | ||
writer.write("contact", m_contact, false); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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")+": "+m_level.m_note, Vector(0,py), LAYER_FOREGROUND1); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing (same as above, and around operators) |
||
|
||
} | ||
|
||
IntegrationStatus | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Space after comma Also, ampersand outside parentheses |
||
add_file(_("Tileset"), &(level->m_tileset), std::vector<std::string>(1, ".strf"), {}); | ||
|
||
if (!worldmap) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ GameMenu::GameMenu() : | |
}) | ||
{ | ||
Level& level = GameSession::current()->get_current_level(); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No spaces on empty line |
||
add_label(level.m_name); | ||
add_hl(); | ||
add_entry(MNID_CONTINUE, _("Continue")); | ||
|
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