1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-29 09:15:11 +01:00
Peacock/static/MasteryUnlockablesTemplate.json
Reece Dunham 6245e91624 Initial commit
Co-authored-by: Tino Roivanen <tino.roivanen98@gmail.com>
Co-authored-by: Govert de Gans <grappigegovert@hotmail.com>
Co-authored-by: Gray Olson <gray@grayolson.com>
Co-authored-by: Alexandre Sanchez <alex73630@gmail.com>
Co-authored-by: Anthony Fuller <24512050+anthonyfuller@users.noreply.github.com>
Co-authored-by: atampy25 <24306974+atampy25@users.noreply.github.com>
Co-authored-by: David <davidstulemeijer@gmail.com>
Co-authored-by: c0derMo <c0dermo@users.noreply.github.com>
Co-authored-by: Jeevat Singh <jeevatt.singh@gmail.com>
Signed-off-by: Reece Dunham <me@rdil.rocks>
2022-10-19 21:33:45 -04:00

569 lines
39 KiB
JSON

{
"$setpageargs": {
"IsUpgradeMastery": true,
"OverrideUnlockableTileImage": true
},
"_dynamicPackerOverride": ["SniperChallenge"],
"buttons": [
{
"actiontype": "accept",
"actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_SELECT"
},
{
"actiontype": "cancel",
"actionlabel": "$loc UI_BUTTON_PROMPTS_ACTION_BACK"
}
],
"background": {
"url": "$res $.Location.Properties.Icon"
},
"onpageclosed": {
"set-mastery-data": {}
},
"body": {
"id": "root_list",
"controller": "list",
"data": {
"direction": "vertical"
},
"children": [
{
"controller": "group",
"id": "headline_container",
"row": 4.25,
"col": 0,
"selectable": false,
"pressable": false,
"_comment": "the container that will hold the HeadlineElement. It will show info on whatever item is selected",
"children": {
"id": "headline_element",
"view": "menu3.basic.HeadlineElement"
}
},
{
"$if $not $($arg _isonline)": {
"$then": {
"id": "selectable_invisible_element",
"nrows": 0,
"ncols": 0,
"selectable": false,
"pressable": false,
"actions": {
"on-add-child": {
"replace-children": {
"target": "headline_container",
"children": {
"view": "menu3.basic.DefaultNoContentHeader",
"selectable": false,
"pressable": false,
"data": {
"header": "",
"title": "$loc UI_MENU_PAGE_CONNECTION_REQUIRED_MASTERY",
"multilinetitle": true,
"typeicon": {
"$if $.Icon": {
"$then": "$.Icon",
"$else": "info"
}
}
}
}
}
},
"on-remove-child": {
"replace-children": {
"target": "headline_container",
"children": []
}
}
}
},
"$else": null
}
},
{
"controller": "list",
"id": "mastery_category_container"
},
{
"id": "mastery_category_controller",
"controller": "category",
"container": "mastery_category_container",
"view": "menu3.containers.ScrollingTabsContainer",
"direction": "horizontal",
"ncols": 10,
"data": {
"direction": "horizontal",
"overflowscrolling": "0.45",
"buttonprompts": [
{
"actiontype": ["lb", "rb"],
"actionlabel": "$loc UI_BUTTON_PROMPTS_BROWSE_CATEGORIES"
}
],
"topnavigation": {
"title": "$loc UI_MENU_PAGE_MASTERY_TITLE",
"icon": "unlocked"
}
},
"actions": {
"select": {
"set-selected": {
"target": "mastery-tile-unlocked",
"last-found": true
}
}
},
"children": {
"id": "$formatstring mastery_category_{$.LocationId}_{$.Name}",
"view": "menu3.basic.CategoryElement",
"data": {
"title": "$loc $.Unlockable.Properties.Name",
"icon": "$.Unlockable.Subtype"
},
"children": {
"controller": "list",
"id": "mastery_scrolling_group",
"view": "menu3.containers.ScrollingListContainer",
"col": 0.0,
"row": 1.0,
"ncols": 10,
"nrows": 3,
"direction": "horizontal",
"data": {
"direction": "horizontal",
"reversestartpos": true
},
"actions": {
"select": {
"set-mastery-data": {
"$setup": {
"$set ValidContractType": {
"$if $isnull $.Contract": {
"$then": true,
"$else": {
"$switch $.Contract.Metadata.Type": [
{
"case": "usercreated",
"return": false
},
{
"case": "featured",
"return": false
},
{
"default": true
}
]
}
}
},
"$set HideProgression": {
"$if $isnull $.CompletionData": {
"$then": "$.Data.LocationHideProgression",
"$else": "$.CompletionData.HideProgression"
}
},
"$set MasteryTitle": {
"$if $isnull $.CompletionData": {
"$then": "$formatstring {$.Data.LocationLevel,.0f}/{$.Data.LocationMaxLevel,.0f}",
"$else": "$formatstring {$.CompletionData.Level,.0f}/{$.CompletionData.MaxLevel,.0f}"
}
},
"$set MasteryCompletion": {
"$if $isnull $.CompletionData": {
"$then": "$.Data.LocationCompletion",
"$else": "$.CompletionData.Completion"
}
},
"$set MasteryXpLeft": {
"$if $isnull $.CompletionData": {
"$then": "$.Data.LocationXpLeft",
"$else": "$.CompletionData.XpLeft"
}
},
"$set NameLocalized": {
"$if $isnull $.CompletionData.Name": {
"$then": "$loc UI_MENU_PAGE_MASTERY_TITLE",
"$else": "$loc $.CompletionData.Name"
}
},
"$set IsLocationProgression": {
"$if": {
"$condition": {
"$or": [
"$isnull $.CompletionData",
"$.CompletionData.IsLocationProgression"
]
},
"$then": true,
"$else": false
}
},
"$set ShowUnit": {
"$if $.IsLocationProgression": {
"$then": true,
"$else": false
}
},
"$in": {
"$if": {
"$condition": {
"$and": [
"$arg _isonline",
"$not $.HideProgression",
"$.ValidContractType"
]
},
"$then": {
"masteryheader": "$.NameLocalized",
"masterytitle": "$.MasteryTitle",
"masterycompletion": "$.MasteryCompletion",
"masteryxpleft": "$.MasteryXpLeft",
"showUnit": "$.ShowUnit"
},
"$else": {}
}
}
}
}
},
"deselect": {
"set-mastery-data": {}
}
},
"children": {
"$merge": [
{
"$if $not $isnull $.Unlockable": {
"$then": {
"$setup": {
"$set Item": "$.Unlockable",
"$set LocalizedReproItem": "$item $.Unlockable",
"$set IsUpgradeMastery": false,
"$in": {
"id": "mastery-tile-unlocked",
"view": "menu3.basic.CategoryTile",
"nrows": 3,
"ncols": 2,
"pressable": true,
"data": {
"image": {
"$if $arg OverrideUnlockableTileImage": {
"$then": "$res $formatstring images/unlockables_override/{$.Unlockable.Id}_Tile.jpg",
"$else": "$.LocalizedReproItem.image"
}
},
"islocked": "$.IsLocked",
"header": "$.LocalizedReproItem.type",
"title": "$.LocalizedReproItem.name",
"icon": {
"$switch $.Unlockable.Type": [
{
"case": "access",
"return": "starting"
},
{
"case": "agencypickup",
"return": "stashpointempty"
},
{
"case": "loadoutunlock",
"return": "pistol"
},
{
"case": "difficultyunlock",
"return": "difficultylevel"
},
{
"default": "$.Unlockable.Subtype"
}
]
}
},
"actions": {
"accept": {
"show-modal": {
"config": {
"priority": "low",
"view": "menu3.modal.ModalDialogItemDetails",
"buttons": [
{
"label": "$loc UI_BUTTON_PROMPTS_ACTION_BACK",
"type": "cancel"
}
],
"data": {
"description": "$.LocalizedReproItem.desc",
"name": "$.LocalizedReproItem.name",
"type": {
"$if $.IsUpgradeMastery": {
"$then": "$loc UI_MENU_PAGE_MASTERY_UPGRADE_TITLE",
"$else": "$.Item.Type"
}
},
"subtype": {
"$if $.IsUpgradeMastery": {
"$then": null,
"$else": "$.Item.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 $.LocalizedReproItem.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"
}
}
}
}
}
}
}
}
},
"select": {
"update-content": {
"target": "headline_element"
}
}
}
}
}
},
"$else": null
}
},
{
"$each $.Drops": {
"$setup": {
"$set Item": "$.Unlockable",
"$set LocalizedReproItem": "$item $.Unlockable",
"$set IsUpgradeMastery": "$arg IsUpgradeMastery",
"$in": {
"id": {
"$if $.IsLocked": {
"$then": "mastery-tile-locked",
"$else": "mastery-tile-unlocked"
}
},
"view": "menu3.basic.ObjectiveTile",
"nrows": 3,
"ncols": 2,
"pressable": true,
"data": {
"image": "$.LocalizedReproItem.image",
"islocked": "$.IsLocked",
"header": {
"$if $isnull $.Level": {
"$then": "$loc UI_OBJECTIVES_UNLOCKS_HEADER",
"$else": {
"$if $.IsLocked": {
"$then": "$loc UI_MENU_PAGE_MASTERY_UNLOCKS_AT_HEADER",
"$else": "$loc UI_MENU_PAGE_MASTERY_UNLOCKED_HEADER"
}
}
}
},
"title": "$formatstring {$loc UI_MENU_PAGE_MASTERY_LEVEL_SHORT} {$.Level,.0f}",
"icon": {
"$switch $.IsLocked": [
{
"case": false,
"return": "masteryunlocked"
},
{
"case": true,
"return": "locked"
},
{
"default": "locked"
}
]
},
"description": "$.LocalizedReproItem.desc",
"descriptionAlignment": "top",
"perks": "$.LocalizedReproItem.perks",
"rarity": "$.LocalizedReproItem.rarity",
"masteryLevel": "$formatstring {$loc UI_MENU_PAGE_MASTERY_LEVEL} {$.Level,.0f}",
"conditions": [
{
"header": {
"$if $arg IsUpgradeMastery": {
"$then": "$loc UI_MENU_PAGE_MASTERY_UPGRADE_TITLE",
"$else": "$.LocalizedReproItem.type"
}
},
"title": "$.LocalizedReproItem.name",
"icon": {
"$switch $.Unlockable.Type": [
{
"case": "access",
"return": "starting"
},
{
"case": "agencypickup",
"return": "stashpointempty"
},
{
"case": "loadoutunlock",
"return": "pistol"
},
{
"case": "difficultyunlock",
"return": "difficultylevel"
},
{
"default": "$.Unlockable.Subtype"
}
]
}
}
]
},
"actions": {
"accept": {
"show-modal": {
"config": {
"priority": "low",
"view": "menu3.modal.ModalDialogItemDetails",
"buttons": [
{
"label": "$loc UI_BUTTON_PROMPTS_ACTION_BACK",
"type": "cancel"
}
],
"data": {
"description": "$.LocalizedReproItem.desc",
"name": "$.LocalizedReproItem.name",
"type": {
"$if $.IsUpgradeMastery": {
"$then": "$loc UI_MENU_PAGE_MASTERY_UPGRADE_TITLE",
"$else": "$.Item.Type"
}
},
"subtype": {
"$if $.IsUpgradeMastery": {
"$then": null,
"$else": "$.Item.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 $.LocalizedReproItem.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"
}
}
}
}
}
}
}
}
},
"select": {
"replace-children": {
"target": "headline_container",
"children": {
"id": "headline_element",
"view": "menu3.basic.HeadlineElement",
"selectable": false,
"pressable": false,
"data": {
"header": {
"$if $.IsUpgradeMastery": {
"$then": "$loc UI_MENU_PAGE_MASTERY_UPGRADE_TITLE",
"$else": "$loc $.TypeLocaKey"
}
},
"title": "$($item $.Item).name",
"typeicon": {
"$switch $.Unlockable.Type": [
{
"case": "access",
"return": "starting"
},
{
"case": "agencypickup",
"return": "stashpointempty"
},
{
"case": "loadoutunlock",
"return": "pistol"
},
{
"case": "difficultyunlock",
"return": "difficultylevel"
},
{
"default": "$.Unlockable.Subtype"
}
]
}
}
}
}
}
}
}
}
}
}
]
}
}
}
}
]
}
}