Jump to content

Shop Remote for ShopEX


Recommended Posts

Hello,

(?) Reffering to this function to remote a shop:

[python]

ACMD(do_shop_remote)
{
    if (ch->IsDead() || ch->GetExchange() || ch->GetMyShop() || ch->IsOpenSafebox() || ch->IsCubeOpen())
        return;

    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    if (!*arg1)
        return;

    uint16_t vnum;
    str_to_number(vnum, arg1);

    LPSHOP shop = CShopManager::instance().Get(vnum);
    if (!shop)
        return;

    ch->SetShopOwner(ch);
    shop->AddGuest(ch, 0, false);
}

[/python]

(?) It doesn't matter if i put there the right shop vnum, i will always get the first tab of the ShopEX.

(?) How i can make the function if the ShopEx "GetTabCount > 1" to get the available tabs buttons there;

(?) Or to open the shop window without the tabs buttons, but to get the right shop window by the shop vnum.

https://metin2.download/picture/RS9aD8Rr68bCa04oQ1SOtJWu33Y8DDLa/.gif

 

 

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

14 minutes ago, IGNEEL said:

I think you are talking about this 
uiShop.py 
-def open()
self.smallRadioButtonGroup.OnClick(0) # 0 is num of default tab.
You should make changes so that the default tab number is determined by 'shop_vnum'.

ACMD(do_shop_remote)
{
    if (ch->IsDead() || ch->GetExchange() || ch->GetMyShop() || ch->IsOpenSafebox() || ch->IsCubeOpen())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(TRANSLATE_LANGUAGE,"Close the open windows first."));
        return;
    }

    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    if (!*arg1)
        return;

    uint16_t vnum;
    str_to_number(vnum, arg1);

    LPSHOP shop = CShopManager::instance().Get(vnum);
    if (!shop)
        return;

    ch->SetShopOwner(ch);
    shop->AddGuest(ch, 0, false);
}

I have this function to open the normal shops.

I'm wondering if there is not an function in server source to can open a specific tab, without to use binary or slots..

 

    size_t            GetTabCount() { return m_vec_shopTabs.size(); }

All i can find about ShopEX tab is this check in Server source..

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.