• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

TasItemshop

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​

GUI

Lua

vjass


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.​
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:
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()
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.
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.
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.
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.​
JASS:
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:
JASS:
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:

v4m (jass) v4g (Lua) Fixed a desync problem with ItemCodes aded to QuickLink/ShortCuts
v4g) (jass) Fixed a bug removing wrongly Items. Triggered by Sell -> Undo -> Buy.
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.​
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)​
pick-a-chew (feedback)​


Previews
Contents

TasItemshopV4h (Map)

TasItemshopV4m jass (Map)

Level 3
Joined
Nov 23, 2017
Messages
31
very good, just missing a complete inventory for the unit?
 

Attachments

  • upload_2020-11-4_15-17-37.png
    upload_2020-11-4_15-17-37.png
    312 bytes · Views: 161
Level 1
Joined
Apr 8, 2020
Messages
110
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?
 
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.
This was intentional it displays all items valid as material the current shoppers provide. One could argue that this is nonsense.

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?
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:
Level 20
Joined
May 16, 2012
Messages
635
@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.
 
Is it possible to make the window re-sizable? It look a bit small and the items seem a bit clumped up, specially vertically.
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.

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.
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.

3º - Maybe add a Sell button to allow items to be sold while the shop is opened.
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:
Level 3
Joined
Nov 23, 2017
Messages
31
Sorry for my English is not very good, I was referring to an inventory for hero, to add armor, helmet something similar
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
It is possible in jass to get a quite alike result.
Quite alike.. would there be something different? If so, what do you think that would be?

And yes, I will port it to (v)jass
Amazing. Cannot wait <3

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.
In a way, it currently mimicks the behaviour of default Warcraft 3 shops.
 
Level 3
Joined
Nov 23, 2017
Messages
31
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
 
Quite alike.. would there be something different? If so, what do you think that would be?
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.

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
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.
 
Level 20
Joined
May 16, 2012
Messages
635
@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.
3PqN0Zk.gif

Code used in the example:
JASS:
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!
 
Thanks for your feedback and bug report.
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.
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.

Could you add a configuration global so we can hide/show the Lumber/Gold icons in the list and in the buy button?
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.

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.
Possible but would require some big changes. It would mean that the whole bottom blocks position is config able.

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.
I''ll do that.

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.
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.

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.
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.

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.
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:
Level 20
Joined
May 16, 2012
Messages
635
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
 
Thanks for your feedback. It is quite helpful.
Clicking in any other frame other then the item list makes pressing ESC to not work properly and not close the window.
will be fixed. I forgot to make other buttons lose focus on click.

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.
I can extend it to the whole part of the screen TasItemShop-UI takes, without much effort. Outside of it is more work and/or has unwanted sideffects.

Is it Possible to make the background color of Tool Tips more opaque? Sometimes it's hard to read.
The transparenzy effect can be disabled by using different BACKDROPs, without the fdf Action
BackdropBlendAll, . One could change the frame in the fdf that manages that.
I add that to the other chooseable Backdrops.

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.
That is a a simple copy paste error. It reads the wrong offset value when it is updated in the vjass version there is one function for each refbutton group which are quite similiar and were copy pasted.
The upgrade clicking code uses the correct one. Therefore it should only a visual bug.

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.
That is possible.

Would it be possible to Highlight the currently selected item in the list to glow in a different manner, like this for example:
Not in the current Version of TasItemShop. But this is possible to do.

One would add a Highlight or Backdrop Frame then have such data marked and show/hide that hightlight/Backdrop in the updateFunction when the data is marked for the local player.

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)
With additionals calculations and when saving the positions of the buttons/tooltips then one could. TasItemShop doesn't have that feature right now.
But you also could choose a fixed Tooltip position in which that does not happen.
 
Level 20
Joined
May 16, 2012
Messages
635
@Tasyen i found a visual bug i think. In the Requires window the checks some times do not show when searching without filters but they do work when a filter is applied. I don't know if it has some to do with the amount of items being shown but in it's misleading sometimes.

ccvWpor.gif

EDIT: @Tasyen found a few more things.

- When scrolling the item in the list that the cursor ends up have its Tool Tip bugged, like so:
Shop2.png

- I noticed that scrolling down increases the stuttering in the system. When at the top of the list there is no stutter and the more you scroll down the more noticeable it becomes. Maybe are you increasing the number of items in the list being loop upon instead of just those that are visible?

EDIT 2: Found another odd behavior. The shop closes by itself sometimes without me pressing anything:

qBGS2iG.gif
 
Last edited:
Which version you used? if it is the newest then my hotfix (3c) for is mat provided failed.

- When scrolling the item in the list that the cursor ends up have its Tool Tip bugged, like so:
I am aware of that bug. Sometimes the tooltipBox has problems with finding the position of the TooltipText correctly outside of 4:3-Screen. Maybe another approach works better, but it requires more work. The current approach forgets the box after it was created and only care about the content.

- I noticed that scrolling down increases the stuttering in the system. When at the top of the list there is no stutter and the more you scroll down the more noticeable it becomes. Maybe are you increasing the number of items in the list being loop upon instead of just those that are visible?
Only the shown Buttons are updated. Fusions take quite more calculation than non Fusions (because of the displayed costs). Which would be your request for optimization.

EDIT 2: Found another odd behavior. The shop closes by itself sometimes without me pressing anything:
Unsure why that happens.
TasItemShop can close on ESC, onOrder, onSelect and in the UpdateTimer when no shop for the player is active anymore.
 
Level 20
Joined
May 16, 2012
Messages
635
Which version you used? if it is the newest then my hotfix (3c) for is mat provided failed.

I'm using the latest version.

Unsure why that happens.

I noticed that i mostly happens when units are in combat, Will investigate more.

EDIT: Found out that the self closing problem was caused by the OnOrder event. I'm not sure why you are using it but by disabling it the system works as expected.
 
Last edited:
The onOrder event is used to change the main shoper, by right clicking him in the world. As well by the User Refbuttons.

Updated V4)
Buttons will not keep focus anymore.
Can now also scroll the buttonList while pointing at any non interactive space in the TasItemShop-UI.
(vjass) fixed a bug with Upgrade Page, using wrongly offset of material for displaying.
(vjass) fixed material provided (again)
fixed a error when canSellItems or canDefuse were disabled (inside SetSelected the Thread crashed when hiding them).
Added a CategoryMode Button. It makes items to have either fit one or all selected categories.
Skip cost calcling when a Button does not display Gold nor Lumber.
Displaying Fusions costs is now less taxing.
Added a Config to (dis)(en)able the TargetUnitEvent, to select MainShoppers with right click.
Added a new Function GetParent below the globals block which is used to choose the parent for TasItemShop. It is important to checkit out if you have modified UI and want TasItemShop to leave the 4:3 Screen.
Added an additional Highlighter to show currently selected Data in the ButtonList.
This requires the updated TasItemShop.fdf​
Added a new RefBox ShortCuts. ShortCuts can be set by the User: By Holding shift and clicking a Button in the ButtonList. The clicked Item will be added to the shortcuts. When Holding Shift an clicking a ShortCut button will remove the shortCut-Data. Internal this Feature is called QuickLink.
 
Level 20
Joined
May 16, 2012
Messages
635
Fantastic Job @Tasyen

It's pretty much perfect right now. Systems like this make me wish i was a Resource Reviewer just so i could give it a Director's Cut score, It deserves way more recognition. Just one thing i noticed it the latest version, the User and Inventory windows are overlapping:

Overlap.png

If i may suggest one final thing to be added to the system is a Stash functionality, where players can buy items even if there is no unit of theirs nearby. When buying items in this manner the items are not created right away but stay "saved" in a table and when a valid unit with inventory comes in range of the shop it is allowed to retrieve those stashed items by left clicking the ones the player wants to move from the stash to the unit's inventory. Right Click would sell the items normally.
 
Updated to V4c)
It should fix that overlapping bug for the refbox in the vjass version. (A small fitting box wrongly was registered onto the last row but was placed at an earlier row)
While holding the ShortCut Key (default) the shortcut box will glow.

Disclaimer: There is a bug with Mouseclicking and ShortCut Key when clicking a UI BUtton with the Mousebutton and the shortCut key (at the same time). Then it can happen that the adding/removing process is not started/finished.
 
Last edited:
Holy crap, this looks great!
Will fiddle around with it and and see if I can replace my currently very basic shop that start to get hard to navigate... And will probably get worse as I want to start to add more items xD

Bug found in jass-edition, reproduce by:
  1. Buy 3 items
  2. Sell the item in the first slot
  3. Click the item in the second slot
  4. It will say the item in the third slot and if you press sell, it will sell the item in the third slot
2nd item is selected (Mantle of Intelligence +3 in this case) but hovering or doing sell result in 3rd item being sold (Slippers of Agility in this case)
upload_2020-11-25_23-10-48.png
 
Last edited:
Level 12
Joined
May 16, 2020
Messages
660
Many thanks for this shop system Tasyen, another system which is exactly what was missing from wc3.
I just tried to customize it to my needs, but have some questions (and probably some follow-up questions).

Is it possible to:
  1. Remove the "shortcut" section entirely when it contains nothing?
  2. Remove the "user" section?
  3. Add the word "Buy" before the item which you buy at the bottom-center? So for example "Buy Orb of Frost"
  4. Align the "gold icon" to the item text on the left side in the main window?
And some handling questions:
  • How can I center the window like chopinski in the middle of the screen, but also have the window on top the day-night cycle clock? For me the window is behind the day-night clock.
  • If I have >60 items, would you recommend to split them across 2 shops for performance reasons?
 
Remove the "shortcut" section entirely when it contains nothing?
The shortcut section is always shown when one uses it.
Remove the "user" section?
The user Section can be removed by changing the number in the globals of TasItemShop:
public integer refButtonCountUser = 0

one can do the same with all of this boxes, but it will stay that way for the whole game.

Add the word "Buy" before the item which you buy at the bottom-center? So for example "Buy Orb of Frost"
with a a small edit to updateItemFrame
if createContext == CREATE_CONTEXT_CURRENT
call BlzFrameSetText(BlzGetFrameByName("TasButtonText", createContext), "Buy: " + GetObjectName(data))
endif

Align the "gold icon" to the item text on the left side in the main window?
you could either change the position in fdf or add such a line inside the creation function.

How can I center the window like chopinski in the middle of the screen, but also have the window on top the day-night cycle clock? For me the window is behind the day-night clock.
you have to alter the Parent in the public function GetParent takes nothing returns framehandle to always use the else path

If I have >60 items, would you recommend to split them across 2 shops for performance reasons?
The amount of items don't really matter, the amount of Buttons in the List do.
 
V4e) Fix for the vjass version.
The req-System TasItemCost did not clear the items created to measure Item Costs. This happened because the rect that should find the items were created with a wrong Size and could not find the items.
Replaced the setup a little bit.
Instead of a Rect one now defines a Size, X and Y which also is the position of the Hidden Shop.
 
Level 1
Joined
May 14, 2015
Messages
7
Hi, I added your Itemshop to my map, and when a friend and I tried to test it, the last person that opened the shop gets a desync disconnect after about 40 seconds of map init. Any idea what might cause this? I changed nothing in your scripts. Just kept everything stock to try.

After some googling I found: "Remove GetLocalPlayer() Script calls, because they are known to cause desyncs." Would that be possible?
 
Last edited:
Level 1
Joined
May 14, 2015
Messages
7
You used the Lua or vjass version?

if GetLocalPlayer() would be the reason then everyone would desync not only one Player. But true the wrong usage of GetLocalPlayer brings desync.

I used the Lua version. The only other Lua scripts in my map are a damage detection system and I regularly use that, so I dont think the desync could be from it. If you want I can send you my map via pm. So usually the last person to have the shop open desyncs. We can always trigger it with: I open it and close it then he opens it and closes it, then after 30-40 secs he desyncs. Not buying anything, just open and close.
 
Level 1
Joined
Dec 15, 2012
Messages
4
Hey, first of all your shop system is really awesome! I've got a question though. I'm really terrible with JASS/vJASS and sometimes not even that good with GUI and I've been trying to wrap my head around something, I want to add more items (more powerful items) to shops as the game progresses - this much I've managed to do - but I can't figure out how to add categories to those newly added items UNLESS they are made using the GUI functions for categories. I'd rather not use the GUI functions to make categories because it would mean I would have to redo all my categories. How would I go about adding the categories to those items added mid-game without creating the items and categories using GUI? Thank you!

PS. There's a bug that if you buy a tome of experience/greater experience with a unit that can't gain exp the game will crash for everyone in that game. We've tested this with pack mule only but I think it would happen with any other unit that doesn't gain exp as well. Also if you buy stackable items when all inventory slots are already filled but you have room for more stackable items, all those items are dropped on the ground.
 
TasItemShop does not expect that new categories are added after the Shop was created. Therefore one would have to add the data and create the Category Button oneself.
One could do it like that though one runs into problems if you need a new row, Because this code does not care for it.
JASS:
// the Image used for the category
local string icon = BlzGetAbilityIcon('hfoo')
// the tooltip Text shown when hovering the new Button
local string text = "FootmanCat"
local integer newCat = TasItemShopAddCategory(icon, text)
local integer newIndex = CreateToggleIconButtonSimple(TasItemShop_FrameCategoryBox, newCat, GetLocalizedString(text), icon)
// place the new Button to right of the last created
call BlzFrameSetPoint(ToggleIconButton_Button[newIndex], FRAMEPOINT_TOPLEFT, ToggleIconButton_Button[newIndex - 1], FRAMEPOINT_TOPRIGHT, 0.003, 0)
// add the new Category Button to the Category Button group
call ToggleIconButtonGroupAddButton(1, newIndex)

// set category of an itemCode to newCat
call TasItemSetCategory('crdt', newCat)

There's a bug that if you buy a tome of experience/greater experience with a unit that can't gain exp the game will crash for everyone in that game
That is a wacraft 3 problem, with non-Heroes that can use items.

Also if you buy stackable items when all inventory slots are already filled but you have room for more stackable items, all those items are dropped on the ground.
TasItemShop does not handle stacking itself. You have a custom item stacking or enabled the item stacking feature in gameplay constants? If yes then my code does something wrong.
 
Level 1
Joined
Dec 15, 2012
Messages
4
TasItemShop does not expect that new categories are added after the Shop was created. Therefore one would have to add the data and create the Category Button oneself.
One could do it like that though one runs into problems if you need a new row, Because this code does not care for it.
Thank you for helping, however I think I'll just stick to creating multiple shops and then replacing the current shop at some point in the game with improved wares because I don't want to create new categories, instead I'd want to use the existing ones for the newly added items.
The main problem with this solution is that if someone is using the shop at the time it gets replaced the interface will close for them and they can't undo a purchase if they just bought something by accident.
Anyway though it seems like this is much easier solution than trying to code adding new items that would use existing categories, right?

TasItemShop does not handle stacking itself. You have a custom item stacking or enabled the item stacking feature in gameplay constants? If yes then my code does something wrong.
I have only enabled the item stacking feature in gameplay constants. I don't have any kind of custom script handling stacking.
I was able to replicate this in your provided map by enabling item stacking in gameplay constants and then moving all except for one hero out of the range of shops (if I didn't move them, then the items would go into the inventory of another hero instead of being dropped) and then buying inventory full of stuff, leaving stacking room for greater healing potions and then buying greater healing potions and they would just drop on the ground.

Actually I have another question, is it possible to modify the gold/lumber cost of more than just one shop? If it is, I couldn't figure out how to do it regardless of trying hard. (Again, that is probably just me being bad at coding). I would like to have a custom shop/shops with increased prices if it is possible.

Also I have a feature suggestion, but it's probably not feasible to add nor wanted by a lot of people so feel free to ignore it if you want. Anyway, my suggestion is the possibility to add stock amounts, delays and refresh times similar to how Warcraft 3 normally handles shop item availability.
 
Level 4
Joined
Nov 4, 2019
Messages
47
Hello. Is it possible to make Shortcuts (I want to change them to "recommendations" for each hero and store.) and categories individual for each store? (Each store sells its own type of items, so as not to confuse the player.)
 
Level 12
Joined
May 16, 2020
Messages
660
Hi Tasyen,

I really struggle to adjust this system to my needs. I managed to add the "Buy" as you suggested above, but the rest is eluding me.

Some issues:
  • How to I position the shop window in the "center" and "top" of the screen and "in front of the clock"? I know you answered on this, but I didn't understand what you meant. Can you please write this more detailed / for noobs?
you have to alter the Parent in the public function GetParent takes nothing returns framehandle to always use the else path
  • Where do I define what items the shop sells? I honestly did not find this in the GUI nor "TasItemshop" trigger
  • Is it possible to show the little window with the item description (when hovering over an item) besides the shop window, not where the mouse it? Since the window is transparent, it's a bit hard to read the text of the items.
  • In the "ItemshopGUI Init Shop", what is the "Mats[1]" and "Mats[2] function doing?

WC3ScrnShot_042421_004848_001.png


Cheers!
 
Hello. Is it possible to make Shortcuts (I want to change them to "recommendations" for each hero and store.) and categories individual for each store? (Each store sells its own type of items, so as not to confuse the player.)
no, quicklink was created to be player based. Making it shopbased would require code changes.


Where do I define what items the shop sells? I honestly did not find this in the GUI nor "TasItemshop" trigger
TasItemShop supports a WhiteList & BlackList shop system. The ItemPool for BlackList shop is defined in Trigger ItemshopGUI Init Items and in the jass file TasItemShopUserInit.
While the WhiteList shops only sell what you told this shop to sell.

In the "ItemshopGUI Init Shop", what is the "Mats[1]" and "Mats[2] function doing?
Lazy to have less variables.
It either makes the shop only sell this items or makes them not sell them. Depends if that shop is a WhiteList shop or not.
A BlackList shop will sell any common sellable item aslong it is not blacklisted. (WhiteList = false)
A WhilteList shop will only sell this items (kinda like the normal wc3 shops). (WhiteList = true)

How to I position the shop window in the "center" and "top" of the screen and "in front of the clock"? I know you answered on this, but I didn't understand what you meant. Can you please write this more detailed / for noobs?
To place the Shop to the center top of the screen below the clock (y-wise) do following:
you scroll to the start of the globals block of TasItemShop.
Now you change
JASS:
public real xPos = 0.0
public real yPos = -0.02
public boolean posScreenRelative = true
public framepointtype posPoint = FRAMEPOINT_TOPRIGHT
->
public real xPos = 0.4
public real yPos = 0.58
public boolean posScreenRelative = false
public framepointtype posPoint = FRAMEPOINT_TOP

Is it possible to show the little window with the item description (when hovering over an item) besides the shop window, not where the mouse it? Since the window is transparent, it's a bit hard to read the text of the items.
You could remove the glass effect by changing the fdf.
The glass effect is removed in TasButtonList.fdf by removing/disabling the line
BackdropBlendAll, in Frame "BACKDROP" "TasButtonListTooltipBox" {

BackdropBlendAll, is below BackdropEdgeFile "ToolTipBorder", and above Frame "TEXT" "TasButtonListTooltipText" INHERITS "TasButtonListTextTemplate" {

it seems I did not add the feature to place the box next to the shop automatically but one can give it a fixed position on screen. Therefore you would need to give it a fixed position on screen; scroll to top of globals:
you remove the comment // of //public framepointtype toolTipPosPointParent = null
and add // infront of public framepointtype toolTipPosPointParent = FRAMEPOINT_BOTTOMRIGHT
Then you pick a fitting x/y for
public real toolTipPosX = 0.0
public real toolTipPosY = -0.052

If you want the tooltip right of the Shop UI it is also smart to change
public framepointtype toolTipPosPoint = FRAMEPOINT_TOPRIGHT
into
public framepointtype toolTipPosPoint = FRAMEPOINT_TOPLEFT
 
Level 12
Joined
May 16, 2020
Messages
660
Thank you so much! Finally got it to work.

You could remove the glass effect by changing the fdf.

I tried both glass and static window, and I actually prefer to turn off the glass look over the other. Maybe others will also prefer this look:
Image.PNG



But I do have some other questions:

1) I just noticed that the "Buy" text was added in front of ALL items. I want to only change the text at the bottom, and leave the names above unchanged (or, if that is simpler, just have the text "Purchase" below). Not sure if I did something wrong, I used this guidance from above at the following place in the TasItemShop:

with a a small edit to updateItemFrame
if createContext == CREATE_CONTEXT_CURRENT
call BlzFrameSetText(BlzGetFrameByName("TasButtonText", createContext), "Buy: " + GetObjectName(data))
endif

vJASS:
    public function updateItemFrame takes integer createContext, integer data, boolean showGold, boolean showLumber returns nothing
        local integer lumber
        local integer gold
        local integer playerIndex = GetPlayerId(GetLocalPlayer())
        if createContext != CREATE_CONTEXT_CURRENT then
            call BlzFrameSetVisible(BlzGetFrameByName(buttonListHighLightFrameName, createContext), MarkedItemCodes.boolean[data])
        endif
        //set UpdateCounter = UpdateCounter + 1
        //call BlzFrameSetText(UpdateCounterText, I2S(UpdateCounter))

        call BlzFrameSetTexture(BlzGetFrameByName("TasButtonIcon", createContext),  BlzGetAbilityIcon(data), 0, false)
        call BlzFrameSetText(BlzGetFrameByName("TasButtonText", createContext), "Buy " + GetObjectName(data))

        call BlzFrameSetTexture(BlzGetFrameByName("TasButtonListTooltipIcon", createContext), BlzGetAbilityIcon(data), 0, false)
        call BlzFrameSetText(BlzGetFrameByName("TasButtonListTooltipName", createContext), GetObjectName(data))
        call BlzFrameSetText(BlzGetFrameByName("TasButtonListTooltipText", createContext), BlzGetAbilityExtendedTooltip(data, 0))

        if StringLength(BlzGetAbilityExtendedTooltip(data, 0)) >= toolTipLimitBig then
            call BlzFrameSetSize(BlzGetFrameByName("TasButtonListTooltipText", createContext), toolTipSizeXBig, 0)
        else
            call BlzFrameSetSize(BlzGetFrameByName("TasButtonListTooltipText", createContext), toolTipSizeX, 0)
        endif



2) Can I somehow add an effect and sound when an item is fused / sound effect when item is sold?

3) Can I change the ugly "reforged" default icon? I don't know why Blizzard changed Samwise's beautiful picture, but I wanna get rid of this purple-haired lady

4) How can I change the size of the item buttons? I played around with "public real refButtonSize = 0.02", but this didn't seem to change anything


5) For aestetic reasons: I'm still trying to align the gold icon + text to the left, so that the item text and gold icon are nicely aligned (see #1 in the image). Could you please give more detail on where in the fdf I would need to change something?

you could either change the position in fdf or add such a line inside the creation function.

Also, ideally I'd also like to align the gold icon + text at the bottom of the shop to the same level. Currently, the gold is "right, top", and the "BuyDefault string" "left, middle" aligned. So if possible it should be "right, middle" and "left, middle" (see #2 in the image)

***

Edit: I think there is a bug. If you move your Hero to the center of the map, you get the shop arrow on your head, regardless if a shop is nearby or not. Tested this both in my map and in yours (after moving the middle shop away). This is not intended, right?

See here:
WC3ScrnShot_051521_105847_001.png
 
Last edited:
1) I just noticed that the "Buy" text was added in front of ALL items. I want to only change the text at the bottom, and leave the names above unchanged (or, if that is simpler, just have the text "Purchase" below). Not sure if I did something wrong, I used this guidance from above at the following place in the TasItemShop:
I told you to do add an if in which you compare the createContext it will filter out the other Buy-Buttons. For this other Buy-Buttons you have to set the text without the prefix but you still need to set it.
The if can be found and copy paste from the same function a little bit above

2) Can I somehow add an effect and sound when an item is fused / sound effect when item is sold?
Yes, by adding such a feature into the function that creates an item. But your question is likely How.
you find public function BuyItem in library TasItemShop
there is a line which creates the item
set newItem = CreateItem(itemCode, GetUnitX(ShoperMain[playerIndex]), GetUnitY(ShoperMain[playerIndex]))
next to it you could play sounds/effects. at the spot you also have a local boolean isFusion telling if a fusion was created.

3) Can I change the ugly "reforged" default icon? I don't know why Blizzard changed Samwise's beautiful picture, but I wanna get rid of this purple-haired lady
The Image is at replaceabletextures\commandbuttons\btntemp or war3.w3mod:_hd.w3mod:replaceabletextures\commandbuttons\btntemp.dds.
Inside the fdf at some spots it is used as default. You could change the fdf's default Images used or replace it in your map with a custom imported one.

it can also be found in GameInterface with the key DefaultButton, but I did not use that for TasItemShop, kinda bad now that I think about it.

4) How can I change the size of the item buttons? I played around with "public real refButtonSize = 0.02", but this didn't seem to change anything
refButtons are this Buttons below the Buyable options. They represent upgrades, material, quicklinks hold items, buyers.
The Size of the Icon's inside the BuyOption Buttons is not touched in the jass code. it is from the fdf. One needs to change the fdf for that. Which of them you have to change depends which button you have choosen in this global.
public string buttonListButtonName = "TasButtonSmall"
But inside that Frame it is allways Frame "BACKDROP" "TasButtonIcon" {

5) For aestetic reasons: I'm still trying to align the gold icon + text to the left, so that the item text and gold icon are nicely aligned (see #1 in the image). Could you please give more detail on where in the fdf I would need to change something?
Find the button you use in the fdf based on the jass global
public string buttonListButtonName = "TasButtonSmall"
Then you search inside the used Button
Frame "TEXT" "TasButtonTextGold"
Frame "BACKDROP" "TasButtonIconGold"
both them have a SetPoint line this one you have to change. so that Icon is with it's LEFT to "TasButtonText" RIGHT
SetPoint LEFT, "TasButtonText", RIGHT, 0.005, 0,

Edit: I think there is a bug. If you move your Hero to the center of the map, you get the shop arrow on your head, regardless if a shop is nearby or not. Tested this both in my map and in yours (after moving the middle shop away). This is not intended, right?
That arrow is handled by the shop's select hero ability.

I will upate this system in near future because the jass version contains a bug found by SpasMaster regarding sell -> undo -> buy.

Good luck.
 
Updated the vjass version to 4g.
fixed a bug: One could lose items when the Shop UI was closed and Undo is enabled.

When one already had an item sold it, undid the selling and bought an item then one lost the not anymore sold item. The source of the bug was a wrong clearing in the Undo feature.

The patch only changed code in:
library TasItemShop function TriggerFuctionUndo
 
Level 12
Joined
May 16, 2020
Messages
660
That arrow is handled by the shop's select hero ability.

Thanks for the update Tasyen. Isn't the above also a bug?

I took some more pics, to hopefully explain the problem better:

1. Here you can see the Shadow Hunter being just outside of the top-right shop's range (= no shop arrow):

WC3ScrnShot_061921_121649_001.png


2. However, if I move the hero to the center of the map, where NO shop is, he again gets the Shop arrow:

WC3ScrnShot_061921_121700_001.png


3. And here just to show that really no other shop is nearby from which the Hero can buy from:

WC3ScrnShot_061921_121709_001.png



I get the same behaviour in my (bigger) map. The heroes at the very center of the map always get the shop arrow, even though there is no shop for miles nearby.
 
Last edited:
Level 2
Joined
Jun 19, 2021
Messages
6
Hello,

I am trying my best here to add this to my map. I am trying to follow the instructions as good as I can, and I am not really familiar with importing files into my map. When you say export/import all files, you mean going in "Asset Manager" -> Export all files -> Import into my own map right? I have done that and copied triggers over, and I get 3600 lines of error. Do anyone have a simple noob proof explanation? I really like this system, when I tested it in the test map, it literally did everything for me. So I would love to try it in a map.
 
Hello,

I am trying my best here to add this to my map. I am trying to follow the instructions as good as I can, and I am not really familiar with importing files into my map. When you say export/import all files, you mean going in "Asset Manager" -> Export all files -> Import into my own map right? I have done that and copied triggers over, and I get 3600 lines of error. Do anyone have a simple noob proof explanation? I really like this system, when I tested it in the test map, it literally did everything for me. So I would love to try it in a map.
First you have to make sure you are using the right version. If your map is in jass mode you copy the jass version. If your map is in Lua than you use the other one. Your can see the code mode of your map in Scenario - Map Options - bottom part of the PoPup Window.
The default code mode is jass.
If your map is in jass make sure that you enabled vjass: trigger editor - jasshelper - enable vjass. That requires to enable jasshelper.

The imports do not produce any compiler errors. Without the imported Files the Custom UI will not display and won't work in the game.
Export all and import all are fine when done in the current Version of Warcraft 3.
 
Top