Show the correct number of blocks for multiblock savegames
This commit is contained in:
parent
a98539aa06
commit
bf6814df20
3 changed files with 6 additions and 4 deletions
|
@ -56,8 +56,10 @@ void MainWindow::open_file_from_dialog() {
|
||||||
auto& mc = m_memcards.back();
|
auto& mc = m_memcards.back();
|
||||||
auto& grid = m_grids.back();
|
auto& grid = m_grids.back();
|
||||||
for (int z = 0; z < 15; ++z) {
|
for (int z = 0; z < 15; ++z) {
|
||||||
if (mc[z].has_magic())
|
auto block = mc[z];
|
||||||
grid.emplace_back(duck::make_nana_animation(mc[z], m_icon_size, m_icon_size, m_icon_fps));
|
for (std::size_t n = 0; block.has_magic() and n < block.block_count(); ++n) {
|
||||||
|
grid.emplace_back(duck::make_nana_animation(block, m_icon_size, m_icon_size, m_icon_fps));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(*this)["slots"] << m_grids.back();
|
(*this)["slots"] << m_grids.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
std::vector<uint8_t> icon_palette() const;
|
std::vector<uint8_t> icon_palette() const;
|
||||||
bool has_magic() const;
|
bool has_magic() const;
|
||||||
IconDisplayFlag icon_display_flag() const;
|
IconDisplayFlag icon_display_flag() const;
|
||||||
int block_count() const;
|
std::size_t block_count() const;
|
||||||
std::size_t index() const { return m_index; }
|
std::size_t index() const { return m_index; }
|
||||||
std::string title() const;
|
std::string title() const;
|
||||||
std::size_t available_blocks() const;
|
std::size_t available_blocks() const;
|
||||||
|
|
|
@ -163,7 +163,7 @@ IconDisplayFlag BasicBlock<Const>::icon_display_flag() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool Const>
|
template <bool Const>
|
||||||
int BasicBlock<Const>::block_count() const {
|
std::size_t BasicBlock<Const>::block_count() const {
|
||||||
return frame(0)[3];
|
return frame(0)[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue