dao::options::Button

struct

A button in a plugin’s section, like the screen’s own Restore Defaults.

pressed runs on the game thread (dao/Frame.h) each time the player clicks the button, so it may call script commands. The screen stays open.

dao::options::AddSection(L"Multiplayer", {}, {}, dao::options::Column::Either,
                         dao::options::Tab::Online, {{
    .name = L"MultiplayerHost",
    .label = L"Host a game",
    .tooltip = L"Lets a friend join this game",
    .pressed = [] { Host(); },
}});

Declared in dao/Options.h.

Fields

Field Type  
label std::wstring the text on the button
name std::wstring the button’s name, as for a Toggle
pressed std::function<void()> runs at a click; required
tooltip std::wstring the text shown when the mouse is over the button