Skip to content

Commit

Permalink
Fixed crash in extra checks.
Browse files Browse the repository at this point in the history
Fixed hints (in value section hint will show text, not path)
  • Loading branch information
DronCode committed Jun 9, 2024
1 parent 8e7036b commit da6eb01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 16 additions & 8 deletions BMEdit/Editor/Source/Models/LocalizationTreeModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,25 @@ namespace models

if (role == Qt::ItemDataRole::ToolTipRole)
{
QStringList locationPath {};

auto currentNode = node;
while (currentNode)
if (index.column() == 0)
{
locationPath.push_front(QString::fromStdString(currentNode->name));
const auto& parent = currentNode->parent.lock();
currentNode = parent ? parent.get() : nullptr;
QStringList locationPath {};

auto currentNode = node;
while (currentNode)
{
locationPath.push_front(QString::fromStdString(currentNode->name));
const auto& parent = currentNode->parent.lock();
currentNode = parent ? parent.get() : nullptr;
}

return locationPath.join('/');
}

return locationPath.join('/');
if (index.column() == 1 && (node->type == gamelib::loc::LOCTreeNodeType::LOCALIZED_STRING || node->type == gamelib::loc::LOCTreeNodeType::SUBTITLES))
{
return QString::fromStdString(node->value);
}
}

return {};
Expand Down
7 changes: 0 additions & 7 deletions BMEdit/GameLib/Source/GameLib/LOC/LOCTreeNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ namespace gamelib::loc

// Read subtitle data. I really don't know what that value means, but as 2xu32 each same to each
binaryReader->read<uint8_t, ZBio::Endianness::LE>(&node->subtitle.unkData[0], 8);

// Check that next byte is always valid for us
{
ZBioSeekGuard guard { binaryReader };
auto lb = binaryReader->read<uint8_t, ZBio::Endianness::LE>();
assert((lb >= 'a' && lb <='z') || (lb >= 'A' && lb <= 'Z') || (lb >= '0' && lb <= '9'));
}
}
else if (node->type == LOCTreeNodeType::EMPTY_BLOCK)
{
Expand Down

0 comments on commit da6eb01

Please sign in to comment.