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

Class MainMenu

src/OD2/Scenes/MainMenu/MainMenu.h:24–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24class MainMenu final : public Abyss::Common::Scene {
25 ScreenMode _screenMode = ScreenMode::TradeMark;
26 static int playedIntroVideos;
27
28 Abyss::DataTypes::DC6 _background = Abyss::DataTypes::DC6(Common::ResourcePaths::MainMenu::GameSelectScreen, Common::GetPalette("Sky"));
29 Abyss::DataTypes::DC6 _trademarkBackground = Abyss::DataTypes::DC6(Common::ResourcePaths::MainMenu::TrademarkScreen, Common::GetPalette("Sky"));
30 Logo _d2Logo;
31
32 Abyss::UI::Label _lblCredits = {Common::GetFont("fontformal10"),
33 {0xff, 0xff, 0x8c, 0xff},
34 "OpenDiablo2 is neither developed by, nor endorsed by Blizzard or its parent company Activision/Blizzard/Microsoft"};
35
36 void onSinglePlayerClicked();
37 void onMultiplayerClicked();
38 void onCreditsClicked();
39 auto onExitClicked() -> void;
40 void playMainThemeMusic();
41
42 Abyss::UI::Button<Abyss::DataTypes::DC6> _btnSinglePlayer = Common::CreateButton("Wide", "SINGLE PLAYER", [this] { onSinglePlayerClicked(); });
43 Abyss::UI::Button<Abyss::DataTypes::DC6> _btnMultiPlayer = Common::CreateButton("Wide", "MULTIPLAYER", [this] { onMultiplayerClicked(); });
44 Abyss::UI::Button<Abyss::DataTypes::DC6> _btnCredits = Common::CreateButton("Wide", "CREDITS", [this] { onCreditsClicked(); });
45 Abyss::UI::Button<Abyss::DataTypes::DC6> _btnMapTest =
46 Common::CreateButton("Wide", "MAP TEST", [] { Abyss::AbyssEngine::getInstance().setScene(std::make_unique<Scenes::MapTest::MapTest>()); });
47 Abyss::UI::Button<Abyss::DataTypes::DC6> _btnExit = Common::CreateButton("Wide", "EXIT DIABLO II", [this] { onExitClicked(); });
48
49 public:
50 MainMenu();
51 void update(std::chrono::duration<double> deltaTime) override;
52 void processEvent(const SDL_Event &event) override;
53 void renderTrademark();
54 void renderMainMenu();
55 void render() override;
56};
57
58} // namespace OD2::Scenes::MainMenu

Callers

nothing calls this directly

Calls 3

DC6Class · 0.85
CreateButtonFunction · 0.85
setSceneMethod · 0.80

Tested by

no test coverage detected