Skip to content

Commit

Permalink
Include empty messages as they may be used
Browse files Browse the repository at this point in the history
Used by messages that have their text in Eventmsg.txt
  • Loading branch information
bvschaik committed Oct 27, 2017
1 parent c448112 commit bfc0af2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions engconverter/src/messageentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ bool MessageEntry::isEmpty() const
if (!m_image.isEmpty() || !m_image2.isEmpty()) {
return false;
}
if (m_dialog.x || m_dialog.y || m_dialog.width || m_dialog.height) {
return false;
}
return m_title.isEmpty() && m_subtitle.isEmpty() && m_video.isEmpty() && m_content.isEmpty();
}

Expand Down
11 changes: 2 additions & 9 deletions engconverter/src/messagefilexmlstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,7 @@ bool MessageFileXmlStream::readMessageEntry(MessageFile &file, QXmlStreamReader
}
readCloseTag(xml, "dialog", logger);

if (!readNextOpenTag(xml, logger)) {
logger.error(QString("Unexpected end of message %1, "
"expected at least one of the following tags: "
"image, title, subtitle, video, content").arg(id));
return false;
}

do {
while (readNextOpenTag(xml, logger)) {
const QString &tag = xml.name().toString();
if (tag == "image" || tag == "image2") {
MessageEntry::Image &image = tag == "image" ? entry.image() : entry.image2();
Expand All @@ -119,7 +112,7 @@ bool MessageFileXmlStream::readMessageEntry(MessageFile &file, QXmlStreamReader
if (!readCloseTag(xml, tag, logger)) {
return false;
}
} while (readNextOpenTag(xml, logger));
};

file.m_entries.append(entry);
return true;
Expand Down

0 comments on commit bfc0af2

Please sign in to comment.