New Shop tab.

Hi,

I'm new to the modding process for dota2.

Goal

I want a new Tab in the Shop with new Items (for the first approach: I'll try it with standard-items).

Problem

I thought I could get use of some automatism with , but there is no automastism. So I can't drag, buy or do anything with the DotaShopItem, except the tooltip is working.

Question

How can I get Items to react on dragging, shift+click, click, right click. Do I have to implement it self or can I just add some functions on JS-Events?

Approach

I added the tab dynamically with a js, which is loaded by the manifest. I also can shift tabs, this works fine by now.

Comments

  • edited February 2017 Posts: 858

    Can I see a picture of what you have now? I believe I know what you currently have but I want to confirm that my knowledge is correct before I give you my answer

    E/ the code where you add the itemwould probably also help

    2e/ also to clarify are you trying to add additional shop functionality or just make tabs that behave exactly like they do in the rest of the shop , I didn't know u could drag items in the shop

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • edited February 2017 Posts: 273

    @Salacryl

    You are one of the developers for Angel Arena Allstars right? Baumi wants a similar tab system to Angel Arena Black Star I presume.

    Did you try opening and extracting .vpk file of the Angel Arena Black Star with GFScape and see how they did it? .xml and .js are compiled but you can still open and read them just fine. Also there is: containers library and containers panorama scripts

    If you don't know where are those vpk files, they are in: SteamApps\workshop\content\570\ID_number

    ID_numbers are found in urls: https://steamcommunity.com/sharedfiles/filedetails/?id=699441891 For Angel Arena Black Star ID_number is: 699441891

    @Arhowk

    I think he meant dragging items to the quick buy section.

  • Posts: 858

    @Darkonius AABS uses a custom shop

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • edited February 2017 Posts: 4

    @Darkonius

    I am and yes. I don't know. RE doesn't feel right if the developer doesn't want it. So: nah.

    Huh. those containers seems pretty neat. Yahnich told me about it. I hoped they would be a more straight forward way to do it. Mh, I'll look into those. Thanks.

    @Arhowk I just did something like:

    var globalContext = $.GetContextPanel().GetParent().GetParent().GetParent();
    var mainPanel = globalContext.FindChildTraverse("GridMainTabs");
    var newitemstabPanel = $.CreatePanel( "RadioButton",mainPanel, "my tab" );
    

    and put category and column panel in ther (BloadLayout) add some events. Easy peasy

    "I think he meant dragging items to the quick buy section." - I did indeed.

    I want the same functions for my tab as it for Basic and Upgrade stuff.

  • Posts: 858

    Don't look into BMD's containers for this scenario; they were done pre-7.00 and are notoriously buggy.

    I was also referring to the code for how you made your ability buttons, not your tab.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • edited February 2017 Posts: 858

    I was looking at it and it's unfortunately impossible to do with the current tools because the C API for DOTAShopItem isn't exposed properly. I'll make a post on the bug tracker in case it's easy for valve and they can throw it in real fast (I'm pretty sure all you have to do is just panel.itemname = "clarity" but I couldn't find the right variable name for this.

    Until then I can only recommend you do this-

    Just add more items to the default shop Remove the concepts of "side" and "secret" shops and use those two as replacement "tabs"

    Create some custom UI for buying items (Just use a DotaItemImage and some hard coded stuff, it shouldn't be hard)

    If valve responds back I'll ping you on discord

    To fully answer your question, you can set a panel event like 'panel.SetPanelEvent('oncontextmenu' (right clicked), function(){ your code here to})' but this won't work like the rest of the shop items because your missing a lot of logic

    Sorry for formatting issues I'm on my phone

    E/ to clarify because I was in a rush, you need to use the valve provided API for using their shop functionality like quick buy and Hotkeys and whatnot but it isn't exposed properly

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Just add more items to the default shop Remove the concepts of "side" and "secret" shops and use those two as replacement "tabs"

    I tried it with an aaa_shops.txt, but I don't know how to get the categories "sideshop1" as a tab.