28 if (!visible && published_.empty())
return {};
29 if (visible && revision_ ==
state.revision)
return {};
33 return std::unexpected(
"sequence command queue cannot fit custom-board dialog transition");
35 std::vector<std::shared_ptr<const sequence::SequenceProgram>>
programs;
36 std::array<Rect, 4> buttonRects{};
39 if (!
font || !
font->ready())
return std::unexpected(
"custom-board dialog font runtime is unavailable");
40 const auto resources =
playback.resources();
41 if (!resources || !resources->language() || !resources->language()->catalog)
42 return std::unexpected(
"custom-board dialog language resources are unavailable");
44 desired.push_back({title,100,70,0});
51 const bool selected =
state.selectedIndex >= 0 &&
52 static_cast<std::size_t
>(
state.selectedIndex) ==
state.pageOffset +
slot &&
56 if (!program)
return std::unexpected(program.error().detail);
57 desired.push_back({
id,
static_cast<std::uint16_t
>(100 +
slot),100,100 +
static_cast<int>(
slot) * 68});
60 std::array<data::LegacyBitmapRGBA8, 9>
images{};
64 if (
const auto sized =
font->setSize(10); !
sized)
return std::unexpected(
sized.error().detail);
74 if (!
copied)
return std::unexpected(
copied.error().detail);
77 constexpr std::array<std::uint32_t, 4>
ids{933,932,3170,3169};
78 constexpr std::array<int, 4>
xs{500,600,100,700};
81 const auto text = resources->language()->catalog->message(
ids[
index]);
82 if (!
text)
return std::unexpected(
text.error().detail);
93 if (!textSurfaces_[
index])
99 if (
const auto updated =
playback.runtimeBitmaps().update(*textSurfaces_[
index],std::move(
images[
index])); !updated)
return updated;
102 if (!program)
return std::unexpected(program.error().detail);
105 desired.push_back({*textSurfaces_[
index],
static_cast<std::uint16_t
>(101+
index),152,112+
static_cast<int>(
index)*68});
109 for (
const auto&
object : published_)
111 return std::unexpected(
"validated custom-board dialog stop rejected");
117 return std::unexpected(
"validated custom-board dialog start rejected");
119 published_ = std::move(
desired);
120 revision_ = visible ? std::optional<std::uint64_t>{
state.revision} : std::nullopt;
121 state.buttonRects = buttonRects;