From c6d0b5f9dfa4cb22b0c500c0b212a064c94ccb48 Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Fri, 1 Dec 2023 19:06:34 +0000 Subject: [PATCH] Fix Stashpoint and Agency Pickup templates --- static/SelectAgencyPickupTemplate.json | 49 ++- static/StashpointTemplate.json | 477 +++++++++++++------------ 2 files changed, 287 insertions(+), 239 deletions(-) diff --git a/static/SelectAgencyPickupTemplate.json b/static/SelectAgencyPickupTemplate.json index 063837b9..a1a0a7ea 100644 --- a/static/SelectAgencyPickupTemplate.json +++ b/static/SelectAgencyPickupTemplate.json @@ -4,9 +4,13 @@ "location": "$.Contract.Metadata.Location" }, "onpageopened": { - "set-selected": { "target": "$arg SelectedAgencyPickup" } + "set-selected": { + "target": "$arg SelectedAgencyPickup" + } + }, + "onpageclosed": { + "set-mastery-data": {} }, - "onpageclosed": { "set-mastery-data": {} }, "buttons": [ { "actiontype": "accept", @@ -25,11 +29,17 @@ "$setupcomponents": { "difficulty-manager": { "always-reload-setup": true, - "setup": { "difficulty": "$.Contract.Metadata.Difficulty" } + "setup": { + "difficulty": "$.Contract.Metadata.Difficulty" + } } }, "controller": "list", - "actions": { "select": { "select-category": {} } }, + "actions": { + "select": { + "select-category": {} + } + }, "children": [ { "controller": "group", @@ -44,7 +54,10 @@ "view": "menu3.basic.HeadlineElement" } }, - { "id": "category_container", "controller": "list" }, + { + "id": "category_container", + "controller": "list" + }, { "view": "menu3.containers.ScrollingTabsContainer", "controller": "category", @@ -85,12 +98,22 @@ ] } }, - { "case": "orbis", "return": "ica" }, - { "case": "campaign", "return": "mission" }, + { + "case": "orbis", + "return": "ica" + }, + { + "case": "campaign", + "return": "mission" + }, { "case": "sniper", "return": "sniperrifle" }, + { + "case": "arcade", + "return": "arcademode" + }, { "default": { "$if $.Contract.Metadata.IsVersus": { @@ -121,7 +144,9 @@ "case": "featured", "return": false }, - { "default": true } + { + "default": true + } ] } } @@ -209,7 +234,9 @@ "controller": "group", "view": "menu3.containers.ScrollingListContainer", "direction": "horizontal", - "data": { "direction": "horizontal" }, + "data": { + "direction": "horizontal" + }, "row": 1, "pages": true, "nrows": 3, @@ -303,7 +330,9 @@ "rarity": "$($arg SelectedItem).rarity" } }, - { "default": null } + { + "default": null + } ] }, "locked": "$not $.unlocked", diff --git a/static/StashpointTemplate.json b/static/StashpointTemplate.json index d33687c5..a7e066df 100644 --- a/static/StashpointTemplate.json +++ b/static/StashpointTemplate.json @@ -147,6 +147,10 @@ "case": "sniper", "return": "sniperrifle" }, + { + "case": "arcade", + "return": "arcademode" + }, { "default": { "$if $.Contract.Metadata.IsVersus": { @@ -279,7 +283,7 @@ "$if $eq ($arraysize $.Items,0)": { "$then": { "$setup": { - "$set Title": "$loc UI_MENU_PAGE_NO_CHALLENGES_AVAILABLE", + "$set Title": "$loc UI_MENU_ELEMENT_NO_CONTENT", "$in": { "view": "menu3.basic.DefaultNoContentHeader", "selectable": false, @@ -328,222 +332,266 @@ } }, { - "$setpageargs": { - "ShowPrevNextButtonPrompt": "$gt ($arraysize $.Items,1)" - }, - "controller": "category", - "id": "sub_category_controller", - "container": "sub_category_container", - "view": "menu3.containers.ScrollingTabsContainer", - "ncols": 10, - "direction": "horizontal", - "submenu-navigation": true, - "prevnextnav": true, - "data": { - "direction": "horizontal", - "submenu": true - }, - "children": { - "$each": { - "in": { - "$groupby": { - "from": { - "$orderby": { - "from": "$.Items", - "by": "Item.Unlockable.Subtype", - "order": [ - "container", - "pistol", - "smg", - "shotgun", - "assaultrifle", - "sniperrifle", - "melee", - "tool", - "distraction", - "poison", - "explosive", - "classic", - "formal", - "coats", - "casual", - "tactical", - "themed" - ] - } - }, - "by": "Item.Unlockable.Subtype" - } - }, - "do": { - "id": "$formatstring {$.by}_container", - "view": "menu3.basic.SubCategoryElement", - "data": { - "title": "$loc $formatstring UI_ITEM_SUBTYPE_IN_PLURAL_{$.by}" - }, - "buttons": [ - { - "$if $arg ShowPrevNextButtonPrompt": { - "$then": { - "actiontype": "lt_rt", - "actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_PREVNEXT_CATEGORY", - "customplatform": { - "platform": "key", - "hide": true, - "actiontype": "mouse_lmb" - } - } - } + "$setup": { + "$set GroupedItems": { + "$groupby": { + "from": { + "$orderby": { + "from": "$.Items", + "by": "Item.Unlockable.Subtype", + "order": [ + "container", + "pistol", + "smg", + "shotgun", + "assaultrifle", + "sniperrifle", + "melee", + "tool", + "distraction", + "poison", + "explosive", + "classic", + "formal", + "coats", + "casual", + "tactical", + "themed" + ] } - ], - "children": { - "id": "$formatstring scroll_container_{$.by}", - "controller": "group", - "view": "menu3.containers.ScrollingListContainer", - "row": 1.0, - "nrows": 3, - "ncols": 10, - "pages": true, - "direction": "horizontal", - "data": { - "direction": "horizontal" - }, - "children": { - "$each": { - "in": { - "$orderby": { - "from": "$.group", - "by": { - "$if $eqs ($.Item.Unlockable.Type,disguise)": { - "$then": { - "$if $not $isnull $.Item.Unlockable.Properties.OrderIndex": { - "$then": "$.Item.Unlockable.Properties.OrderIndex", - "$else": 10000 - } - }, - "$else": "$($item $.Item).name" + }, + "by": "Item.Unlockable.Subtype" + } + }, + "$in": { + "$setpageargs": { + "ShowPrevNextButtonPrompt": "$gt ($arraysize $.GroupedItems,1)" + }, + "controller": "category", + "id": "sub_category_controller", + "container": "sub_category_container", + "view": "menu3.containers.ScrollingTabsContainer", + "ncols": 10, + "direction": "horizontal", + "submenu-navigation": true, + "prevnextnav": true, + "data": { + "direction": "horizontal", + "submenu": true + }, + "children": { + "$each": { + "in": "$.GroupedItems", + "do": { + "id": "$formatstring {$.by}_container", + "view": "menu3.basic.SubCategoryElement", + "data": { + "title": "$loc $formatstring UI_ITEM_SUBTYPE_IN_PLURAL_{$.by}" + }, + "buttons": [ + { + "$if $arg ShowPrevNextButtonPrompt": { + "$then": { + "actiontype": "lt_rt", + "actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_PREVNEXT_CATEGORY", + "customplatform": { + "platform": "key", + "hide": true, + "actiontype": "mouse_lmb" } } } + } + ], + "children": { + "id": "$formatstring scroll_container_{$.by}", + "controller": "group", + "view": "menu3.containers.ScrollingListContainer", + "row": 1.0, + "nrows": 3, + "ncols": 10, + "pages": true, + "direction": "horizontal", + "data": { + "direction": "horizontal" }, - "do": { - "$mergeobjects": [ - { - "$if $arg usetalltile": { - "$then": { - "view": "menu3.basic.ItemTileTall", - "nrows": 3 - }, - "$else": { - "view": "menu3.basic.ItemTileSmall", - "nrows": 1.5 + "children": { + "$each": { + "in": { + "$orderby": { + "from": "$.group", + "by": { + "$if $eqs ($.Item.Unlockable.Type,disguise)": { + "$then": { + "$if $not $isnull $.Item.Unlockable.Properties.OrderIndex": { + "$then": "$.Item.Unlockable.Properties.OrderIndex", + "$else": 10000 + } + }, + "$else": "$($item $.Item).name" + } } } }, - { - "$setup": { - "$set LocalizedReproItem": "$item $.Item", - "$in": { - "ncols": 2, - "id": "$.LocalizedReproItem.id", - "data": { - "_header": "$loc $formatstring UI_ITEM_SUBTYPE_{$.Item.Unlockable.Subtype}", - "title": "$.LocalizedReproItem.name", - "image": "$.LocalizedReproItem.image", - "rarity": "$.LocalizedReproItem.rarity", - "icon": { - "$if $eqs ($.Item.Unlockable.Type,disguise)": { - "$then": "disguise", - "$else": "$.Item.Unlockable.Subtype" - } - }, - "perks": "$.LocalizedReproItem.perks", - "itemcount": "$.LocalizedReproItem.itemcount", - "header": { - "$if $isinloadout $.LocalizedReproItem.repositoryid": { - "$then": "$loc UI_MENU_PAGE_LOADOUT_ALREADY_IN_USE", - "$else": "$loc $formatstring UI_ITEM_SUBTYPE_{$.Item.Unlockable.Subtype}" - } - } - }, - "buttons": [ + "do": { + "$if ": { + "$condition": { + "$or": [ + "$not $eqs ($.Item.Unlockable.Id,TOKEN_OUTFIT_WET_SUIT)", + "$not $eqs ($arg location,LOCATION_NEWZEALAND)" + ] + }, + "$then": { + "$mergeobjects": [ { - "actiontype": "action-y", - "actionlabel": "$loc UI_DIALOG_SHOW_DETAILS" - } - ], - "actions": { - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.ItemHeadlineElement", - "id": "headline_element" - } - ] - }, - "update-content": { - "target": "headline_element" - }, - "update-buttons": { - "type": "slotitem", - "slotid": "$.SlotId", - "instanceId": "$.Item.InstanceId" - }, - "set-repositoryitem-selected": "$.LocalizedReproItem.repositoryid" + "$if $arg usetalltile": { + "$then": { + "view": "menu3.basic.ItemTileTall", + "nrows": 3 + }, + "$else": { + "view": "menu3.basic.ItemTileSmall", + "nrows": 1.5 + } + } }, - "action-y": { - "show-modal": { - "config": { - "priority": "low", - "view": "menu3.modal.ModalDialogItemDetails", - "buttons": [ - "$loc UI_DIALOG_OK", - { - "type": "cancel" - } - ], + { + "$setup": { + "$set LocalizedReproItem": "$item $.Item", + "$in": { + "ncols": 2, + "id": "$.LocalizedReproItem.id", "data": { - "description": "$.LocalizedReproItem.desc", - "name": "$.LocalizedReproItem.name", - "type": "$.Item.Unlockable.Type", - "subtype": { + "_header": "$loc $formatstring UI_ITEM_SUBTYPE_{$.Item.Unlockable.Subtype}", + "title": "$.LocalizedReproItem.name", + "image": "$.LocalizedReproItem.image", + "rarity": "$.LocalizedReproItem.rarity", + "icon": { "$if $eqs ($.Item.Unlockable.Type,disguise)": { "$then": "disguise", "$else": "$.Item.Unlockable.Subtype" } }, - "image": "$.LocalizedReproItem.image", - "rarity": "$.LocalizedReproItem.rarity", "perks": "$.LocalizedReproItem.perks", - "item": "$($repository $.LocalizedReproItem.repositoryid)", - "displaybuttons": [ - { - "actiontype": "cancel", - "actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_BACK", - "hideIndicator": true + "itemcount": "$.LocalizedReproItem.itemcount", + "header": { + "$if $isinloadout $.LocalizedReproItem.repositoryid": { + "$then": "$loc UI_MENU_PAGE_LOADOUT_ALREADY_IN_USE", + "$else": "$loc $formatstring UI_ITEM_SUBTYPE_{$.Item.Unlockable.Subtype}" } - ], - "actionAndKillTypes": { - "$setup": { - "$set ItemRepositoryId": "$repository $.Item.Unlockable.Properties.RepositoryId", - "$in": { - "$convertarray": { - "discardElementsWithoutConversion": true, - "sourceArray": "$.ItemRepositoryId.OnlineTraits", - "conversionRules": { - "melee_nonlethal": "$loc UI_ITEM_ONLINETRAITS_MELEE_NONLETHAL", - "melee_lethal": "$loc UI_ITEM_ONLINETRAITS_MELEE_LETHAL", - "throw_nonlethal": "$loc UI_ITEM_ONLINETRAITS_THROW_NONLETHAL", - "throw_lethal": "$loc UI_ITEM_ONLINETRAITS_THROW_LETHAL", - "fiberwire": "$loc UI_ITEM_ONLINETRAITS_FIBERWIRE", - "syringe_poison": "$loc UI_ITEM_ONLINETRAITS_SYRINGE_POISON", - "consumable_poison": "$loc UI_ITEM_ONLINETRAITS_CONSUMABLE_POISON", - "accident_explosion": "$loc UI_KILL_METHOD_ACCIDENT_EXPLOSION", - "detonator_explosive_device": "$loc UI_KILL_METHOD_EXPLOSIVE", - "explosive_device": "$loc UI_KILL_METHOD_EXPLOSIVE" + } + }, + "buttons": [ + { + "actiontype": "action-y", + "actionlabel": "$loc UI_DIALOG_SHOW_DETAILS" + } + ], + "actions": { + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.ItemHeadlineElement", + "id": "headline_element" + } + ] + }, + "update-content": { + "target": "headline_element" + }, + "update-buttons": { + "type": "slotitem", + "slotid": "$.SlotId", + "instanceId": "$.Item.InstanceId" + }, + "set-repositoryitem-selected": "$.LocalizedReproItem.repositoryid" + }, + "action-y": { + "show-modal": { + "config": { + "priority": "low", + "view": "menu3.modal.ModalDialogItemDetails", + "buttons": [ + "$loc UI_DIALOG_OK", + { + "type": "cancel" } + ], + "data": { + "description": "$.LocalizedReproItem.desc", + "name": "$.LocalizedReproItem.name", + "type": "$.Item.Unlockable.Type", + "subtype": { + "$if $eqs ($.Item.Unlockable.Type,disguise)": { + "$then": "disguise", + "$else": "$.Item.Unlockable.Subtype" + } + }, + "image": "$.LocalizedReproItem.image", + "rarity": "$.LocalizedReproItem.rarity", + "perks": "$.LocalizedReproItem.perks", + "item": "$($repository $.LocalizedReproItem.repositoryid)", + "displaybuttons": [ + { + "actiontype": "cancel", + "actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_BACK", + "hideIndicator": true + } + ], + "actionAndKillTypes": { + "$setup": { + "$set ItemRepositoryId": "$repository $.Item.Unlockable.Properties.RepositoryId", + "$in": { + "$convertarray": { + "discardElementsWithoutConversion": true, + "sourceArray": "$.ItemRepositoryId.OnlineTraits", + "conversionRules": { + "melee_nonlethal": "$loc UI_ITEM_ONLINETRAITS_MELEE_NONLETHAL", + "melee_lethal": "$loc UI_ITEM_ONLINETRAITS_MELEE_LETHAL", + "throw_nonlethal": "$loc UI_ITEM_ONLINETRAITS_THROW_NONLETHAL", + "throw_lethal": "$loc UI_ITEM_ONLINETRAITS_THROW_LETHAL", + "fiberwire": "$loc UI_ITEM_ONLINETRAITS_FIBERWIRE", + "syringe_poison": "$loc UI_ITEM_ONLINETRAITS_SYRINGE_POISON", + "consumable_poison": "$loc UI_ITEM_ONLINETRAITS_CONSUMABLE_POISON", + "accident_explosion": "$loc UI_KILL_METHOD_ACCIDENT_EXPLOSION", + "detonator_explosive_device": "$loc UI_KILL_METHOD_EXPLOSIVE", + "explosive_device": "$loc UI_KILL_METHOD_EXPLOSIVE" + } + } + } + } + } + } + } + } + }, + "accept": { + "select-stashpoint": { + "target": { + "$if $arg set-stashpoint": { + "$then": "$arg stashpoint", + "$else": null + } + } + }, + "loadout_equip_unequip": { + "slotid": "$.SlotId", + "instance": "$.Item", + "mode": "equip" + }, + "request-back": { + "target": [ + "contractcreation_planning", + "planning", + "multiplayer", + "gamemode_versus" + ], + "usecache": { + "$if $isnull $arg usecacheonreturn": { + "$then": false, + "$else": "$arg usecacheonreturn" } } } @@ -551,41 +599,12 @@ } } } - }, - "accept": { - "select-stashpoint": { - "target": { - "$if $arg set-stashpoint": { - "$then": "$arg stashpoint", - "$else": null - } - } - }, - "loadout_equip_unequip": { - "slotid": "$.SlotId", - "instance": "$.Item", - "mode": "equip" - }, - "request-back": { - "target": [ - "contractcreation_planning", - "planning", - "multiplayer", - "gamemode_versus" - ], - "usecache": { - "$if $isnull $arg usecacheonreturn": { - "$then": false, - "$else": "$arg usecacheonreturn" - } - } - } } - } + ] } } } - ] + } } } }