MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / SongbookInterface

Method SongbookInterface

source/frontend/StarSongbookInterface.cpp:14–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12String const SongPathPrefix = "/songs/";
13
14SongbookInterface::SongbookInterface(PlayerPtr player) {
15 m_player = std::move(player);
16
17 auto assets = Root::singleton().assets();
18
19 GuiReader reader;
20
21 reader.registerCallback("close", [=](Widget*) { dismiss(); });
22 reader.registerCallback("btnPlay",
23 [=](Widget*) {
24 if (play())
25 dismiss();
26 });
27 reader.registerCallback("group", [=](Widget*) {});
28 reader.registerCallback("search", [=](Widget*) {});
29
30 reader.construct(assets->json("/interface/windowconfig/songbook.config:paneLayout"), this);
31
32 Root::singleton().registerReloadListener(
33 m_reloadListener = make_shared<CallbackListener>([this]() {
34 refresh(true);
35 })
36 );
37
38 refresh(true);
39}
40
41void SongbookInterface::update(float dt) {
42 Pane::update(dt);

Callers

nothing calls this directly

Calls 6

singletonClass · 0.85
assetsMethod · 0.80
jsonMethod · 0.80
registerCallbackMethod · 0.45
constructMethod · 0.45

Tested by

no test coverage detected