fix info menu bug on DC/PC
This commit is contained in:
@@ -94,6 +94,7 @@ struct MenuItem {
|
|||||||
REQUIRES_MESSAGE_BOXES = 0x080,
|
REQUIRES_MESSAGE_BOXES = 0x080,
|
||||||
REQUIRES_SEND_FUNCTION_CALL = 0x100,
|
REQUIRES_SEND_FUNCTION_CALL = 0x100,
|
||||||
REQUIRES_SAVE_DISABLED = 0x200,
|
REQUIRES_SAVE_DISABLED = 0x200,
|
||||||
|
INVISIBLE_IN_INFO_MENU = 0x400,
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t item_id;
|
uint32_t item_id;
|
||||||
|
|||||||
@@ -1061,6 +1061,9 @@ void send_menu_t(shared_ptr<Client> c, shared_ptr<const Menu> menu, bool is_info
|
|||||||
if (item.flags & MenuItem::Flag::REQUIRES_SAVE_DISABLED) {
|
if (item.flags & MenuItem::Flag::REQUIRES_SAVE_DISABLED) {
|
||||||
is_visible &= !(c->flags & Client::Flag::SAVE_ENABLED);
|
is_visible &= !(c->flags & Client::Flag::SAVE_ENABLED);
|
||||||
}
|
}
|
||||||
|
if (item.flags & MenuItem::Flag::INVISIBLE_IN_INFO_MENU) {
|
||||||
|
is_visible &= !is_info_menu;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_visible) {
|
if (is_visible) {
|
||||||
auto& e = entries.emplace_back();
|
auto& e = entries.emplace_back();
|
||||||
|
|||||||
+2
-2
@@ -391,9 +391,9 @@ void ServerState::create_menus(shared_ptr<const JSONObject> config_json) {
|
|||||||
shared_ptr<vector<u16string>> information_contents(new vector<u16string>());
|
shared_ptr<vector<u16string>> information_contents(new vector<u16string>());
|
||||||
|
|
||||||
information_menu_v2->items.emplace_back(InformationMenuItemID::GO_BACK, u"Go back",
|
information_menu_v2->items.emplace_back(InformationMenuItemID::GO_BACK, u"Go back",
|
||||||
u"Return to the\nmain menu", 0);
|
u"Return to the\nmain menu", MenuItem::Flag::INVISIBLE_IN_INFO_MENU);
|
||||||
information_menu_v3->items.emplace_back(InformationMenuItemID::GO_BACK, u"Go back",
|
information_menu_v3->items.emplace_back(InformationMenuItemID::GO_BACK, u"Go back",
|
||||||
u"Return to the\nmain menu", 0);
|
u"Return to the\nmain menu", MenuItem::Flag::INVISIBLE_IN_INFO_MENU);
|
||||||
{
|
{
|
||||||
uint32_t item_id = 0;
|
uint32_t item_id = 0;
|
||||||
for (const auto& item : d.at("InformationMenuContents")->as_list()) {
|
for (const auto& item : d.at("InformationMenuContents")->as_list()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user