1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Triumph has risen from these uncharted shores. The 34th Modeling Contest Results are out!
    Dismiss Notice
  3. Awaken what lies in the heart of your swarm. The 17th Techtree Contest has arrived!
    Dismiss Notice
  4. The Hive Workshop is launching its first HD modelling contest. How HD should it be?
    Dismiss Notice
  5. Check out the Staff Job Openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

TasItemshop

Submitted by Tasyen
This bundle is marked as pending. It has not been reviewed by a staff member yet.

Introduction


TasItemShop is a Frame-UI System for Warcraft 3 V1.31 or higher. The System's purpose is to have shops that can sell/fuse more items than the ones Warcraft 3 nativly provides. In the same time more accessable with search&filter features.
Shops are still meant to be units in this system.​

Features


Shows current buyable Items in a scrollable list of Buttons.
Customizeable to some degree, without touching the system's code (might require some fdf knowhow).
Can be used by any amount of players at the same time. Each with their own shoping.
Supports Items crafted by fusing other items.
Complete fusions - pays for missing items, if the shop can sell the material.
Can disable the usage of other players items as fusion material.(You have to handle item ownership using SetItemPlayer, this feature can be disabled)
Can Defuse items.
Can Sell Items to a Shop.
Multiple Units can contribute materials for a ItemFusion.
Has Reference Buttons to show upgrades, materials, current items in inventory and your shoppers.
Item Reference Buttons can be left clicked, to navigate the shop.
Item Reference Buttons can be right clicked to quick buy it.
Items can be filtered by categories. (There can be upto 31 categories)
Supports multicategory in which items have to fullfill all selected categories.
Item can be searched by name or parts of their name.
item Infos are taken from Object Editor.
Can have different Shops with different prices and itempools.
Such Shops are setuped by Unitcode and have either a White- or BlackList.
Shops can have Gold/Lumber cost factors for anything or/and different price factors for specific items.
Can be feed by GUI. (Some features are code only)
^^ The GUI part can be removed quite simple, if not wanted.
Works during Game Pause (Sadly not the quick buying with right clicks).
Can Undo all Buys/Fusions/Sells/Defusions done aslong the TasItemShop was not closed. Undo gives you back the gold/Lumber, items used and removes the gained items. (Undo can be disabled) (When this feature is enabled material-Items are not removed until the Undo becomes unuseable)
Abilities/Buffs can change the prices in TasItemShop.
Can sell you any items not added to the item shop, but can navigated to (has to be enabled, connected with ignoring what shops can sell/craft).
Can Set ShortCuts for buyable Items on a Player base (this can be done by user and by Code)
Makes your map some kb heavier and adds several hundreds of lines to your map script.​

How to install?


First you have to export and import the Files in the demo map (using the export all Files function can bug in older Editor Versions).

war3mapImported\TasItemShop.fdf
war3mapImported\TasItemShop.toc
war3mapImported\TasButtonList.fdf
the model in the demo (by abfal), if you want to use it

Now you copy Item Shop UI (trigger editor) into your map
if all worked, you can now use it.

How to use!


After it was added into your map you first have to tell it which unitTypes are used as shops and what they (not) sell/craft. You also should setup Fusions and categories.
When you setuped all the shops, buyable items,fusions and categories you are done.
You also have to inspect and maybe change the most top functions right below the configs in the System's code which can be treated as part of the user setup.
local function UserInit() (in vjass this function is in a seperate script file and is independent)
local function IsValidShopper(player, shop, unit, range)
local function CostModifier(gold, lumber, itemCode, buyer, shop, shopObject)

For code examples download the map or scroll down.

When a shopping is started the current buyable options are loaded into the UI, based on the current visited shop.
When your map hides the Frame "ConsoleUIBackdrop" then you should change the parent used for TasItemShopUI.Frames.ParentSuper. When TasItemShop is used in Reforged, on default, "ConsoleUIBackdrop" is used to make the box be useable outside of the 4:3 Screen.

ShopUnits


TasItemShop has Shops in BlackList and Shops in WhiteList mode. The difference between these is the items they can sell/craft.
Shops without custom data and BlackList based shops use the TasItemShop item array (BUY_ABLE_ITEMS). The Blacklist mode takes away options from the common buy options when using the shop. While WhiteList shops don't care about that list at all and sell only what one set up for them.

Fusion Limitations


Fusions done by TasItemShop can only be done inside the shop. There is no fusing by holding all the items.
An Fused Item can only be built by one way. One can not setup 2 ways to get the ultimate sword, there can only be one.
Materials are absolute, there is no replacement or equal substitute item. Although they can be replaced by gold/lumber, if the shop can sell them.
Fusion do not care about charges


  • The GUI part is the same for the Lua and vjass version. If you only want to use TasItemShop with GUI don`t forget to inspect and change the config to your bidding, which is shown in the start of the vjass/Lua tab.

    This Trigger is the GUI init it evokes the other ItemShop GUI init Triggers. It is quite important that you create categories before you try to use them onto an item.
    • ItemshopGUI Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Trigger - Run ItemshopGUI Init Cats <gen> (ignoring conditions)
        • Trigger - Run ItemshopGUI Init Fusions <gen> (ignoring conditions)
        • Trigger - Run ItemshopGUI Init Haggle Skills <gen> (ignoring conditions)
        • Trigger - Run ItemshopGUI Init Items <gen> (ignoring conditions)
        • Trigger - Run ItemshopGUI Init Shop <gen> (ignoring conditions)

    Define 2 Haggle-Effects. Being turned into a frog by a shadow hunter spell will make shopping much more expensive.
    Having the Haggle-Skill reduces the prices by 20%.
    • ItemshopGUI Init Haggle Skills
      • Events
      • Conditions
      • Actions
        • -------- With the Haggle skill you have to pay 20% less --------
        • Set TasItemShop_Skill = Haggling
        • Set TasItemShop_Gold = 0.80
        • Set TasItemShop_Lumber = 0.80
        • Set TasItemShop_LumberAdd = 0.00
        • Set TasItemShop_GoldAdd = 0.00
        • Trigger - Run TasItemShopHaggle (ignoring conditions)
        • -------- With the Hex buff you have pay 3 times as much --------
        • Set TasItemShop_Buff = Hexerei
        • Set TasItemShop_Gold = 3.00
        • Set TasItemShop_Lumber = 3.00
        • Trigger - Run TasItemShopHaggle (ignoring conditions)

    This trigger defines Goblin-Shop as a TasItemShop. It is an expensive shop which takes 20% more Gold&Lumber. It is a Blacklist shop which excludes Kelens Dagger and Crown of the Kings, if they are part of the common sellable item pools.
    • ItemshopGUI Init Shop
      • Events
      • Conditions
      • Actions
        • Set TasItemShop_Unit = Goblin-Laden
        • -------- general cost Factor, 1.0 = 100%. 1,2 = 120% costs --------
        • Set TasItemShop_Gold = 1.20
        • Set TasItemShop_Lumber = 1.20
        • -------- false = disallow mentioned items --------
        • -------- true = allow only the mentioned items --------
        • Set TasItemShop_WhiteList = False
        • -------- Mat[0] is not supported --------
        • Set TasItemShop_Mats[1] = Kelens Dolch des Entkommens
        • Set TasItemShop_Mats[2] = Krone der Könige +5
        • Trigger - Run TasItemShopCreateShop (ignoring conditions)

    Add this 2 Items to common buyable pool
    • ItemshopGUI Init Items
      • Events
      • Conditions
      • Actions
        • -------- Add Sengklinge as MyItemShopCat to the common buyable Pool --------
        • Set TasItemShop_Item = Sengklinge
        • Set TasItemShop_Category = MyItemShopCat
        • Trigger - Run TasItemShopAdd (ignoring conditions)
        • -------- Add Frostwache as MyItemShopCat & MyItemShopCat2 to the common buyable Pool --------
        • Set TasItemShop_Item = Frostwache
        • Set TasItemShop_Category = (MyItemShopCat + MyItemShopCat2)
        • Trigger - Run TasItemShopAdd (ignoring conditions)

    Define 2 new Fusions.
    • ItemshopGUI Init Fusions
      • Events
      • Conditions
      • Actions
        • -------- Mat[0] is not supported --------
        • Set TasItemShop_Item = Frostwache
        • Set TasItemShop_Mats[1] = Frostkugel
        • Set TasItemShop_Mats[2] = Klauen des Angriffs +15
        • Trigger - Run TasItemShopFusion (ignoring conditions)
        • Set TasItemShop_Item = Sengklinge
        • Set TasItemShop_Mats[1] = Feuerkugel
        • Set TasItemShop_Mats[2] = Klauen des Angriffs +15
        • Trigger - Run TasItemShopFusion (ignoring conditions)

    Creates 2 categories and safes their value into custom variables. This variables are required to add items later with these categories.
    • ItemshopGUI Init Cats
      • Events
      • Conditions
      • Actions
        • -------- Add a new category --------
        • Set TasItemShop_Text = GUI
        • Set TasItemShop_Icon = ReplaceableTextures\CommandButtons\BTNDranaiAkama.blp
        • Trigger - Run TasItemShopCategory (ignoring conditions)
        • -------- TasItemShop_Category contains the new category's value --------
        • -------- Save it into an custom variable of your choice. You need it to set the categories of items. --------
        • Set MyItemShopCat = TasItemShop_Category
        • -------- Add another category --------
        • Set TasItemShop_Text = GUI2
        • Set TasItemShop_Icon = ReplaceableTextures\CommandButtons\BTNAcolyte.blp
        • Trigger - Run TasItemShopCategory (ignoring conditions)
        • -------- This is a different category safe it in a different variable --------
        • Set MyItemShopCat2 = TasItemShop_Category

    With V4A one can set current ShortCut for a player with GUI triggers. This trigger sets the default ShortCuts for all players. Humans have different ones than non Hummans.
    Beaware that in the Lua version you can not do that before 0.01s seconds passed.
    • ItemshopGUI Init ShortCuts
      • Events
        • Time - Elapsed game time is 1.00 seconds
      • Conditions
      • Actions
        • -------- Do that after 0.01s --------
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • -------- The playre for which you want to set Shortcuts --------
            • Set TasItemShop_Player = (Picked player)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Race of (Picked player)) Equal to Human
              • Then - Actions
                • -------- Mat[0] is not supported --------
                • Set TasItemShop_Mats[1] = Gürtel der Gigantenkraft +6
                • Set TasItemShop_Mats[2] = Krone der Könige +5
                • Set TasItemShop_Mats[3] = Klauen des Angriffs +15
              • Else - Actions
                • Set TasItemShop_Mats[1] = Medaillon des Mutes
                • Set TasItemShop_Mats[2] = Ring des Schutzes +3
                • Set TasItemShop_Mats[3] = Sobi-Maske
            • Trigger - Run TasItemShopShortCuts (ignoring conditions)
        • -------- You could clear the ShortCutList by setting [1] to no Item Type --------


  • Config


    At the top of the TasItemShop after "do" you find the config for various settings. This settings except for BUY_ABLE_ITEMS & Haggle_Skills. Should not be changed later on. These settings define Size, Position, button amount & enables features, some are constantly read some only when the UI is created. If you want to use the system with GUI only you should remove all data from BUY_ABLE_ITEMS and remove all content from local function UserInit() which is also found a little bit below the other config.
    Normaly in Lua one has to use FourCC when mentioning a Object Editor Objectcode. TasItemShop API functions handle that four you.​
    Code (Lua):
    -- A list of items buyable, you could just smack in all your buyAble TasItems here.
    -- Or use TasItemShopAdd(itemCode, category) inside local function UserInit()
    -- This List is used by shops without custom data or by BlackList Shops
    local BUY_ABLE_ITEMS = {'bgst', 'ciri', 'belv', 'hval', 'hcun', 'mcou', 'ckng', 'rat9', 'ratf', 'rst1', 'rin1', 'rag1', 'cnob', 'rat6', 'rlif'
    ,'ajen', 'clfm', 'ward', 'kpin', 'lgdh', 'rde4', 'pmna', 'rhth', 'ssil', 'spsh', 'lhst', 'afac', 'sbch', 'brac', 'rwiz', 'crys', 'evtl', 'penr'
    ,'prvt', 'rde3', 'bspd', 'gcel', 'rde2', 'clsd', 'dsum', 'stel', 'desc', 'modt', 'ofro', 'thdm', 'hlst', 'mnst', 'pghe', 'pgma', 'pnvu', 'pres'
    ,'ankh', 'shas', 'stwp', 'ofir', 'oli2', 'odef', 'oven', 'oslo', 'ocor', 'shtm', 'I001', 'klmm', 'crdt'
    }

    local Haggle_Skills = {
        -- skill, GoldBase, Lumberbase, GoldAdd, LumberAdd
        -- add is added per Level of that skill to Base. The current Cost is than multiplied by that Factor.
        --{FourCC('A000'), 0.8, 0.8, 0.0, 0.0}
    }

    -- position of the custom UI
    -- it can leave the 4:3 Screen but you should checkout the start of function TasItemShopUI.Create
    local xPos = 0.0
    local yPos = -0.02
    local posPoint = FRAMEPOINT_TOPRIGHT
    local posScreenRelative = true --(true) repos to the screenSize, when the resolution mode changes the box will move further in/out when using a right or Left point.
    -- It is advised to posScreenRelative = false when posPoint does not include Left or Right
    -- with posScreenRelative = false xPos and yPos are abs coords, to which posPoint of the Shop UI is placed to.

    -- position of Item toolTips, this does not affect the tooltips for Categories or Users.
    -- comment out toolTipPosPointParent, if you want a specific position on screen.
    -- with toolTipPosPoint & toolTipPosPointParent are toolTipPosX & toolTipPosY relative offsets.
    -- The position is a bit wierd, the position is not the box but the Extended Tooltip Text, the Header has a height of ~0.052.

    local toolTipPosX = 0.0
    local toolTipPosY = -0.052
    local toolTipPosPoint = FRAMEPOINT_TOPRIGHT
    local toolTipPosPointParent = FRAMEPOINT_BOTTOMRIGHT
    local toolTipSizeX = 0.2 -- only content
    local toolTipSizeXBig = 0.3 -- only content
    local toolTipLimitBig = 300 -- When a TooltipText Contains this amount or more of Chars it will use toolTipSizeXBig

    -- this can be used to change the visual ("EscMenuControlBackdropTemplate") ("TasItemShopRaceBackdrop")
    local boxFrameName = "TasItemShopRaceBackdrop"
    local boxButtonListFrameName = "EscMenuControlBackdropTemplate"
    local boxRefFrameName = "EscMenuControlBackdropTemplate"
    local boxCatFrameName = "EscMenuControlBackdropTemplate"
    local boxUndoFrameName = "TasItemShopRaceBackdrop"
    local boxDefuseFrameName = "TasItemShopRaceBackdrop"
    local buttonListHighLightFrameName = "TasItemShopSelectedHighlight"
    local boxFrameBorderGap = 0.0065
    local boxButtonListBorderGap = 0.0065 -- does nothing right now
    local boxRefBorderGap = 0.0065
    local boxCatBorderGap = 0.0055
    local boxUndoBorderGap = 0.0045
    local boxDefuseBorderGap = 0.0045
    local boxSellBorderGap = 0.0045
    local buttonListButtonGapCol = 0.001
    local buttonListButtonGapRow = 0.005
    -- material control
    local flexibleShop = false -- (true) can sell items not added to the shop. This includes items reached over RefButtons and material for autocompletion. I don't know that item, but your description is enough. I craft it, no problem.
    local sharedItems = false -- (false) can only fuse material owned by neutral passive (default) or oneself. The code handling that is in TasItemFusion.
    local canProviderGetItem = true -- (true) when the mainShopper's inventory is full, try to give the other matieral provider the item
    local canUndo = true -- (true) There is an Undo Button which allows to Revert BuyActions done in this shopping. A shopping ends when the UI is closed, changing current shop counts as closed.
    local canDefuse = true -- (true) There is a Defuse Button which allows to defuse FusionItems hold.
    local DefuseButtonIcon = "ReplaceableTextures\\CommandButtons\\BTNdemolish"
    local DefuseButtonIconDisabled = getDisabledIcon(DefuseButtonIcon)
    local canSellItems = true -- (true)
    local SellFactor = 0.75
    local SellUsesCostModifier = true
    local SellButtonIcon = "ReplaceableTextures\\CommandButtons\\BTNReturnGoods"
    local SellButtonIconDisabled = getDisabledIcon(SellButtonIcon)

    local MainUserTexture = "ui\\widgets\\console\\human\\commandbutton\\human-multipleselection-border"
    local MainItemTexture = "ui\\widgets\\console\\human\\commandbutton\\human-multipleselection-border"

    local shopRange = 900 -- the max distance between shop and Shoper, this can be overwritten by shopObject.Range.
    local updateTime = 0.4 -- how many seconds pass before a new update is applied. update: search new shopers, validat current shopers and update UI.
    -- Titel-text in the reference Boxes
    local textUpgrades = "COLON_UPGRADE" --tries to localize on creation
    local textMats = "SCORESCREEN_TAB3"
    local textInventory = "INVENTORY"
    local textUser = "USER"
    local textCanNotBuyPrefix = "Can not buy: "
    local textCanNotBuySufix = "OUTOFSTOCKTOOLTIP"
    local textNoValidShopper = "No valid Shoper"
    local textUndo = "Undo: "
    local textUnBuyable = "xxxxxxx"
    local textDefuse = "Defuse:"
    local textSell = "Sell:"
    local textQuickLink = "ShortCuts:"
    local categoryModeTextAnd = "ui\\widgets\\battlenet\\bnet-mainmenu-friends-disabled"
    local categoryModeTextOr = "Or"
    local categoryModeIconOr = "ui\\widgets\\battlenet\\bnet-mainmenu-friends-up"
    local categoryModeIconAnd = "And"

    local quickLinkKey = OSKEY_LSHIFT  -- nil will prevent the user from changing shortcuts. can also be commented out
    -- how many refButtons, refButtons have pages, if needed.
    -- A feature is disabled with a counter smaller than 1.
    local refButtonCountMats = 4 -- materialRefs.
    local refButtonCountUp = 4 -- possible upgrades of the current Selected
    local refButtonCountInv = 6 -- inventory items, this system allows an unitgroup to provide items, if you don't use that feature only upto 6 makes sense.
    local refButtonCountUser = 6 -- References to the shopping Units/material provider.
    local refButtonCountQuickLink = 4 -- User SelectAble Shortcuts
    local refButtonSize = 0.02
    local refButtonGap = 0.003
    local refButtonPageSize = 0.012
    local refButtonPageRotate = true --(true) swap to first page when going above last page, and swap to last page when going down first Page
    local refButtonPageUp = "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp"
    local refButtonPageDown = "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown"
    local refButtonBoxSizeY = 0.047

    -- LayoutType alters the position of buttons
    -- (0) the buy button is at the bottom between buttonList and buybutton the refBoxes are placed
    -- (1) the buy button is below the buttonList below it are the refButtons
    -- (2) the buy button is below the buttonList, the RefButtons are at the bottom outside of the Box
    -- (3) the buy button is below the buttonList, the RefButtons are left outside of the Box they are also from top to bottom
    local LayoutType = 0


    -- (true) right clicking an refInventoryButton in the UI will sell the item
    -- (false) right clicking it will buy it again.
    local inventoryRightClickSell = true
    local inventoryShowMainOnly = true --(false) show all items currently useable

    local userButtonOrder = false -- (true) Creates any UnitTargetOrder Event enables right clicking Units in the world to swap main shoppers.
    local doubleClickTimeOut = 2.0 -- amount of seconds a doppleclick inside the Buttonlist counts as Buying

    -- model displayed when buy request was started.
    --local spriteModel = "UI\\Feedback\\GoldCredit\\GoldCredit.mdl" -- in 1.31 the coins are black only.
    --local spriteModel = "Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl"
    --local spriteModel = "Abilities\\Weapons\\BansheeMissile\\BansheeMissile.mdl"
    --local spriteModel = "Abilities\\Spells\\Other\\GeneralAuraTarget\\GeneralAuraTarget.mdl"
    local spriteModel = "war3mapImported\\BansheeMissile.mdx" --by abfal, (no sound).
    local spriteScale = 0.0006 -- The scale has to fit the used model. if you use non-UI models use a low scale, 0.001 or below.
    local spriteAnimationIndex = 1 -- 1 = death animation

    local buttonListRows = 5
    -- buttonListCols has a strong impact on the xSize of this UI. make sure that refButtons of one type fit into this.
    local buttonListCols = 3

    -- this will not change the size of the Buttons, nor the space the text can take
    -- true = Show
    -- false = hide
    local buttonListShowGold = true
    local buttonListShowLumber = true
    local buyButtonShowGold = true
    local buyButtonShowLumber = true

    -- which button is used inside the ButtonList? Enable one block and disable the other one

    local buttonListButtonName = "TasButtonSmall"
    local buttonListButtonSizeX = 0.1
    local buttonListButtonSizeY = 0.0325

    -- "TasButtonGrid" are smaller, they don't show the names in the list
    --local buttonListButtonName = "TasButtonGrid"
    --local buttonListButtonSizeX = 0.064
    --local buttonListButtonSizeY = 0.0265

    --local buttonListButtonName = "TasButton"
    --local buttonListButtonSizeX = 0.2
    --local buttonListButtonSizeY = 0.0265

    local categoryButtonSize = 0.019
    In Lua most setup is done in the local function UserInit() of TasItemShop. Here one should define categories, fusions, shops.
    Probably you should use functions of this Lua api:
    Code (Lua):
    --[[
    TasItemSetCategory(itemCode, category)
    TasItemShopAdd(itemCode, category)
    TasItemShopAddCategory(icon, text)
     define a new Category, should be done before the UI is created.
     Returns the value of the new category
    TasItemShopUIShow(player, shop, shopperGroup[, mainShoper])
        TasItemShopUIShow(player) hides the shop for player
        shopperGroup are all units providing items, if you use nil the current shoppergroup remains intact. When giving something else the group contains only mainShoper.
        mainShoper is the unit consider for haggel and gains the items. If you gave a group then you can skip mainShoper then a random is taken.
        with player and shop the shoppers are kept but the shop updates.
        Beaware that this System does only update on user input it will not check distance/live or anything.
    TasItemShopUIShowSimple(player, shop, mainShoper)
    TasItemShopCreateShop(unitCode, whiteList, goldFactor, lumberFactor, goldFunction, lumberFunction)
    TasItemShopAddShop(unitCode, ...)
     adds data for that specific shop
    TasItemShopGoldFactor(unitCode, factor, ...)
        sets the goldFactor for that shop to the given data
    TasItemShopLumberFactor(unitCode, factor, ...)
        lumberFactor ^^
    TasItemShopAddHaggleSkill(skill, goldBase[, lumberBase, goldAdd, lumberAdd])
        adds a new Skill which will affect the costs in TasItemShop.
    TasItemShopUI.SetQuickLink(player, itemCode)
        add/remove itemCode from quickLink for player
    --]]
    Demo map Example of local function UserInit()
    Code (Lua):
    -- This runs right before the actually UI is created.
    -- this is a good place to add items, categories, fusions shops etc.
    local function UserInit()
        -- this can all be done in GUI aswell, enable the next Line or remove all Text of this function if you only want to use GUI
        --if true then return end

        -- define Categories: Icon, Text
        -- the Categories are displayed in the order added.
        -- it is a good idea to save the returned Value in a local to make the category setup later much easier to understand.
        -- you can only have 31 categories
        local catDmg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSteelMelee", "COLON_DAMAGE")
        local catArmor = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpOne", "COLON_ARMOR")
        local catStr = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNGauntletsOfOgrePower", "STRENGTH")
        local catAgi = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSlippersOfAgility", "AGILITY")
        local catInt = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNMantleOfIntelligence", "INTELLECT")
        local catLife = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPeriapt", "Life")
        local catLifeReg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRegenerate", "LifeRegeneration")
        local catMana = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPendantOfMana", "Mana")
        local catManaReg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSobiMask", "ManaRegeneration")
        local catOrb = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness", "Orb")
        local catAura = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNLionHorn", "Aura")
        local catActive = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNStaffOfSilence", "Active")
        local catPower = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNControlMagic", "SpellPower")
        local catCooldown = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Cooldown")
        local catAtkSpeed = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Attackspeed")
        local catMress = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRunedBracers", "Magic-Resistence")
        local catConsum = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPotionGreenSmall", "ConsumAble")
        local catMoveSpeed = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNBootsOfSpeed", "COLON_MOVE_SPEED")
        local catCrit = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNCriticalStrike", "Crit")
        local catLifeSteal = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNVampiricAura", "Lifesteal")
        local catEvade = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNEvasion", "Evasion")
     
        -- setup custom shops
        -- custom Shops are optional.
        -- They can have a White or Blacklist of items they can(n't) sell and have a fixed cost modifier for Gold, Lumber aswell as a function for more dynamic things for Gold and Lumber.
        local shopObject
        -- 'n000' can only sell this items (this items don't have to be in the pool of items)
        shopObject = TasItemShopAddShop('n000', 'hlst', 'mnst', 'pghe', 'pgma', 'pnvu', 'pres', 'ankh', 'stwp', 'shas')
        -- enable WhiteListMode
        shopObject.Mode = true
        -- 'n001' can't sell this items (from the default pool of items)
        shopObject = TasItemShopAddShop('n001', 'hlst', 'mnst', 'pghe', 'pgma', 'pnvu', 'pres', 'ankh', 'stwp', 'shas')
        -- enable BlackListMode
        shopObject.Mode = false
        -- create an shopObject for 'ngme', has to pay 20% more than normal, beaware that this can be overwritten by GUI Example
        shopObject = TasItemShopCreateShop('ngme', false, 1.2, 1.2
        -- custom gold Cost function
            ,function(itemCode, cost, client, shop) return cost end
        -- custom lumber Cost function
            ,function(itemCode, cost, client, shop) return cost end
        )
        --'I002' crown +100 was never added to the database but this shop can craft/sell it.
        shopObject = TasItemShopAddShop('n002', 'ckng', 'I001', 'I002', 'arsh')
        shopObject.Mode = true
     

        -- Define skills/Buffs that change the costs in the shop
        -- cursed Units have to pay +25%
        TasItemShopAddHaggleSkill(FourCC('Bcrs'), 1.25, 1.25)

        -- define Fusions
        -- result created by 'xxx', 'xx' , 'x'...
        -- item can only be crafted by one way
        -- can add any amount of material in the Lua version
        TasItemFusionAdd('bgst', 'rst1', 'rst1')
        TasItemFusionAdd('ciri', 'rin1', 'rin1')
        TasItemFusionAdd('belv', 'rag1', 'rag1')
        TasItemFusionAdd('hval', 'rag1', 'rst1')
        TasItemFusionAdd('hcun', 'rag1', 'rin1')
        TasItemFusionAdd('mcou', 'rst1', 'rin1')
        TasItemFusionAdd('ckng', 'cnob', 'cnob')
        TasItemFusionAdd('rat9', 'rat6', 'rat6')
        TasItemFusionAdd('ratf', 'rat9', 'rat9')
        TasItemFusionAdd('rde4', 'rde3')
        TasItemFusionAdd('rde3', 'rde2')
        TasItemFusionAdd('rhth', 'prvt')
        TasItemFusionAdd('pmna', 'penr')
        TasItemFusionAdd('arsh', 'rde3', 'rde2')

        TasItemFusionAdd('lhst', 'sfog')

        -- crown of Kings + 50
        TasItemFusionAdd('I001', 'ckng', 'ckng', 'ckng', 'ckng', 'ckng', 'ckng', 'bgst', 'bgst', 'ciri', 'ciri', 'belv', 'belv', 'cnob', 'cnob')
        -- crown of Kings + 100, this is a joke you can not craft it because it was not added to buyAble Items
        TasItemFusionAdd('I002', 'I001', 'I001')

        -- define item Categories
        -- uses the locals from earlier.
        -- An item can have multiple categories just add them together like this: catStr + catAgi + catInt
     
        TasItemSetCategory('rst1', catStr)
        TasItemSetCategory('bgst', catStr)
        TasItemSetCategory('rin1', catInt)
        TasItemSetCategory('ciri', catInt)
        TasItemSetCategory('rag1', catAgi)
        TasItemSetCategory('belv', catAgi)

        TasItemSetCategory('I001', catStr + catAgi + catInt)

        TasItemSetCategory('ckng', catStr + catAgi + catInt)
        TasItemSetCategory('mcou', catStr + catInt)
        TasItemSetCategory('hval', catStr + catAgi)
        TasItemSetCategory('hcun', catAgi + catInt)
        TasItemSetCategory('cnob', catStr + catAgi + catInt)

        TasItemSetCategory('rat9', catDmg)
        TasItemSetCategory('rat6', catDmg)
        TasItemSetCategory('ratf', catDmg)
     
        TasItemSetCategory('rlif', catLifeReg)

        TasItemSetCategory('ajen', catAura + catAtkSpeed + catMoveSpeed)
        TasItemSetCategory('clfm', catAura + catDmg)
        TasItemSetCategory('ward', catAura + catDmg)
        TasItemSetCategory('kpin', catAura + catManaReg)
        TasItemSetCategory('lgdh', catAura + catMoveSpeed + catLifeReg)
        TasItemSetCategory('rde4', catArmor)
        TasItemSetCategory('pmna', catMana)
        TasItemSetCategory('rhth', catLife)
        TasItemSetCategory('ssil', catActive)
        TasItemSetCategory('lhst', catAura + catArmor)
        TasItemSetCategory('afac', catAura + catDmg)
        TasItemSetCategory('sbch', catAura + catDmg)
        TasItemSetCategory('sbch', catAura + catLifeSteal)
        TasItemSetCategory('brac', catMress)
        TasItemSetCategory('spsh', catMress + catActive)
        TasItemSetCategory('rwiz', catManaReg)
        TasItemSetCategory('crys', catActive)
        TasItemSetCategory('evtl', catEvade)
        TasItemSetCategory('penr', catMana)
        TasItemSetCategory('prvt', catLife)
        TasItemSetCategory('rde3', catArmor)
        TasItemSetCategory('bspd', catMoveSpeed)
        TasItemSetCategory('gcel', catAtkSpeed)
        TasItemSetCategory('rde2', catArmor)
        TasItemSetCategory('clsd', catActive)
        TasItemSetCategory('dsum', catActive + catMoveSpeed)
        TasItemSetCategory('stel', catActive + catMoveSpeed)
        TasItemSetCategory('desc', catActive + catMoveSpeed)
        TasItemSetCategory('ofro', catDmg + catOrb)
        TasItemSetCategory('modt', catLifeSteal + catOrb)
        TasItemSetCategory('thdm', catActive)
        TasItemSetCategory('hlst', catActive + catConsum + catLifeReg)
        TasItemSetCategory('mnst', catActive + catConsum + catManaReg)
        TasItemSetCategory('pghe', catActive + catConsum)
        TasItemSetCategory('pgma', catActive + catConsum)
        TasItemSetCategory('pnvu', catActive + catConsum)
        TasItemSetCategory('pres', catActive + catConsum)
        TasItemSetCategory('ankh', catConsum)
        TasItemSetCategory('stwp', catActive + catConsum + catMoveSpeed)
        TasItemSetCategory('shas', catActive + catConsum + catMoveSpeed)
        TasItemSetCategory('ofir', catOrb + catDmg)
        TasItemSetCategory('oli2', catOrb + catDmg)
        TasItemSetCategory('odef', catOrb + catDmg)
        TasItemSetCategory('oven', catOrb + catDmg)
        TasItemSetCategory('oslo', catOrb + catDmg)
        TasItemSetCategory('ocor', catOrb + catDmg)
        TasItemSetCategory('shtm', catActive)
    end
    This function belongs to the setup and is quite important. It allows or disallows units currently using a shop and with that also providing material.
    Code (Lua):
    local function IsValidShopper(player, shop, unit, range)
        if not IsUnitOwnedByPlayer(unit, player) then
            --print("IsUnitOwnedByPlayer")
            return false
        end
        if UnitInventorySize(unit) < 1 then
            --print("UnitInventorySize")
            return false
        end
        if IsUnitType(unit, UNIT_TYPE_DEAD) then
            --print("UNIT_TYPE_DEAD")
            return false
        end
        if IsUnitPaused(unit) then
            --print("IsUnitPaused")
            return false
        end
        if IsUnitHidden(unit) then
            --print("IsUnitHidden")
            return false
        end
        if IsUnitIllusion(unit) then
            --print("IsUnitIllusion")
            return false
        end
        if not IsUnitInRange(shop, unit, range) then
            --print("not IsUnitInRange")
            return false
        end
        return true
    end
    CostModifier is a function which kinda belongs to the system but still might be a place one want to change to affect all prices in all TasItemShops.
    Code (Lua):
    local function CostModifier(gold, lumber, itemCode, buyer, shop, shopObject)
        -- this function is called for each Button that shows costs in the shop UI and right before buying the item.
        -- Beaware that this function is also called in a async manner -> no sideeffects or state changes.
        -- buyer got the Haggling skill?
        local level, skill
        for i, v in ipairs(Haggle_Skills) do
            skill = v[1]
            level = GetUnitAbilityLevel(buyer, skill)
            if level > 0 then
                gold = gold * (v[2] + v[4]*level)
                lumber = lumber * (v[3] + v[5]*level)
            end
        end

        if shopObject then
            gold = gold * shopObject.GoldFactor[itemCode]
            lumber = lumber * shopObject.LumberFactor[itemCode]
            if shopObject.Gold then
                gold = shopObject.Gold(itemCode, gold, buyer, shop)
            end
            if shopObject.Lumber then
                lumber = shopObject.Lumber(itemCode, lumber, buyer, shop)
            end
     
        end
        return math.floor(gold), math.floor(lumber)
    end
    This functions is used to choose the parent (layer) which is used by TasItemShop. This is important to be able to leave the 4:3 Screen.
    Even if you use this in reforged it might be a good choice to use the else path. Because as Child of "ConsoleUIBackdrop" TasItemShop will be below the default UI.
    Code (Lua):
    local function GetParent()
        local parent
        if TasItemShopUI.IsReforged then
            parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
        else
            CreateLeaderboardBJ(bj_FORCE_ALL_PLAYERS, "title")
            parent = BlzGetFrameByName("Leaderboard", 0)
            BlzFrameSetSize(parent, 0, 0)
            BlzFrameSetVisible(BlzGetFrameByName("LeaderboardBackdrop", 0), false)
            BlzFrameSetVisible(BlzGetFrameByName("LeaderboardTitle", 0), false)
        end
        return parent
    end

  • Config


    In the vjass version most of the config is inside the global block of TasItemShop upto to a line which reads // Config End.
    With the values in config you can alter some rules, features, position, size and appearance of TasItemShop. Even if you only want to use GUI you should checkout & maybe change these value to your will.
    Code (vJASS):
    globals
    // Config Start
    public real xPos = 0.0
    public real yPos = -0.02
    public framepointtype posPoint = FRAMEPOINT_TOPRIGHT
    public boolean posScreenRelative = true //(true) repos to the screenSize, when the resolution mode changes the box will move further in/out when using a right or Left point.
    // It is advised to posScreenRelative = false when posPoint does not include Left or Right
    // with posScreenRelative = false xPos and yPos are abs coords, to which posPoint of the Shop UI is placed to.

    // position of Item toolTips, this does not affect the tooltips for Categories or Users.
    // toolTipPosPointParent = null, if you want a specific position on screen.
    // with toolTipPosPoint & toolTipPosPointParent are toolTipPosX & toolTipPosY relative offsets.
    // The position is a bit wierd, the position is not the box but the Extended Tooltip Text, the Header has a height of ~0.052.
    public real toolTipPosX = 0.0
    public real toolTipPosY = -0.052
    public framepointtype toolTipPosPoint = FRAMEPOINT_TOPRIGHT
    public framepointtype toolTipPosPointParent = FRAMEPOINT_BOTTOMRIGHT
    //public framepointtype toolTipPosPointParent = null
    public real toolTipSizeX = 0.2 // only content
    public real toolTipSizeXBig = 0.3 // only content
    public real toolTipLimitBig = 300 // When a TooltipText Contains this amount or more of Chars it will use toolTipSizeXBig

    // this can be used to change the visual ("EscMenuControlBackdropTemplate") ("TasItemShopRaceBackdrop")
    public string boxFrameName = "TasItemShopRaceBackdrop"
    public string boxButtonListFrameName = "EscMenuControlBackdropTemplate"
    public string boxRefFrameName = "EscMenuControlBackdropTemplate"
    public string boxCatFrameName = "EscMenuControlBackdropTemplate"
    public string boxUndoFrameName = "TasItemShopRaceBackdrop"
    public string boxDefuseFrameName = "TasItemShopRaceBackdrop"
    public string buttonListHighLightFrameName = "TasItemShopSelectedHighlight"
    public real boxFrameBorderGap = 0.0065
    public real boxButtonListBorderGap = 0.0065 // does nothing right now
    public real boxRefBorderGap = 0.0065
    public real boxCatBorderGap = 0.0055
    public real boxUndoBorderGap = 0.0045
    public real boxDefuseBorderGap = 0.0045
    public real boxSellBorderGap = 0.0045
    public real buttonListButtonGapCol = 0.001
    public real buttonListButtonGapRow = 0.005
    // material control
    public boolean flexibleShop = false // (true) can sell items not added to the shop. This includes items reached over RefButtons and material for autocompletion. I don't know that item, but your description is enough. I craft it, no problem.
    public boolean sharedItems = false // (false) can only fuse material owned by neutral passive (default) or oneself. The code handling that is in TasItemFusion.
    public boolean canProviderGetItem = true // (true) when the mainShopper's inventory is full, try to give the other matieral provider the item
    public boolean canUndo = true // (true) There is an Undo Button which allows to Revert BuyActions done in this shopping. A shopping ends when the UI is closed, changing current shop counts as closed.
    public boolean canDefuse = true // (true) There is a Defuse Button which allows to defuse FusionItems hold.
    public string DefuseButtonIcon = "ReplaceableTextures\\CommandButtons\\BTNdemolish"
    public string DefuseButtonIconDisabled = "ReplaceableTextures\\CommandButtonsDisabled\\DISBTNdemolish"
    public boolean canSellItems = true // (true)
    public real SellFactor = 0.75
    public boolean SellUsesCostModifier = true
    public string SellButtonIcon = "ReplaceableTextures\\CommandButtons\\BTNReturnGoods"
    public string SellButtonIconDisabled = "ReplaceableTextures\\CommandButtonsDisabled\\DISBTNReturnGoods"

    public string MainUserTexture = "ui\\widgets\\console\\human\\commandbutton\\human-multipleselection-border"
    public string MainItemTexture = "ui\\widgets\\console\\human\\commandbutton\\human-multipleselection-border"

    public real shopRange = 900 // the max distance between shop and Shoper, this can be overwritten by shopObject.Range.
    public real updateTime = 0.4 // how many seconds pass before a new update is applied. update: search new shopers, validat current shopers and update UI.
    // Titel-text in the reference Boxes
    public string textUpgrades = "COLON_UPGRADE" //tries to localize on creation
    public string textMats = "SCORESCREEN_TAB3"
    public string textInventory = "INVENTORY"
    public string textUser = "USER"
    public string textCanNotBuyPrefix = "Can not buy: "
    public string textCanNotBuySufix = "OUTOFSTOCKTOOLTIP"
    public string textNoValidShopper = "No valid Shoper"
    public string textUndo = "Undo: "
    public string textUnBuyable = "xxxxxxx"
    public string textDefuse = "Defuse:"
    public string textSell = "Sell:"
    public string textQuickLink = "ShortCuts:"
    public string categoryModeTextAnd = "ui\\widgets\\battlenet\\bnet-mainmenu-friends-disabled"
    public string categoryModeTextOr = "Or"
    public string categoryModeIconOr = "ui\\widgets\\battlenet\\bnet-mainmenu-friends-up"
    public string categoryModeIconAnd = "And"


    public oskeytype quickLinkKey = OSKEY_LSHIFT // null will prevent the user from changing shortcuts.

    // how many refButtons, refButtons have pages, if needed.
    // A feature is disabled with a counter smaller than 1.
    public integer refButtonCountMats = 4 // materialRefs.
    public integer refButtonCountUp = 4 // possible upgrades of the current Selected
    public integer refButtonCountInv = 6 // inventory items, this system allows an unitgroup to provide items, if you don't use that feature only upto 6 makes sense.
    public integer refButtonCountUser = 6 // References to the shopping Units/material provider.
    public integer refButtonCountQuickLink = 4 // User SelectAble Shortcuts
    public real refButtonSize = 0.02
    public real refButtonGap = 0.003
    public real refButtonPageSize = 0.012
    public boolean refButtonPageRotate = true //(true) swap to first page when going above last page, and swap to last page when going down first Page
    public string refButtonPageUp = "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp"
    public string refButtonPageDown = "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown"
    public real refButtonBoxSizeY = 0.047

    // (true) right clicking an refInventoryButton in the UI will sell the item
    // (false) right clicking it will buy it again.
    public boolean inventoryRightClickSell = true
    public boolean inventoryShowMainOnly = true // (false) show all items currently useable

    public boolean userButtonOrder = true // (true) Create an UnitTargetOrder Event enables right clicking Units in the world to swap main shoppers.

    public real doubleClickTimeOut = 2.0 // amount of seconds a doppleclick inside the Buttonlist counts as Buying

    // model displayed when buy request was started.
    //public string spriteModel = "UI\\Feedback\\GoldCredit\\GoldCredit.mdl" // in 1.31 the coins are black only.
    //public string spriteModel = "Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl"
    //public string spriteModel = "Abilities\\Weapons\\BansheeMissile\\BansheeMissile.mdl"
    //public string spriteModel = "Abilities\\Spells\\Other\\GeneralAuraTarget\\GeneralAuraTarget.mdl"
    public string spriteModel = "war3mapImported\\BansheeMissile.mdx" //by abfal, (no sound).
    public real spriteScale = 0.0006 // The scale has to fit the used model. if you use non-UI models use a low scale, 0.001 or below.
    public integer spriteAnimationIndex = 1 // 1 = death animation

    public integer buttonListRows = 5
    // buttonListCols has a strong impact on the xSize of this UI. make sure that refButtons of one type fit into this.
    public integer buttonListCols = 3

    // this will not change the size of the Buttons, nor the space the text can take
    // true = Show
    // false = hide
    public boolean buttonListShowGold = true
    public boolean buttonListShowLumber = true
    public boolean buyButtonShowGold = true
    public boolean buyButtonShowLumber = true

    // which button is used inside the ButtonList? Enable one block and disable the other one

    public string buttonListButtonName = "TasButtonSmall"
    public real buttonListButtonSizeX = 0.1
    public real buttonListButtonSizeY = 0.0325

    // "TasButtonGrid" are smaller, they don't show the names in the list
    //public string buttonListButtonName = "TasButtonGrid"
    //public real buttonListButtonSizeX = 0.064
    //public real buttonListButtonSizeY = 0.0265

    public real categoryButtonSize = 0.019
    // -------
    // Config End

    Config is one thing but TasItemShop has not gotten any Data yet. Feeding TasItemShop with data is suggested to be done in the script file TasItemShopUserInit. Unlike in the Lua version it is independent you can just disable/remove it.
    The Idea for TasItemShopUserInit is that you tell TasItemShop here what data you want to use for it. Data cotains categories, shop UnitTypes, buyAble items, Item-Categories, Item-Fusions and Haggle-Skills.

    Could look like this:
    Code (vJASS):
    library TasItemShopUserInit initializer TasItemShopUserInit requires TasItemShop
    // This script  is meant to be used by vjass user to write init data for TasItemShop

        private function ShopCostFunction_ngme takes nothing returns nothing
        endfunction
         // This runs right before the actually UI is created.
        // this is a good place to add items, categories, fusions shops etc.
        function TasItemShopUserInit takes nothing returns nothing
            local integer shopObject
            // this can all be done in GUI aswell, enable the next Line or remove all Text of this function if you only want to use GUI
            //if true then return end

            // define Categories: Icon, Text
            // the Categories are displayed in the order added.
            // it is a good idea to save the returned Value in a local to make the category setup later much easier to understand.
            // you can only have 31 categories
            local integer catDmg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSteelMelee", "COLON_DAMAGE")
            local integer catArmor = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpOne", "COLON_ARMOR")
            local integer catStr = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNGauntletsOfOgrePower", "STRENGTH")
            local integer catAgi = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSlippersOfAgility", "AGILITY")
            local integer catInt = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNMantleOfIntelligence", "INTELLECT")
            local integer catLife = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPeriapt", "Life")
            local integer catLifeReg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRegenerate", "LifeRegeneration")
            local integer catMana = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPendantOfMana", "Mana")
            local integer catManaReg = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSobiMask", "ManaRegeneration")
            local integer catOrb = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness", "Orb")
            local integer catAura = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNLionHorn", "Aura")
            local integer catActive = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNStaffOfSilence", "Active")
            local integer catPower = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNControlMagic", "SpellPower")
            local integer catCooldown = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Cooldown")
            local integer catAtkSpeed = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Attackspeed")
            local integer catMress = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRunedBracers", "Magic-Resistence")
            local integer catConsum = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPotionGreenSmall", "ConsumAble")
            local integer catMoveSpeed = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNBootsOfSpeed", "COLON_MOVE_SPEED")
            local integer catCrit = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNCriticalStrike", "Crit")
            local integer catLifeSteal = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNVampiricAura", "Lifesteal")
            local integer catEvade = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNEvasion", "Evasion")
     
            call TasItemShopAdd5('rst1', 'bgst', 'rin1', 'ciri', 'belv')
            call TasItemShopAdd('rag1', catAgi)
            call TasItemShopAdd5('rlif', 'ajen', 'clfm', 'ward', 'kpin')
            call TasItemShopAdd5('lgdh', 'rde4', 'pmna', 'rhth', 'ssil')
            call TasItemShopAdd5('spsh', 'lhst', 'afac', 'sbch', 'brac')
            call TasItemShopAdd5('rwiz', 'evtl', 'penr', 'prvt', 'rde3')
            call TasItemShopAdd5('hval', 'hcun', 'mcou', 'cnob', 'ckng')
            call TasItemShopAdd5('rat6', 'rat9', 'ratf', 'bspd', 'gcel')
            call TasItemShopAdd5('rde2', 'clsd', 'dsum', 'stel', 'desc')

            call TasItemShopAdd5('modt', 'ofro', 'thdm', 'hlst', 'mnst')
            call TasItemShopAdd5('pghe', 'pgma', 'pnvu', 'pres', 'ankh')
            call TasItemShopAdd5('shas', 'stwp', 'ofir', 'oli2', 'odef')
            call TasItemShopAdd5('oven', 'oslo', 'ocor', 'shtm', 'I001')

            // setup custom shops
            // custom Shops are optional.
            // They can have a White or Blacklist of items they can(n't) sell and have a fixed cost modifier for Gold, Lumber aswell as a function for more dynamic things for Gold and Lumber.
            set shopObject = 'n000'
            // 'n000' can only sell this items (this items don't have to be in the pool of items)
            call TasItemShopAddShop5(shopObject, 'hlst', 'mnst', 'pghe', 'pgma', 'pnvu')
            call TasItemShopAddShop5(shopObject, 'pres', 'ankh', 'stwp', 'shas', 0)
            // enable WhiteListMode
            call TasItemShopSetMode(shopObject, true)
     
            // 'n001' can't sell this items (from the default pool of items)
            set shopObject = 'n001'
            call TasItemShopAddShop5(shopObject, 'hlst', 'mnst', 'pghe', 'pgma', 'pnvu')
            call TasItemShopAddShop5(shopObject, 'pres', 'ankh', 'stwp', 'shas', 0)
            // enable BlackListMode
            call TasItemShopSetMode(shopObject, false)
     
            // create an shopObject for 'ngme', has to pay 20% more than normal, beaware that this can be overwritten by GUI Example
            call TasItemShopCreateShop('ngme', false, 1.2, 1.2, function ShopCostFunction_ngme)
            //'I002' crown +100 was never added to the database but this shop can craft/sell it.
            set shopObject = 'n002'
            call TasItemShopAddShop5(shopObject, 'ckng', 'I001', 'I002', 'arsh', 0)
            call TasItemShopSetMode(shopObject, true)
     

            // Define skills/Buffs that change the costs in the shop
            // cursed Units have to pay +25%
            call TasItemShopAddHaggleSkill('Bcrs', 1.25, 1.25, 0, 0)

            // define Fusions
            // result created by 'xxx', 'xx' , 'x'+.
            // item can only be crafted by one way
            // can add any amount of material in the Lua version
            call TasItemFusionAdd2('bgst', 'rst1', 'rst1')
            call TasItemFusionAdd2('ciri', 'rin1', 'rin1')
            call TasItemFusionAdd2('belv', 'rag1', 'rag1')
            call TasItemFusionAdd2('hval', 'rag1', 'rst1')
            call TasItemFusionAdd2('hcun', 'rag1', 'rin1')
            call TasItemFusionAdd2('mcou', 'rst1', 'rin1')
            call TasItemFusionAdd2('ckng', 'cnob', 'cnob')
            call TasItemFusionAdd2('rat9', 'rat6', 'rat6')
            call TasItemFusionAdd2('ratf', 'rat9', 'rat9')
            call TasItemFusionAdd('rde4', 'rde3')
            call TasItemFusionAdd('rde3', 'rde2')
            call TasItemFusionAdd('rhth', 'prvt')
            call TasItemFusionAdd('pmna', 'penr')
            call TasItemFusionAdd2('arsh', 'rde3', 'rde2')

            call TasItemFusionAdd('lhst', 'sfog')

            // crown of Kings + 50
            call TasItemFusionAdd4('I001', 'ckng', 'ckng', 'ckng', 'ckng')
            call TasItemFusionAdd4('I001', 'ckng', 'ckng', 'bgst', 'bgst')
            call TasItemFusionAdd6('I001', 'ciri', 'ciri', 'belv', 'belv', 'cnob', 'cnob')
            // crown of Kings + 100, this is a joke you can not craft it because it was not added to buyAble Items
            call TasItemFusionAdd2('I002', 'I001', 'I001')

            // define item Categories
            // uses the locals from earlier.
            // An item can have multiple categories just add them together like this: catStr + catAgi + catInt
     
            call TasItemSetCategory('rst1', catStr)
            call TasItemSetCategory('bgst', catStr)
            call TasItemSetCategory('rin1', catInt)
            call TasItemSetCategory('ciri', catInt)
            call TasItemSetCategory('rag1', catAgi)
            call TasItemSetCategory('belv', catAgi)

            call TasItemSetCategory('I001', catStr + catAgi + catInt)

            call TasItemSetCategory('ckng', catStr + catAgi + catInt)
            call TasItemSetCategory('mcou', catStr + catInt)
            call TasItemSetCategory('hval', catStr + catAgi)
            call TasItemSetCategory('hcun', catAgi + catInt)
            call TasItemSetCategory('cnob', catStr + catAgi + catInt)

            call TasItemSetCategory('rat9', catDmg)
            call TasItemSetCategory('rat6', catDmg)
            call TasItemSetCategory('ratf', catDmg)
     
            call TasItemSetCategory('rlif', catLifeReg)

            call TasItemSetCategory('ajen', catAura + catAtkSpeed + catMoveSpeed)
            call TasItemSetCategory('clfm', catAura + catDmg)
            call TasItemSetCategory('ward', catAura + catDmg)
            call TasItemSetCategory('kpin', catAura + catManaReg)
            call TasItemSetCategory('lgdh', catAura + catMoveSpeed + catLifeReg)
            call TasItemSetCategory('rde4', catArmor)
            call TasItemSetCategory('pmna', catMana)
            call TasItemSetCategory('rhth', catLife)
            call TasItemSetCategory('ssil', catActive)
            call TasItemSetCategory('lhst', catAura + catArmor)
            call TasItemSetCategory('afac', catAura + catDmg)
            call TasItemSetCategory('sbch', catAura + catDmg)
            call TasItemSetCategory('sbch', catAura + catLifeSteal)
            call TasItemSetCategory('brac', catMress)
            call TasItemSetCategory('spsh', catMress + catActive)
            call TasItemSetCategory('rwiz', catManaReg)
            call TasItemSetCategory('crys', catActive)
            call TasItemSetCategory('evtl', catEvade)
            call TasItemSetCategory('penr', catMana)
            call TasItemSetCategory('prvt', catLife)
            call TasItemSetCategory('rde3', catArmor)
            call TasItemSetCategory('bspd', catMoveSpeed)
            call TasItemSetCategory('gcel', catAtkSpeed)
            call TasItemSetCategory('rde2', catArmor)
            call TasItemSetCategory('clsd', catActive)
            call TasItemSetCategory('dsum', catActive + catMoveSpeed)
            call TasItemSetCategory('stel', catActive + catMoveSpeed)
            call TasItemSetCategory('desc', catActive + catMoveSpeed)
            call TasItemSetCategory('ofro', catDmg + catOrb)
            call TasItemSetCategory('modt', catLifeSteal + catOrb)
            call TasItemSetCategory('thdm', catActive)
            call TasItemSetCategory('hlst', catActive + catConsum + catLifeReg)
            call TasItemSetCategory('mnst', catActive + catConsum + catManaReg)
            call TasItemSetCategory('pghe', catActive + catConsum)
            call TasItemSetCategory('pgma', catActive + catConsum)
            call TasItemSetCategory('pnvu', catActive + catConsum)
            call TasItemSetCategory('pres', catActive + catConsum)
            call TasItemSetCategory('ankh', catConsum)
            call TasItemSetCategory('stwp', catActive + catConsum + catMoveSpeed)
            call TasItemSetCategory('shas', catActive + catConsum + catMoveSpeed)
            call TasItemSetCategory('ofir', catOrb + catDmg)
            call TasItemSetCategory('oli2', catOrb + catDmg)
            call TasItemSetCategory('odef', catOrb + catDmg)
            call TasItemSetCategory('oven', catOrb + catDmg)
            call TasItemSetCategory('oslo', catOrb + catDmg)
            call TasItemSetCategory('ocor', catOrb + catDmg)
            call TasItemSetCategory('shtm', catActive)
        endfunction
    endlibrary




ChangeLog:


v4f) fixed: undo was hidden, when any player closed the shopUI
v4e) (jass) Fixed The req-System TasItemCost did not clear the items created to measure costs
v4d) (jass) Fixed a bug that the wrong inventory item was selected.
V4c)
The ShortCutBox will glow, when the user holds the key to add/Remove ShortCut-Entries.
(vjass) Fixed a bug with RefBox Placing.​
V4b) Fixed: After remoing the first ShortCut of Page 2, one got an empty Box without pages.
V4a)
(lua) fixed: when an item in inventory was clicked, it was not selected therefore no sell/Defuse was shown
The selected Inventory Item has now a indicator (used for Sell/Defuse).
fixed: when no refButton was used the BuyButton was inside the ButtonList
fixed: Sell/Defuse beeing hidden by other players Actions.
Doesn't create any OskeyEvents anymore, if no quickLinkKey is set.
Can now Clear the QuickLink data for a player.
Increased the distance between Text and Icon in the Buy button (new TasButtonList.fdf)
QuickLink has now a higher priority than Inventory and User.
Mats has now a higher priority than Upgrades.
With Default setup Mat, Upgrades and QuickLink fit into the top row (ButtonList 3 Cols, RefBoxes have 4 Buttons).
QuickLink can now be set by GUI.
Fixed: TooltipsBoxed were sometimes not fitting the ToolTip Text when leaving the 4:3 Screen.
More Buttons will not keep focus anymore.
Defuse and Sell don't hide anymore, instead they become unclickable. Defuse also has now an own fixed Icon. (new TasItemShop.fdf)
Defuse and Sell Tooltips are reposed to not leave the Screen.
Can now Set the TooltipTextSizeX in the code config.
Added TooltipTextSizeXBix which is used for Tooltips that have x chars or more
V4)
Buttons will not keep focus anymore.
The ButtonList can be scroll while any non interactive part of TasItemShop is Hovered.
(vjass) fixed a bug with Upgrade Page, using wrongly offset of material for displaying.
(vjass) fixed material provided (again)
fixed an error when canSellItems or canDefuse were disabled
Can now Tooggle between Or/And logic for multiple selected categories.
Displaying Fusions costs is now less taxing.
Added a Config to (dis)(en)able the TargetUnitEvent, to select MainShoppers with right click.
Outsourced the parentselection for the UI Parent into a custom Function GetParent.
Added an Highlighter for currently selected in the ButtonList.
Added user Customizeable ShortCuts.​
old
V3c) (vjass) fixed a bug that did not mark mats provided in some cirumstances.
V3b)
(Lua) fixed a bug when not all ref Buttons had data.
(vjass) fixed a bug with disabled canDefuse.​
V3a) Fixed the GUI Demo not evoking the Shop init.
V3)
Fixed a bug in the vjass version, it took away materials not needed for the bought item.
(could produce desyncs and wierd results)​
Added a ESC-Event Trigger which closes the Shop.
Splited GUI demo Triggers by functionality.
Added another trigger which executes the GUI triggers in a sane order.
Added config booleans to show/hide Gold/Lumber in the buyButton and for Buttons in the ButtonList
Added a config boolean to let rightlicks onto a refInventoryButton sell it or Buy another one​
Added a config boolean to show only the items of the main Unit.
Will still use material from other users.​
V2a (vjass only)
Reseted some counters fitting the Save&Load reset.​
V2
Improved Defuse
Can now Sell Items to the shop
Can now setup Gaps between Cols and Rows in the ButtonList
Displays Current position when hovering the Slider
Added a vjass version.
Fixed a bug with Undo: Droped Items were not removed.


Credits:


abfal (Custom Banshee Missile by)
ScrewTheTrees(Fred) & Niklas (reposing on window change)
Bribe
BPower
SpasMaster (feedback)
chopinski (feedback)​
Previews
Contents

TasItemshopV4f (Map)

TasItemshopV4f jass (Map)

  1. SpasMaster

    SpasMaster

    Joined:
    Jan 29, 2010
    Messages:
    1,910
    Resources:
    4
    Icons:
    2
    Maps:
    2
    Resources:
    4
    This looks simply amazing. Really adressing an years-long dream for many warcraft 3 players. :p

    I am, however, going to address the elephant in the room: Is it possible, and if yes - are you willing to make a Jass version?
     
  2. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    507
    Resources:
    8
    Models:
    1
    Spells:
    7
    Resources:
    8
    Plz a vJass version!!!
     
  3. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    It is possible in jass to get a quite alike result. And yes, I will port it to (v)jass, but I first wanted to release the Lua version and get some feedback.
    The system is quite big, porting it takes some effort/time.
     
  4. feber13

    feber13

    Joined:
    Nov 23, 2017
    Messages:
    29
    Resources:
    0
    Resources:
    0
    very good, just missing a complete inventory for the unit?
     

    Attached Files:

  5. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    What would a complete Inventory do?

    Oh maybe you mean the unit's inventory is full; over the Icons?
     
    Last edited: Nov 4, 2020
  6. SinisterLuffy

    SinisterLuffy

    Joined:
    Apr 8, 2020
    Messages:
    111
    Resources:
    0
    Resources:
    0
    One thing I notice while testing is that the inventory section would show all items of all users at the same time. I am not sure whether this was intentional or not.

    One thing that you could add is that any item that you click in inventory could make it undoable. At the moment, one could only undo items bought within the current session and only in the reverse order the items were bought. This is not desirable as an user might not want to undo the last item bought but only the item bought before it. Besides that, an user might want to sell items bought in the last session. Of course, one can sell items the default way, but still why not add such a feature for unity and convenience?
     
  7. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    This was intentional it displays all items valid as material the current shoppers provide. One could argue that this is nonsense.

    Undo is not defuse. It means that you revert a shopping action, done in the current shopping Phase. If that was fusing, stacking or simple buying does not matter. You get gold/lumber/material back but lose items/stacks. It also has to happen from last to first to not run into logical problems: like when you buy material A, then buy fusion B which uses material A. How could you undo buying material A without undoing fusion B first?
    The whole undo intention is to revert wrong buys: "On a second though I didn't wanted that thing can I give it back?"

    I could add a seperate defuse feature, which would allow to destroy fusions to get the material back. That feature would not be limited by current shopping Phase.
     
    Last edited: Nov 4, 2020
  8. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    1,500
    Resources:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    3
    Horrendously useful and amazing.
     
  9. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    507
    Resources:
    8
    Models:
    1
    Spells:
    7
    Resources:
    8
    @Tasyen this is amazing and i pretend to give some more feedback when a vJass version is released, but for now a few things that i want to ask:

    1º - Is it possible to make the window re-sizable? It look a bit small and the items seem a bit clumped up, specially vertically.

    2º - Is it possible to make the window close when clicked outside? I noticed that to make the shop close it's necessary to click on some other unit.

    3º - Maybe add a Sell button to allow items to be sold while the shop is opened.

    That's it for now. As soon as you release a vJass version i will dive deeper into.
     
  10. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    The window becomes bigger or smaller with the amount of rows/cols and the size & amount of the elements. There is no add additional Size.
    Most impactful on the window Size are the Buttons in the List with lacking code setup, except for col and row amount as seen in the images. This is because how it is done in TasButtonList and this system uses TasButtonList.
    The size of the category/reference Buttons can be changed by code alone. They also will affect the size of the window, but mostly y wise and to a smaller degree then the ButtonList.

    One can also hide it, by right clicking one of the shoppers (in the UI) which selects that Unit.

    Maybe, I have some Ideas how one could do that but unsure if they are good/practical.

    One would be to start a small timer in the player mouse click event then have another trigger which has MousUP-events for all frames of the custom UI. Then If a counter inside the clicking and the timerAction is not the same then the click would be treated as in the outside and close the UI. This sounds heavy to me.

    Some other idea would be to have a big hidden button layerwise below the UI but across the whole screen. When clicked it would close the UI and itself. This would be much less effort, but it mght block the current mouse click making the world less accessable while shopping. One first would need to perform a click to use the Button then click again to do the actualy thing one wana do.

    But this idea colides with select the main shoper using the default warcraft 3 select shop user, right click onto the unit/activade button onto an unit.

    Could do that one, It also would allow different prices and one would have to think about the interaction with the already made custom price system.
    But like with a Defuse feature. I first would have to make the UI be aware of the selected item, right now it only knows the selected itemCode.
     
    Last edited: Nov 6, 2020
  11. feber13

    feber13

    Joined:
    Nov 23, 2017
    Messages:
    29
    Resources:
    0
    Resources:
    0
    Sorry for my English is not very good, I was referring to an inventory for hero, to add armor, helmet something similar
     
  12. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    Sounds like you talk about an rpg inventory with items used in specific slots. Then my answer is no, TasItemShop only sells items (in the future maybe also buy items and defuse). I don't want it to alter the inventory used in Warcraft 3.
     
    Last edited: Nov 8, 2020
  13. SpasMaster

    SpasMaster

    Joined:
    Jan 29, 2010
    Messages:
    1,910
    Resources:
    4
    Icons:
    2
    Maps:
    2
    Resources:
    4
    Quite alike.. would there be something different? If so, what do you think that would be?

    Amazing. Cannot wait <3

    In a way, it currently mimicks the behaviour of default Warcraft 3 shops.
     
  14. feber13

    feber13

    Joined:
    Nov 23, 2017
    Messages:
    29
    Resources:
    0
    Resources:
    0
    I like the interface you have to buy, it would be good to only use that interface as an rpg inventory but it is only a mention, I still like your purchase / sale system
     
  15. apsyll

    apsyll

    Joined:
    Aug 28, 2015
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    just post to vote
     
  16. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    The result from a user view will be the same, but the code behind differs. With that maybe also the API.

    One feature differes: Double clicks in the button list. In the Lua version it detect the local time difference with a Lua-function which works during Pause. In jass this would have to be handled by a Timer which doesn't run during pause.

    The used ButtonList system is "generic" and one can have many of them at the same time in one map, requires some work though.
    TasItemShopUI is less generic there can only be one at the same time.
     
  17. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    507
    Resources:
    8
    Models:
    1
    Spells:
    7
    Resources:
    8
    @Tasyen , I've been playing around with the vJASS version of the system and i found out a few bugs and i have a few suggestions.

    First, acquiring items using the resources window is not working. Also it looks like the first item from the top right corner of the list is unable to be acquired more than once, although gold is being spent.
    [​IMG]

    Code used in the example:
    Code (vJASS):

    library ItemShop initializer Init requires TasItemShop
        struct Shop
            static constant integer unit = 'n000'

            static method create takes nothing returns thistype
                local integer damage       = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSteelMelee", "Damage")
                local integer armor        = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpOne", "Armor")
                local integer strength     = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNGauntletsOfOgrePower", "Strength")
                local integer agility      = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSlippersOfAgility", "Agility")
                local integer intelligence = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNMantleOfIntelligence", "Intelligence")
                local integer health       = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNFireCrystalElement", "Health")
                local integer hpRegen      = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRegenerate", "Health Regeneration")
                local integer mana         = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPendantOfMana", "Mana")
                local integer manaRegen    = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNSobiMask", "Mana Regeneration")
                local integer orb          = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness", "Orb")
                local integer aura         = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNLionHorn", "Aura")
                local integer active       = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNStaffOfSilence", "Active")
                local integer spellPower   = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNControlMagic", "Spell Power")
                local integer cooldown     = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Cooldown")
                local integer attackspeed  = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpOne", "Attack Speed")
                local integer magicRes     = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNRunedBracers", "Magic Resistence")
                local integer consumable   = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNPotionGreenSmall", "Consumable")
                local integer moveSpeed    = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNBootsOfSpeed", "Movement Speed")
                local integer critical     = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNCriticalStrike", "Critical")
                local integer lifeSteal    = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNVampiricAura", "Life Steal")
                local integer evasion      = TasItemShopAddCategory("ReplaceableTextures\\CommandButtons\\BTNEvasion", "Evasion")

                // Life Crystal
                call TasItemShopAdd('I000', health)
                // Fused Life Crystals
                call TasItemShopAdd('I001', health)
                call TasItemFusionAdd3('I001', 'I000', 'I000', 'I000')

                call TasItemShopCreateShop(unit, false, 1.0, 1.0, null)
                return 0
            endmethod
        endstruct

        private function Init takes nothing returns nothing
            call Shop.create()
        endfunction
    endlibrary
     

    Now a few questions and suggestions:
    • Could you add a configuration global so we can hide/show the Lumber/Gold icons in the list and in the buy button?
    • Could you add a configuration global that would allow us to change the USER, INVENTORY, RESOURCES AND UPGRADES windows to be replaced relative to the main frame? For example, let's say i wanted the user window to be on the bottom left corner of the main frame, stuff like that.
    • Is it possible to add a functionality that when a player presses the ESC key and the shop is open for that player, then the shop window is closed. That would be intuitive for a lot of people i presume.
    • Is it possible to only show in the INVENTORY window the items of the current user instead of all the items of units belonging to the player (as a configuration maybe?).
    • Is it possible to make the Shop window be in front of the other native UI? If mode than 7 rows are added then it overlaps and it stays underneath the other frames.
    • One intuitive suggestion i want to give you is to make Right Clicking or Double Clicking in an item that is in the INVENTORY window to be sold instead of bought. That's how it usually work in other games, maybe add a configuration to control that functionality.
    That's it, i know it's a lot, but overall this is a groundbreaking awesome system that everyone should implement in their maps, really good job!
     
  18. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,735
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    Thanks for your feedback and bug report.
    I looked into that bug. The bug is deeper then you think, but easy to fix. The vjass version uses a global storage for the materials and it did not check, if the current bought item is a fusion before taking whatever material currently was in the material storage. If it is not a fusion then the material in the storage is the one from the last shown button in the Buttonlist.

    That would also explain a random desync I encountered when testing it. And why it did not always happen in the test map.

    The idea was that one chooses a Frame from fdf. If that Frame would not have them you would not be able to see them.
    But I can add a show flag.

    Possible but would require some big changes. It would mean that the whole bottom blocks position is config able.

    I''ll do that.

    It is. You have to change the parent of the superParent of TasItemShop inside function TasItemShopUICreate.

    On default, when TasItemShop runs in 1.32+, it uses BlzGetFrameByName("ConsoleUIBackdrop", 0) as parent which is below the default UI but requires no additinoal work.
    For 1.31 it creates a moded Leaderboard used as Parent which is above the default UI but requires additional work.

    This parentFrames were choosen to allow TasItemShop to leave the 4:3 Screen.
    You could disable the reforged path and always use the custom Leaderboard thing.

    Makes sense. I probably added that.
    But I think the Refbuttons are not double click aware, which was on purpose because clicking it would change the content.

    it is possible, I also was doubing the useage of seeing all of them.

    Updated to V3)
    Fixed that (vjass) bug with spending unneeded material which could differ for each player -> possible desync.
    Can close Shop with ESC
    Improved GUI demo
    Added configs:
    public boolean buttonListShowGold = true
    public boolean buttonListShowLumber = true
    public boolean buyButtonShowGold = true
    public boolean buyButtonShowLumber = true
    public boolean inventoryRightClickSell = true
    public boolean inventoryShowMainOnly = true // (false) show all items currently useable
     
    Last edited: Nov 13, 2020
  19. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    507
    Resources:
    8
    Models:
    1
    Spells:
    7
    Resources:
    8
    Hey @Tasyen i did more tests and imported the system to one of my projects and i have more feedback.
    • Clicking in any other frame other then the item list makes pressing ESC to not work properly and not close the window.
    • Is it possible to make the mouse scroll work when the cursor is not over the items? It would make for a more clean navigation through the shop, without the tool tips staying in the front of other items.
    • Is it Possible to make the background color of Tool Tips more opaque? Sometimes it's hard to read.
    • Is it possible to make Tool Tips that goes to far down the screen and get cut off to grow in another direction? (I attached an image showing the problem)
    • The up and down arrows for the Upgrade window are not working. I don't know if it can cause more problems related to desyncs and such.
    • Is it possible to make the Category Filtering use an OR logic instead of an AND logic. It would make searching for common categories easier. Maybe a toggle or check box to determine the logic used by filtering.
    • I noticed quite a bit of stuttering and fps drops when the shop is opened and there is a lot of items in the shop, it might by a good idea to give it a look for optimizations.
    • Would it be possible to Highlight the currently selected item in the list to glow in a different manner, like this for example: HighLight.jpg .
    • In the same way, would it be possible to create a functionality that would allow the users to let's say Shift + Click a sequence of items and keep them highlighted? Let's say i wanted to highlight the items i want to buy, so i Shift + Click them and they stay Highlighted.
    Shop.png