Add motorcycle club, too. (#3013)

* Refactor add_callback_for_labels to take an initializer_list.
This commit is contained in:
gir489 2024-04-30 17:17:59 -04:00 committed by GitHub
parent ffcd789209
commit 53e6530d66
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ namespace big
custom_text_service::custom_text_service() custom_text_service::custom_text_service()
{ {
add_callback_for_labels({"RESPAWN_W"_J, "RESPAWN_W_MP"_J}, respawn_label_callback); add_callback_for_labels({"RESPAWN_W"_J, "RESPAWN_W_MP"_J}, respawn_label_callback);
add_callback_for_labels({"FMMC_KEY_TIP15"_J}, do_ceo_name_resize); add_callback_for_labels({"FMMC_KEY_TIP15"_J, "FMMC_MCK_TIP15"_J}, do_ceo_name_resize);
add_label_overwrite("GC_OTR_TMR"_J, "HIDING FROM CLOWNS"); add_label_overwrite("GC_OTR_TMR"_J, "HIDING FROM CLOWNS");
// add_label_overwrite("TICK_LEFTCHEAT"_J, "~a~~HUD_COLOUR_WHITE~ has been swatted by Rockstar."); // add_label_overwrite("TICK_LEFTCHEAT"_J, "~a~~HUD_COLOUR_WHITE~ has been swatted by Rockstar.");
@ -24,7 +24,7 @@ namespace big
return m_callbacks.insert({hash, cb}).second; return m_callbacks.insert({hash, cb}).second;
} }
bool custom_text_service::add_callback_for_labels(std::list<rage::joaat_t> hashes, custom_label_callback&& cb) bool custom_text_service::add_callback_for_labels(std::initializer_list<rage::joaat_t> hashes, custom_label_callback&& cb)
{ {
bool result = true; bool result = true;
for (const auto& hash : hashes) for (const auto& hash : hashes)

View File

@ -19,7 +19,7 @@ namespace big
custom_text_service& operator=(custom_text_service&&) noexcept = delete; custom_text_service& operator=(custom_text_service&&) noexcept = delete;
bool add_callback_for_label(rage::joaat_t hash, custom_label_callback&& cb); bool add_callback_for_label(rage::joaat_t hash, custom_label_callback&& cb);
bool add_callback_for_labels(std::list<rage::joaat_t> hashes, custom_label_callback&& cb); bool add_callback_for_labels(std::initializer_list<rage::joaat_t> hashes, custom_label_callback&& cb);
bool add_label_overwrite(rage::joaat_t hash, std::string_view overwrite); bool add_label_overwrite(rage::joaat_t hash, std::string_view overwrite);
/** /**