mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:07:43 +00:00
Add output callbacks to NODLib contexts
This commit is contained in:
@@ -210,7 +210,7 @@ struct SpecMP1 : SpecBase
|
||||
|
||||
bool extractFromDisc(NOD::DiscBase&, bool force, FExtractProgress progress)
|
||||
{
|
||||
NOD::ExtractionContext ctx = {false, force, nullptr};
|
||||
NOD::ExtractionContext ctx = {true, force, nullptr};
|
||||
|
||||
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
|
||||
m_pakRouter.build(m_paks, [&progress](float factor)
|
||||
@@ -222,11 +222,14 @@ struct SpecMP1 : SpecBase
|
||||
m_workPath.makeDir();
|
||||
progress(_S("MP1 Root"), _S(""), 3, 0.0);
|
||||
int prog = 0;
|
||||
ctx.progressCB = [&](const std::string& name) {
|
||||
HECL::SystemStringView nameView(name);
|
||||
progress(_S("MP1 Root"), nameView.sys_str().c_str(), 3, prog / (float)m_nonPaks.size());
|
||||
};
|
||||
for (const NOD::DiscBase::IPartition::Node* node : m_nonPaks)
|
||||
{
|
||||
node->extractToDirectory(m_workPath.getAbsolutePath(), ctx);
|
||||
HECL::SystemStringView nameView(node->getName());
|
||||
progress(_S("MP1 Root"), nameView.sys_str().c_str(), 3, prog++ / (float)m_nonPaks.size());
|
||||
prog++;
|
||||
}
|
||||
progress(_S("MP1 Root"), _S(""), 3, 1.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user