Skip to content

Infotab

Using Infotab SDK

WARNING

Before using the SDK you need to instantiate it using sdk_init::infotab() - example provided on this page

Adding an Infotab Display Entry

uint32_t sdk::infotab->add_text( const infotab_sdk::text_entry& title, const std::function< infotab_sdk::text_entry() >& fn )

WARNING

This function should only be used in PluginLoad
You must call sdk::infotab->remove_text on PluginUnload using the ID returned by this function

Example

cpp
infotab_id = sdk::infotab->add_text( { "Test" }, [ ]() -> infotab_sdk::text_entry
{
    infotab_sdk::text_entry entry{};

    entry.text = "HEY";
    entry.color = 0xFFFF0000;

    return entry;
} );
infotab_id = sdk::infotab->add_text( { "Test" }, [ ]() -> infotab_sdk::text_entry
{
    infotab_sdk::text_entry entry{};

    entry.text = "HEY";
    entry.color = 0xFFFF0000;

    return entry;
} );

Adding an Infotab Hotkey Entry

uint32_t sdk::infotab->add_hotkey_text( std::string* hotkey, const infotab_sdk::text_entry& title, const std::function< infotab_sdk::text_entry() >& fn );

WARNING

This function should only be used in PluginLoad
You must call sdk::infotab->remove_text on PluginUnload using the ID returned by this function

Example

cpp
infotab_id = sdk::infotab->add_text( orb::spell_farm_key, { "Spellfarm" }, [ ]() -> infotab_sdk::text_entry
{
    infotab_sdk::text_entry entry{};

    if( orb::allow_spell_farm )
    {
        entry.text = "ON";
        entry.color = 0xFF00FF00;
    }
    else
    {
        entry.text = "OFF";
        entry.color = 0xFFFF0000;
    }

    return entry;
} );
infotab_id = sdk::infotab->add_text( orb::spell_farm_key, { "Spellfarm" }, [ ]() -> infotab_sdk::text_entry
{
    infotab_sdk::text_entry entry{};

    if( orb::allow_spell_farm )
    {
        entry.text = "ON";
        entry.color = 0xFF00FF00;
    }
    else
    {
        entry.text = "OFF";
        entry.color = 0xFFFF0000;
    }

    return entry;
} );

Removing an Infotab Entry

void sdk::infotab->remove_text( uint32_t id )

WARNING

This function should only be used in PluginUnload
The id argument must be the one that returned from the sdk::infotab->add_text function

Example

cpp
extern "C" __declspec(dllexport) void __fastcall PluginUnload()
{
    sdk::infotab->remove_text( infotab_id );
}
extern "C" __declspec(dllexport) void __fastcall PluginUnload()
{
    sdk::infotab->remove_text( infotab_id );
}