MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / loadButtonDefs

Function loadButtonDefs

src/OD2/main.cpp:39–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void loadButtonDefs() {
40 Abyss::Common::Log::info("Loading button definitions...");
41 auto &buttonDefsMap = OD2::Common::ButtonDefManager::getInstance();
42 auto &paletteManager = OD2::Common::PaletteManager::getInstance();
43 auto &soundManager = OD2::Common::SoundManager::getInstance();
44 buttonDefsMap.addButtonDef({
45 .name = "Wide",
46 .resourceName = std::string(OD2::Common::ResourcePaths::UI::WideButtonBlank),
47 .palette = paletteManager.getPalette("Units"),
48 .font = "btntext",
49 .clickSound = soundManager.getSound("cursor_button_click"),
50 .clickableRect = {.x = 6, .y = 1, .w = 259, .h = 32},
51 .segments = {.x = 2, .y = 1},
52 .frames = {.base = 0, .pressed = 1, .disabled = -1},
53 });
54 buttonDefsMap.addButtonDef({
55 .name = "Medium",
56 .resourceName = std::string(OD2::Common::ResourcePaths::UI::MediumButtonBlank),
57 .palette = paletteManager.getPalette("Units"),
58 .font = "btntext",
59 .clickSound = soundManager.getSound("cursor_button_click"),
60 .clickableRect = {.x = 6, .y = 1, .w = 118, .h = 32},
61 .segments = {.x = 1, .y = 1},
62 .frames = {.base = 0, .pressed = 1, .disabled = -1},
63 });
64}
65
66void loadFonts() {
67 const auto addFont = [](const std::string_view fontPath, const std::string &paletteName) -> void {

Callers 1

mainFunction · 0.85

Calls 2

infoFunction · 0.85
addButtonDefMethod · 0.80

Tested by

no test coverage detected