From 8189757e278652cc47938a025a46f8628c62614f Mon Sep 17 00:00:00 2001 From: Anthony Fuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:28:34 +0100 Subject: [PATCH] feat(menu): add escalation tile to H2/3 dashboard (#314) * Add escalation tile to H2/3 dash * Add the Peacock url to H3 dash * Functioning escalation page and tile for H3 * Functioning escalation page and tile in H2 * Fix shangrila image path --- components/configSwizzleManager.ts | 6 + components/contracts/hitsCategoryService.ts | 21 +- components/controller.ts | 21 +- components/menuData.ts | 47 +- components/menus/menuSystem.ts | 19 + components/profileHandler.ts | 1 + .../BERLIN/ESCALATION/MENDIE/MENDIE.json | 2 +- .../BERLIN/ESCALATION/MENDIE/MENDIE1.json | 2 +- .../BERLIN/ESCALATION/MENDIE/MENDIE2.json | 2 +- .../BERLIN/ESCALATION/MENDIE/MENDIE3.json | 2 +- static/ArcadePageTemplate.json | 91 +++ static/EiderDashboard.json | 685 +++++++++--------- static/H2CareerTemplate.json | 171 +++++ static/H2DashboardTemplate.json | 532 ++++++++------ static/H2SniperContentTemplate.json | 191 +++++ .../HitsCategoryContractAttackTemplate.json | 119 ++- 16 files changed, 1224 insertions(+), 688 deletions(-) create mode 100644 static/ArcadePageTemplate.json create mode 100644 static/H2CareerTemplate.json create mode 100644 static/H2SniperContentTemplate.json diff --git a/components/configSwizzleManager.ts b/components/configSwizzleManager.ts index 2846129f..0094a9a6 100644 --- a/components/configSwizzleManager.ts +++ b/components/configSwizzleManager.ts @@ -93,6 +93,8 @@ import FrankensteinPlanningTemplate from "../static/FrankensteinPlanningTemplate import Videos from "../static/Videos.json" import ChallengeLocationTemplate from "../static/ChallengeLocationTemplate.json" import H2ChallengeLocationTemplate from "../static/H2ChallengeLocationTemplate.json" +import H2CareerTemplate from "../static/H2CareerTemplate.json" +import H2SniperContentTemplate from "../static/H2SniperContentTemplate.json" import LegacyChallengeLocationTemplate from "../static/LegacyChallengeLocationTemplate.json" import ReportTemplate from "../static/ReportTemplate.json" import ContractSearchPageTemplate from "../static/ContractSearchPageTemplate.json" @@ -113,6 +115,7 @@ import LegacyMasteryLocationTemplate from "../static/LegacyMasteryLocationTempla import DefaultCpdConfig from "../static/DefaultCpdConfig.json" import EvergreenGameChangerProperties from "../static/EvergreenGameChangerProperties.json" import AreaMap from "../static/AreaMap.json" +import ArcadePageTemplate from "../static/ArcadePageTemplate.json" import HitsCategoryElusiveTemplate from "../static/HitsCategoryElusiveTemplate.json" import HitsCategoryContractAttackTemplate from "../static/HitsCategoryContractAttackTemplate.json" import MissionRewardsTemplate from "../static/MissionRewardsTemplate.json" @@ -192,7 +195,9 @@ const configs = { H2LookupContractByIdTemplate: H2LookupContractTemplate, H2LookupContractFavoriteTemplate: H2LookupContractTemplate, H2FilterData, + H2CareerTemplate, H2DashboardTemplate, + H2SniperContentTemplate, FrankensteinMmSpTemplate, FrankensteinMmMpTemplate, FrankensteinPlanningTemplate, @@ -219,6 +224,7 @@ const configs = { DefaultCpdConfig, EvergreenGameChangerProperties, AreaMap, + ArcadePageTemplate, HitsCategoryElusiveTemplate, HitsCategoryContractAttackTemplate, MissionRewardsTemplate, diff --git a/components/contracts/hitsCategoryService.ts b/components/contracts/hitsCategoryService.ts index edd1bbbc..d89c5551 100644 --- a/components/contracts/hitsCategoryService.ts +++ b/components/contracts/hitsCategoryService.ts @@ -230,16 +230,20 @@ export class HitsCategoryService { this.hitsCategories .for("ContractAttack") .tap(tapName, (contracts, gameVersion) => { + // We need to push Peacock contracts first to work around H2 not + // having the "order" property for $arraygroupby. (The game just crashes) + const nEscalations = [] + for (const escalations of Object.values( missionsInLocations.escalations, )) { for (const id of escalations) { const contract = controller.resolveContract(id) - const season = - contract.Metadata.Season === 0 - ? contract.Metadata.OriginalSeason - : contract.Metadata.Season + const isPeacock = contract.Metadata.Season === 0 + const season = isPeacock + ? contract.Metadata.OriginalSeason + : contract.Metadata.Season switch (gameVersion) { case "h1": @@ -248,13 +252,18 @@ export class HitsCategoryService { if (season === 1) contracts.push(id) break case "h2": - if (season <= 2) contracts.push(id) + if (season <= 2) + (isPeacock ? contracts : nEscalations).push( + id, + ) break default: - contracts.push(id) + ;(isPeacock ? contracts : nEscalations).push(id) } } } + + contracts.push(...nEscalations) }) } diff --git a/components/controller.ts b/components/controller.ts index 4c1eb2bd..e6217c0e 100644 --- a/components/controller.ts +++ b/components/controller.ts @@ -238,13 +238,6 @@ export const _legacyBull: MissionManifest = JSON.parse(LEGACYFF) export const _theLastYardbirdScpc: MissionManifest = JSON.parse(LASTYARDBIRDSCPC) -export const peacockRecentEscalations: readonly string[] = [ - "74415eca-d01e-4070-9bc9-5ef9b4e8f7d2", - "9e0188e8-bdad-476c-b4ce-2faa5d2be56c", - "0cceeecb-c8fe-42a4-aee4-d7b575f56a1b", - "667f48a3-7f6b-486e-8f6b-2f782a5c4857", -] - /** * Ensure a mission has the bare minimum required to work. * @@ -480,6 +473,7 @@ export class Controller { log( LogLevel.INFO, "Booting Peacock internal services - this may take a moment.", + "boot", ) await this._loadInternalContracts() @@ -496,6 +490,7 @@ export class Controller { log( LogLevel.INFO, "Simple Mod Framework installed - using the data it outputs.", + "boot", ) const lastServerSideData = ( @@ -639,7 +634,11 @@ export class Controller { this.hooks.challengesLoaded.call() this.hooks.masteryDataLoaded.call() } catch (e) { - log(LogLevel.ERROR, `Fatal error with challenge bootstrap: ${e}`) + log( + LogLevel.ERROR, + `Fatal error with challenge bootstrap: ${e}`, + "boot", + ) log(LogLevel.ERROR, e.stack) } } @@ -1311,7 +1310,11 @@ export class Controller { groupCount++ } - log(LogLevel.DEBUG, `Discovered ${groupCount} escalation groups.`) + log( + LogLevel.DEBUG, + `Discovered ${groupCount} escalation groups.`, + "scanGroups", + ) } } diff --git a/components/menuData.ts b/components/menuData.ts index 493adda3..a0e97898 100644 --- a/components/menuData.ts +++ b/components/menuData.ts @@ -30,11 +30,7 @@ import { } from "./utils" import { contractSessions, getSession } from "./eventHandler" import { getConfig, getVersionedConfig } from "./configSwizzleManager" -import { - contractIdToHitObject, - controller, - peacockRecentEscalations, -} from "./controller" +import { contractIdToHitObject, controller } from "./controller" import { makeCampaigns } from "./menus/campaigns" import { createLocationsData, @@ -108,47 +104,6 @@ const menuDataRouter = Router() // /profiles/page/ -function dashEscalations(req: RequestWithJwt, res: Response) { - const contracts: UserCentricContract[] = [] - - for (const groupId of peacockRecentEscalations) { - const userCentric = generateUserCentric( - controller.resolveContract(groupId, true)!, - req.jwt.unique_name, - req.gameVersion, - ) - - if (!userCentric) { - continue - } - - contracts.push(userCentric) - } - - res.json({ - template: null, - data: { - Item: { - Id: req.params.id, - Type: "ContractList", - Title: "ContractList", - Date: new Date().toISOString(), - Data: contracts.length > 0 ? contracts : null, - }, - }, - }) -} - -menuDataRouter.get( - "/dashboard/Dashboard_Category_Escalation/:subscriptionId/:type/:id", - dashEscalations, -) - -menuDataRouter.get( - "/dashboard/Dashboard_Category_Escalation/:subscriptionId/:type/:id/:mode", - dashEscalations, -) - menuDataRouter.get( "/ChallengeLocation", (req: RequestWithJwt<{ locationId: string }>, res) => { diff --git a/components/menus/menuSystem.ts b/components/menus/menuSystem.ts index e28743a1..faa2d6bb 100644 --- a/components/menus/menuSystem.ts +++ b/components/menus/menuSystem.ts @@ -88,6 +88,10 @@ export class MenuSystemDatabase { "menusystem/elements/settings/data/isnonvroptionvisible.json", ) + configs.push( + "menusystem/pages/gamemodes/gamemodearcade_page.json", + ) + configs.push( "images/unlockables/outfit_ef223b60-b53a-4c7b-b914-13c3310fc61a_0.jpg", ) @@ -143,6 +147,10 @@ export class MenuSystemDatabase { configs.push( "menusystem/pages/multiplayer/content/lobbyslim.json", ) + configs.push("menusystem/pages/hub/career.json") + configs.push( + "menusystem/pages/gamemodes/gamemodesniper_content.json", + ) } }, ) @@ -159,6 +167,13 @@ export class MenuSystemDatabase { $else: true, }, } + case "/pages/gamemodes/gamemodearcade_page.json": + return getConfig("ArcadePageTemplate", false) + // Only for Hitman 2 + case "/pages/gamemodes/gamemodesniper_content.json": + // Every time I see this, I get increasingly annoyed that we + // had to do this - AF + return getConfig("H2SniperContentTemplate", false) case "/elements/contract/hitscategory_elusive.json": return getConfig("HitsCategoryElusiveTemplate", false) case "/elements/contract/hitscategory_contractattack.json": @@ -262,6 +277,9 @@ export class MenuSystemDatabase { $else: true, }, } + // This will only get hit by H2 + case "/pages/hub/career.json": + return getConfig("H2CareerTemplate", false) case "/pages/multiplayer/content/lobbyslim.json": return getConfig("LobbySlimTemplate", false) case "/pages/pause/pausemenu/restart.json": @@ -541,6 +559,7 @@ menuSystemRouter.get( log( LogLevel.DEBUG, `Serving dynamic resources from file ${dynamicResourceName}.`, + "dynRes", ) const hash = await md5File(dynamicResourcePath) diff --git a/components/profileHandler.ts b/components/profileHandler.ts index 452c5a9a..94715b21 100644 --- a/components/profileHandler.ts +++ b/components/profileHandler.ts @@ -676,6 +676,7 @@ profileRouter.post( `Unable to save session ${ save?.ContractSessionId } because ${getErrorMessage(e)}.`, + "updateSaves", ) } } diff --git a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE.json b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE.json index e552b782..6a79be7b 100644 --- a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE.json +++ b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE.json @@ -6,7 +6,7 @@ "Type": "escalation", "Location": "LOCATION_EDGY_FOX", "ScenePath": "assembly:/_pro/scenes/missions/edgy/mission_fox/scene_fox_basic.entity", - "TileImage": "images/contracts/escalation/contractescalation-shangrila.png", + "TileImage": "images/contracts/escalation/contractescalation_shangrila.jpg", "Entitlements": ["LOCATION_EDGY"], "GroupDefinition": { "Type": "escalation", diff --git a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE1.json b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE1.json index 917c66fc..04323ef9 100644 --- a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE1.json +++ b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE1.json @@ -99,7 +99,7 @@ "Location": "LOCATION_EDGY_FOX", "ScenePath": "assembly:/_pro/scenes/missions/edgy/mission_fox/scene_fox_basic.entity", "InGroup": "ccdc7043-62af-44e8-a5fc-38b008c2044e", - "TileImage": "images/contracts/escalation/contractescalation-shangrila.png", + "TileImage": "images/contracts/escalation/contractescalation_shangrila.jpg", "Entitlements": ["LOCATION_EDGY"] } } diff --git a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE2.json b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE2.json index 6d287f35..ed226a86 100644 --- a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE2.json +++ b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE2.json @@ -225,7 +225,7 @@ { "Id": "9be548d8-098a-473f-a9ac-09baef21df78", "IsNew": true }, { "Id": "f478ee46-c044-4be8-ad2d-8f95dfafef36" } ], - "TileImage": "images/contracts/escalation/contractescalation-shangrila.png", + "TileImage": "images/contracts/escalation/contractescalation_shangrila.jpg", "Entitlements": ["LOCATION_EDGY"] } } diff --git a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE3.json b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE3.json index c4085f9b..fde3bf37 100644 --- a/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE3.json +++ b/contractdata/BERLIN/ESCALATION/MENDIE/MENDIE3.json @@ -325,7 +325,7 @@ { "Id": "9be548d8-098a-473f-a9ac-09baef21df78" }, { "Id": "f478ee46-c044-4be8-ad2d-8f95dfafef36" } ], - "TileImage": "images/contracts/escalation/contractescalation-shangrila.png", + "TileImage": "images/contracts/escalation/contractescalation_shangrila.jpg", "Entitlements": ["LOCATION_EDGY"] } } diff --git a/static/ArcadePageTemplate.json b/static/ArcadePageTemplate.json new file mode 100644 index 00000000..252ec93d --- /dev/null +++ b/static/ArcadePageTemplate.json @@ -0,0 +1,91 @@ +{ + "id": "gamemodearcade_root", + "controller": "list", + "actions": { + "activated": { + "call": { + "$if": { + "$condition": { + "$or": [ + { + "$include": "menusystem/data/isheritage.json" + }, + "$eq ($.data.Data.Type,ContractAttack)" + ] + }, + "$then": {}, + "$else": { + "onmenuframe": true, + "method": "setBackground", + "args": "$res images/backgrounds/gamemode_arcade.jpg" + } + } + } + } + }, + "children": [ + { + "controller": "category", + "id": "category_controller", + "view": "menu3.containers.ScrollingTabsContainer", + "direction": "horizontal", + "data": { + "direction": "horizontal", + "topnavigation": { + "title": "$loc UI_MENU_PAGE_HUB_GAMEMODES", + "icon": "mission" + } + }, + "children": [ + { + "view": "menu3.basic.CategoryElement", + "controller": "categoryitem", + "data": { + "$if $eq ($.data.Data.Type,ContractAttack)": { + "$then": { + "title": "$loc UI_PEACOCK_ESCALATIONS", + "icon": "54" + }, + "$else": { + "title": "$loc UI_ARCADE_TITLE", + "icon": "arcademode" + } + } + }, + "children": [ + { + "controller": "container", + "id": "headline_container", + "view": "menu3.containers.ListContainer", + "direction": "horizontal", + "data": { + "direction": "horizontal" + }, + "row": 4.22, + "col": 0, + "selectable": false, + "pressable": false, + "children": [] + }, + { + "controller": "container", + "row": 1, + "children": [ + { + "$include": { + "$path": { + "$if $eq ($.data.Data.Type,ContractAttack)": { + "$then": "menusystem/elements/contract/hitscategory_contractattack.json", + "$else": "menusystem/elements/contract/hitscategory.json" + } + } + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/static/EiderDashboard.json b/static/EiderDashboard.json index d0ea52c7..59d20ba4 100644 --- a/static/EiderDashboard.json +++ b/static/EiderDashboard.json @@ -1,174 +1,109 @@ { - "$datacontext": { - "in": "$.", - "datavalues": { - "PeacockDashValues": [ - { - "Id": "25739126-6a40-4b0b-b9a6-5da1b737190b", - "Type": "ContractList", - "Title": "UI_HEADLINE_PLAY_CONTRACT_ATTACK", - "Text": "UI_HEADLINE_PLAY_CONTRACT_ATTACK", - "Date": "2022-01-01T00:00:00.0000000Z", - "SubscriptionId": "10000000-0000-0000-0000-000000000000", - "Priority": 40, - "Properties": { - "ContractId": "25739126-6a40-4b0b-b9a6-5da1b737190b", - "DashboardCategory": "Dashboard_Category_Escalation" - }, - "LoadValue": "menusystem/pages/hub/dashboard/category_escalation/loadasync.json", - "row": 1.5, - "col": 4 - } - ] - }, - "do": { - "controller": "group", - "row": 1, - "nrows": 3, - "ncols": 10, - "layoutchildren": true, - "children": { - "$mergearrays": [ - { - "$if": { - "$condition": { - "$and": [ - "$isuser vr", - { - "$or": [ - "$isvrdeviceavailable", - "$eq ($platform,orbis)" - ] - } + "controller": "group", + "row": 1, + "nrows": 3, + "ncols": 10, + "layoutchildren": true, + "children": { + "$mergearrays": [ + { + "$if": { + "$condition": { + "$and": [ + "$isuser vr", + { + "$or": [ + "$isvrdeviceavailable", + "$eq ($platform,orbis)" ] + } + ] + }, + "$then": [ + { + "view": "menu3.basic.MenuTileLarge", + "row": 0, + "col": 0, + "nrows": 3, + "ncols": 4, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", + "icon": "story", + "image": "$res images/livetile/tile_story.jpg" }, - "$then": [ - { - "view": "menu3.basic.MenuTileLarge", - "row": 0, - "col": 0, - "nrows": 3, - "ncols": 4, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "icon": "story", - "image": "$res images/livetile/tile_story.jpg" - }, - "actions": { - "accept": [ + "actions": { + "accept": [ + { + "set-selected": { + "target": "category_story" + } + } + ], + "select": { + "replace-children": { + "target": "headline_container", + "children": [ { - "set-selected": { - "target": "category_story" + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", + "typeicon": "story" } } - ], - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "typeicon": "story" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } + ] } }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "$databinding menusystem/pages/hub/dashboard/data/data_dashboardtile_vr.json": { + "view": "menu3.basic.ButtonTileXXSmall", + "row": 3, + "col": 8, + "nrows": 3, + "ncols": 2, + "data": { + "header": "$.Header", + "title": "$.Title", + "icon": "$.Icon", + "image": "$.Image" + }, + "actions": { + "$include": "menusystem/pages/hub/dashboard/actions/actions_dashboardtile_vr.json" + } + } + } + ], + "$else": { + "view": "menu3.basic.MenuTileLarge", + "row": 0, + "col": 0, + "nrows": 3, + "ncols": 4, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", + "icon": "story", + "image": "$res images/livetile/tile_story.jpg" + }, + "actions": { + "accept": [ { - "$databinding menusystem/pages/hub/dashboard/data/data_dashboardtile_vr.json": { - "view": "menu3.basic.ButtonTileXXSmall", - "row": 3, - "col": 8, - "nrows": 3, - "ncols": 2, - "data": { - "header": "$.Header", - "title": "$.Title", - "icon": "$.Icon", - "image": "$.Image" - }, - "actions": { - "$include": "menusystem/pages/hub/dashboard/actions/actions_dashboardtile_vr.json" - } + "set-selected": { + "target": "category_story" } } ], - "$else": { - "view": "menu3.basic.MenuTileLarge", - "row": 0, - "col": 0, - "nrows": 3, - "ncols": 4, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "icon": "story", - "image": "$res images/livetile/tile_story.jpg" - }, - "actions": { - "accept": [ - { - "set-selected": { - "target": "category_story" - } - } - ], - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "typeicon": "story" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - } - } - }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 0, - "col": 6, - "nrows": 1.5, - "ncols": 2, - "data": { - "title": "$loc UI_PEACOCK_GO_OFFLINE", - "icon": "goonline", - "image": "$res images/ui/tiles/button_goonline.jpg" - }, - "actions": { - "accept": { - "force-offline": {} - }, "select": { "replace-children": { "target": "headline_container", @@ -178,56 +113,8 @@ "selectable": false, "pressable": false, "data": { - "header": "", - "title": "$loc UI_PEACOCK_GO_OFFLINE", - "typeicon": "goonline" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 0, - "col": 4, - "nrows": 1.5, - "ncols": 2, - "data": { - "header": "$loc UI_PEACOCK_POWERED_BY", - "title": "$loc UI_PEACOCK_BRANDING", - "icon": "story", - "image": "$res images/contracts/novikov_and_magolis/tile.jpg" - }, - "actions": { - "accept": { - "$if $isnullorempty $.ServerTile.url": { - "$then": {}, - "$else": { - "open-url": { - "url": "$.ServerTile.url" - } - } - } - }, - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_PEACOCK_POWERED_BY", - "title": "$loc UI_PEACOCK_BRANDING", + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", "typeicon": "story" } } @@ -241,153 +128,279 @@ } } } + } + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 0, + "col": 6, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_PEACOCK_GO_OFFLINE", + "icon": "goonline", + "image": "$res images/ui/tiles/button_goonline.jpg" + }, + "actions": { + "accept": { + "force-offline": {} }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 1.5, - "col": 6, - "nrows": 1.5, - "ncols": 2, - "data": { - "title": "$loc UI_DIALOG_LOAD_GAME", - "icon": "load", - "image": "$res images/ui/tiles/load_menu_tile.jpg" - }, - "actions": { - "accept": { - "link": { - "page": "loadpage", - "args": { - "url": "load", - "args": { - "saveorload": "load" - }, - "saveorload": "load", - "mainmenu": true, - "reloadonchange": true - } - } - }, - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "", - "title": "$loc UI_DIALOG_LOAD_GAME", - "typeicon": "load" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - }, - { - "$each $.PeacockDashValues": { - "controller": "container", - "row": "$.row", - "col": "$.col", - "nrows": 1.5, - "ncols": 2, - "usechilddimensions": true, + "select": { + "replace-children": { + "target": "headline_container", "children": [ { - "$include": { - "$path": "$.LoadValue" + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "", + "title": "$loc UI_PEACOCK_GO_OFFLINE", + "typeicon": "goonline" } } ] } }, - { - "view": "menu3.basic.MenuTileTall", - "row": 0, - "col": 8, - "nrows": 3, - "ncols": 2, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", - "title": "$loc UI_EVERGREEN_TITLE", - "icon": "evergreen_gamemode", - "image": "$res images/livetile/tile_gamemode_evergreen.jpg" - }, - "actions": { - "accept": [ + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 0, + "col": 4, + "nrows": 1.5, + "ncols": 2, + "data": { + "header": "$loc UI_PEACOCK_POWERED_BY", + "title": "$loc UI_PEACOCK_BRANDING", + "icon": "story", + "image": "$res images/contracts/novikov_and_magolis/tile.jpg" + }, + "actions": { + "accept": { + "open-url": { + "url": "https://thepeacockproject.org" + } + }, + "select": { + "replace-children": { + "target": "headline_container", + "children": [ { - "set-menu-context": { - "value": { - "onpageopened": { - "set-selected": { - "target": "PLANNING_BUTTON_PLAY" - }, - "trigger-input": { - "action": "accept" - } - } - } + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_PEACOCK_POWERED_BY", + "title": "$loc UI_PEACOCK_BRANDING", + "typeicon": "story" } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 1.5, + "col": 6, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_DIALOG_LOAD_GAME", + "icon": "load", + "image": "$res images/ui/tiles/load_menu_tile.jpg" + }, + "actions": { + "accept": { + "link": { + "page": "loadpage", + "args": { + "url": "load", + "args": { + "saveorload": "load" }, + "saveorload": "load", + "mainmenu": true, + "reloadonchange": true + } + } + }, + "select": { + "replace-children": { + "target": "headline_container", + "children": [ { - "link": { - "page": "planning", - "args": { - "url": "planning", - "args": { - "contractid": "f8ec92c2-4fa2-471e-ae08-545480c746ee", - "resetescalation": false - }, - "contractid": "f8ec92c2-4fa2-471e-ae08-545480c746ee" - } + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "", + "title": "$loc UI_DIALOG_LOAD_GAME", + "typeicon": "load" } } - ], - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", - "title": "$loc UI_EVERGREEN_TITLE", - "typeicon": "evergreen_gamemode" - } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "id": "contractattack_button", + "controller": "contextitem", + "view": "menu3.basic.ItemTileSmall", + "row": 1.5, + "col": 4, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_PEACOCK_ESCALATIONS", + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "icon": "54", + "image": "$res images/challenges/profile_challenges/escalation_s2_tier_9.jpg" + }, + "actions": { + "accept": { + "link": { + "page": "gamemode_arcade", + "args": { + "url": "hitscategory", + "type": "ContractAttack", + "mode": "dataonly" + } + } + }, + "select": [ + { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": true, + "pressable": true, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "title": "$loc UI_PEACOCK_ESCALATIONS", + "typeicon": "54" + } + } + ] + } + } + ], + "deselect": [ + { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": true, + "pressable": true + } + ] + } + } + ] + } + }, + { + "view": "menu3.basic.MenuTileTall", + "row": 0, + "col": 8, + "nrows": 3, + "ncols": 2, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "title": "$loc UI_EVERGREEN_TITLE", + "icon": "evergreen_gamemode", + "image": "$res images/livetile/tile_gamemode_evergreen.jpg" + }, + "actions": { + "accept": [ + { + "set-menu-context": { + "value": { + "onpageopened": { + "set-selected": { + "target": "PLANNING_BUTTON_PLAY" + }, + "trigger-input": { + "action": "accept" } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - }, - "actiony": { - "prompt_label": "$loc UI_PEACOCK_GO_TO_DESTINATION", - "link": { - "page": "gamemode_evergreen", - "args": { - "locationId": "LOCATION_PARENT_SNUG" } } } + }, + { + "link": { + "page": "planning", + "args": { + "url": "planning", + "args": { + "contractid": "f8ec92c2-4fa2-471e-ae08-545480c746ee", + "resetescalation": false + }, + "contractid": "f8ec92c2-4fa2-471e-ae08-545480c746ee" + } + } + } + ], + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "title": "$loc UI_EVERGREEN_TITLE", + "typeicon": "evergreen_gamemode" + } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + }, + "actiony": { + "prompt_label": "$loc UI_PEACOCK_GO_TO_DESTINATION", + "link": { + "page": "gamemode_evergreen", + "args": { + "locationId": "LOCATION_PARENT_SNUG" + } } } - ] + } } - } + ] } } diff --git a/static/H2CareerTemplate.json b/static/H2CareerTemplate.json new file mode 100644 index 00000000..05d2565e --- /dev/null +++ b/static/H2CareerTemplate.json @@ -0,0 +1,171 @@ +{ + "controller": "categoryitem", + "view": "menu3.basic.CategoryElement", + "id": "career_tab", + "data": { + "title": "$loc UI_MENU_PAGE_HUB_PROFILE", + "icon": "profile" + }, + "actions": { + "activated": { + "set-value": { + "target": "$.@global.CurrentBackgroundImage", + "value": "images/backgrounds/menu_bg.jpg" + } + } + }, + "children": [ + { + "controller": "context", + "view": "menu3.containers.ScrollingListContainer", + "row": 1, + "nrows": 3, + "ncols": 10, + "direction": "horizontal", + "data": { + "direction": "horizontal" + }, + "children": [ + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Title": "$loc UI_MENU_PAGE_PROFILE_PLAYER_PROFILE", + "Icon": "profile", + "Image": "$res images/ui/career/0.jpg", + "ExtraActions": { + "accept": { + "link": { + "page": "playerprofile", + "args": { + "url": "playerprofile" + } + } + } + } + }, + "do": { + "$include": { + "$path": "menusystem/pages/hub/career/profiletile.json" + } + } + } + }, + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Title": "$loc UI_MENU_PAGE_PROFILE_CHALLENGES", + "Icon": "challenge", + "Image": "$res images/ui/career/1.jpg", + "Id": "challenge_tile" + }, + "do": { + "$mergeobjects": [ + { + "$include": { + "$path": "menusystem/pages/hub/career/profiletile.json" + } + }, + { + "children": [ + { + "$include": { + "$path": "menusystem/elements/challenges/challengelocationview.json" + } + } + ] + } + ] + } + } + }, + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Title": "$loc UI_MENU_PAGE_PROFILE_MASTERY", + "Icon": "unlocked", + "Image": "$res images/ui/career/2.jpg", + "Id": "mastery_tile" + }, + "do": { + "$mergeobjects": [ + { + "$include": { + "$path": "menusystem/pages/hub/career/profiletile.json" + } + }, + { + "children": [ + { + "$include": { + "$path": "menusystem/elements/mastery/masterylocationview.json" + } + } + ] + } + ] + } + } + }, + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Title": "$loc UI_MENU_PAGE_SAFEHOUSE_ELEMENT_CATEGORY_INVENTORY", + "Icon": "inventory", + "Image": "$res images/ui/career/3.jpg", + "ExtraActions": { + "accept": { + "link": { + "page": "safehouse", + "args": { + "url": "safehousecategory", + "usetalltile": false + } + } + } + } + }, + "do": { + "$include": { + "$path": "menusystem/pages/hub/career/profiletile.json" + } + } + } + }, + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Title": "$loc UI_MENU_PAGE_HITS_ELEMENT_CATEGORY_Elusive_Target_Hits", + "Icon": "elusive", + "Image": "$res images/ui/career/4.jpg", + "Category": "Elusive_Target_Hits", + "Id": "career_tab_Elusive_Target_Hits" + }, + "do": { + "$mergeobjects": [ + { + "$include": { + "$path": "menusystem/pages/hub/career/profiletile.json" + } + }, + { + "children": [ + { + "$include": { + "$path": "menusystem/elements/contract/contractshitcategoryloading.json" + } + } + ] + } + ] + } + } + } + ] + } + ] +} diff --git a/static/H2DashboardTemplate.json b/static/H2DashboardTemplate.json index e94861fc..6d110139 100644 --- a/static/H2DashboardTemplate.json +++ b/static/H2DashboardTemplate.json @@ -1,237 +1,321 @@ { - "$datacontext": { - "in": "$.", - "datavalues": { - "PeacockDashValues": [ - { - "Id": "25739126-6a40-4b0b-b9a6-5da1b737190b", - "Type": "ContractList", - "Title": "UI_HEADLINE_PLAY_CONTRACT_ATTACK", - "Text": "UI_HEADLINE_PLAY_CONTRACT_ATTACK", - "Date": "2022-01-01T00:00:00.0000000Z", - "SubscriptionId": "10000000-0000-0000-0000-000000000000", - "Priority": 40, - "Properties": { - "ContractId": "25739126-6a40-4b0b-b9a6-5da1b737190b", - "DashboardCategory": "Dashboard_Category_Escalation" - }, - "LoadValue": "menusystem/pages/hub/dashboard/category_escalation/loadasync.json", - "row": 1.5, - "col": 4 - } - ] - }, - "do": { - "controller": "group", - "row": 1, - "nrows": 3, - "ncols": 10, - "layoutchildren": true, - "children": { - "$mergearrays": [ - { - "view": "menu3.basic.MenuTileLarge", - "row": 0, - "col": 0, - "nrows": 3, - "ncols": 4, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "icon": "story", - "image": "$res images/livetile/tile_story.jpg" - }, - "actions": { - "accept": [ - { - "set-selected": { - "target": "category_story" - } - } - ], - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", - "title": "$loc UI_MENU_PAGE_HUB_STORY", - "typeicon": "story" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } + "controller": "group", + "row": 1, + "nrows": 3, + "ncols": 10, + "layoutchildren": true, + "children": { + "$mergearrays": [ + { + "view": "menu3.basic.MenuTileLarge", + "row": 0, + "col": 0, + "nrows": 3, + "ncols": 4, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", + "icon": "story", + "image": "$res images/livetile/tile_story.jpg" + }, + "actions": { + "accept": [ + { + "set-selected": { + "target": "category_story" } } - }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 0, - "col": 6, - "nrows": 1.5, - "ncols": 2, - "data": { - "title": "$loc UI_PEACOCK_GO_OFFLINE", - "icon": "goonline", - "image": "$res images/ui/tiles/button_goonline.jpg" - }, - "actions": { - "accept": { - "force-offline": {} - }, - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "", - "title": "$loc UI_PEACOCK_GO_OFFLINE", - "typeicon": "goonline" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 0, - "col": 4, - "nrows": 1.5, - "ncols": 2, - "data": { - "header": "$loc UI_PEACOCK_POWERED_BY", - "title": "$loc UI_PEACOCK_BRANDING", - "icon": "story", - "image": "$res images/contracts/novikov_and_magolis/tile.jpg" - }, - "actions": { - "accept": { - "$if $isnullorempty $.ServerTile.url": { - "$then": {}, - "$else": { - "open-url": { - "url": "$.ServerTile.url" - } - } - } - }, - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "$loc UI_PEACOCK_POWERED_BY", - "title": "$loc UI_PEACOCK_BRANDING", - "typeicon": "story" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - }, - { - "view": "menu3.basic.ItemTileSmall", - "row": 1.5, - "col": 6, - "nrows": 1.5, - "ncols": 2, - "data": { - "title": "$loc UI_DIALOG_LOAD_GAME", - "icon": "load", - "image": "$res images/ui/tiles/load_menu_tile.jpg" - }, - "actions": { - "accept": { - "link": { - "page": "loadpage", - "args": { - "url": "load", - "args": { - "saveorload": "load" - }, - "saveorload": "load", - "mainmenu": true, - "reloadonchange": true - } - } - }, - "select": { - "replace-children": { - "target": "headline_container", - "children": [ - { - "view": "menu3.basic.HeadlineElement", - "selectable": false, - "pressable": false, - "data": { - "header": "", - "title": "$loc UI_DIALOG_LOAD_GAME", - "typeicon": "load" - } - } - ] - } - }, - "deselect": { - "replace-children": { - "target": "headline_container", - "children": [] - } - } - } - }, - { - "$each $.PeacockDashValues": { - "controller": "container", - "row": "$.row", - "col": "$.col", - "nrows": 1.5, - "ncols": 2, - "usechilddimensions": true, + ], + "select": { + "replace-children": { + "target": "headline_container", "children": [ { - "$include": { - "$path": "$.LoadValue" + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_CAMPAIGN", + "title": "$loc UI_MENU_PAGE_HUB_STORY", + "typeicon": "story" } } ] } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } } - ] + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 0, + "col": 6, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_PEACOCK_GO_OFFLINE", + "icon": "goonline", + "image": "$res images/ui/tiles/button_goonline.jpg" + }, + "actions": { + "accept": { + "force-offline": {} + }, + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "", + "title": "$loc UI_PEACOCK_GO_OFFLINE", + "typeicon": "goonline" + } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 0, + "col": 4, + "nrows": 1.5, + "ncols": 2, + "data": { + "header": "$loc UI_PEACOCK_POWERED_BY", + "title": "$loc UI_PEACOCK_BRANDING", + "icon": "story", + "image": "$res images/contracts/novikov_and_magolis/tile.jpg" + }, + "actions": { + "accept": { + "open-url": { + "url": "https://thepeacockproject.org" + } + }, + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_PEACOCK_POWERED_BY", + "title": "$loc UI_PEACOCK_BRANDING", + "typeicon": "story" + } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "view": "menu3.basic.ItemTileSmall", + "row": 1.5, + "col": 6, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_DIALOG_LOAD_GAME", + "icon": "load", + "image": "$res images/ui/tiles/load_menu_tile.jpg" + }, + "actions": { + "accept": { + "link": { + "page": "loadpage", + "args": { + "url": "load", + "args": { + "saveorload": "load" + }, + "saveorload": "load", + "mainmenu": true, + "reloadonchange": true + } + } + }, + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "", + "title": "$loc UI_DIALOG_LOAD_GAME", + "typeicon": "load" + } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } + }, + { + "id": "contractattack_button", + "controller": "contextitem", + "view": "menu3.basic.MenuTileSmall", + "row": 1.5, + "col": 4, + "nrows": 1.5, + "ncols": 2, + "data": { + "title": "$loc UI_PEACOCK_ESCALATIONS", + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "icon": "54", + "image": "$res images/livetile/tile_contractescalation_nocontent.jpg" + }, + "selectable": true, + "pressable": true, + "actions": { + "accept": { + "link": { + "page": "gamemode_sniper", + "args": { + "url": "hitscategory", + "type": "ContractAttack", + "mode": "dataonly" + } + } + }, + "select": [ + { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": true, + "pressable": true, + "data": { + "header": "$loc UI_MENU_PAGE_HUB_GAMEMODE", + "title": "$loc UI_PEACOCK_ESCALATIONS", + "typeicon": "54" + } + } + ] + } + } + ], + "deselect": [ + { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": true, + "pressable": true + } + ] + } + } + ] + } + }, + { + "view": "menu3.basic.MenuTileTall", + "row": 0, + "col": 8, + "nrows": 3, + "ncols": 2, + "data": { + "header": "$loc UI_PEACOCK_BRANDING", + "title": "$loc UI_MENU_PAGE_HITS_ELEMENT_CATEGORY_Elusive_Target_Hits", + "icon": "elusive", + "image": "$res images/challenges/categories/elusive/tile.jpg" + }, + "actions": { + "accept": [ + { + "call": { + "onmenuframe": true, + "method": "showBackground", + "args": false + } + }, + { + "set-selected": { + "target": "career_tab" + } + }, + { + "set-selected": { + "target": "$formatstring career_tab_Elusive_Target_Hits" + } + }, + { + "trigger-input": { + "action": "accept" + } + }, + { + "call": { + "onmenuframe": true, + "method": "showBackground", + "args": true + } + } + ], + "select": { + "replace-children": { + "target": "headline_container", + "children": [ + { + "view": "menu3.basic.HeadlineElement", + "selectable": false, + "pressable": false, + "data": { + "header": "$loc UI_PEACOCK_BRANDING", + "title": "$loc UI_MENU_PAGE_HITS_ELEMENT_CATEGORY_Elusive_Target_Hits", + "typeicon": "elusive" + } + } + ] + } + }, + "deselect": { + "replace-children": { + "target": "headline_container", + "children": [] + } + } + } } - } + ] } } diff --git a/static/H2SniperContentTemplate.json b/static/H2SniperContentTemplate.json new file mode 100644 index 00000000..643b795e --- /dev/null +++ b/static/H2SniperContentTemplate.json @@ -0,0 +1,191 @@ +{ + "$if $eq ($.data.Data.Type,ContractAttack)": { + "$then": { + "$include": { + "$path": "menusystem/pages/gamemodes/gamemodearcade_page.json" + } + }, + "$else": { + "id": "gamemodesniper_root", + "controller": "list", + "children": [ + { + "controller": "category", + "id": "category_controller", + "view": "menu3.containers.ScrollingTabsContainer", + "direction": "horizontal", + "data": { + "direction": "horizontal", + "topnavigation": { + "title": "$loc UI_MENU_PAGE_HUB_GAMEMODES", + "icon": "mission" + } + }, + "children": [ + { + "view": "menu3.basic.CategoryElement", + "controller": "categoryitem", + "data": { + "title": "$loc UI_SNIPER_CHALLENGE_TITLE", + "icon": "sniperrifle" + }, + "children": [ + { + "controller": "container", + "id": "statusline_container", + "view": "menu3.containers.ListContainer", + "direction": "horizontal", + "data": { + "direction": "horizontal" + }, + "row": 4.92, + "col": 0, + "selectable": false, + "pressable": false, + "children": [] + }, + { + "id": "hitscategory_container", + "controller": "context", + "view": "menu3.containers.ScrollingListContainer", + "row": 4.25, + "nrows": 0.5, + "ncols": 10, + "direction": "horizontal", + "data": { + "direction": "horizontal", + "scrollbarspaceoffset": -440 + }, + "children": { + "$each $.data.Data.Hits": { + "$datacontext": { + "in": "$.", + "datavalues": { + "Contract": "$.UserCentricContract.Contract", + "ResourceAvailability": "$availabilityofcontract $.UserCentricContract.Contract" + }, + "do": { + "id": "$formatstring {$.UserCentricContract.Contract.Metadata.Title}_button", + "view": "menu3.basic.SimpleButtonTile", + "controller": "contextitem", + "nrows": 0.5, + "ncols": 2, + "data": { + "title": "$loc $formatstring UI_{$.UserCentricContract.Contract.Metadata.Location}_CITY", + "header": "$loc $.UserCentricContract.Contract.Metadata.Title", + "_icon": { + "$include": { + "$path": "menusystem/elements/contract/data/contract_icon.json" + } + }, + "availability": "$.ResourceAvailability.Availability" + }, + "actions": { + "select": { + "replace-children": { + "target": "statusline_container", + "children": { + "$include": { + "$path": "menusystem/elements/contract/data/contract_statusline.json" + } + } + }, + "call": { + "onmenuframe": true, + "method": "setBackground", + "args": { + "$include": { + "$path": "menusystem/elements/contract/data/contract_backgroundimage.json" + } + } + } + }, + "deselect": { + "replace-children": { + "target": "statusline_container", + "children": [] + } + }, + "accept": { + "$if": { + "$condition": { + "$include": { + "$path": "menusystem/data/issnipermultiplayeravailable.json" + } + }, + "$then": { + "$if $not $eq($.ResourceAvailability.State,available)": { + "$then": { + "$include": { + "$path": "menusystem/actions/availability/not_available_action.json" + } + } + } + }, + "$else": { + "$include": { + "$path": "menusystem/elements/contract/actions/contract_gotoplanning.json" + } + } + } + } + }, + "children": [ + { + "id": "sub_list", + "controller": "list", + "view": "menu3.containers.ScrollingListContainer", + "nrows": 0.5, + "ncols": 10, + "direction": "horizontal", + "data": { + "direction": "horizontal", + "scrollbarspaceoffset": -440 + }, + "children": [ + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Contract": "$.Contract", + "ResourceAvailability": "$.ResourceAvailability", + "EngineMode": "$.Contract.Metadata.Enginemodes[0]" + }, + "do": { + "$include": { + "$path": "menusystem/pages/gamemodes/contentsniper/button_contractmode.json" + } + } + } + }, + { + "$datacontext": { + "in": "$.", + "datavalues": { + "Contract": "$.Contract", + "ResourceAvailability": "$.ResourceAvailability", + "EngineMode": "$.Contract.Metadata.Enginemodes[1]" + }, + "do": { + "$include": { + "$path": "menusystem/pages/gamemodes/contentsniper/button_contractmode.json" + } + } + } + } + ] + } + ] + } + } + } + } + } + ] + } + ] + } + ] + } + } +} diff --git a/static/HitsCategoryContractAttackTemplate.json b/static/HitsCategoryContractAttackTemplate.json index eb3a3515..7dcb6d83 100644 --- a/static/HitsCategoryContractAttackTemplate.json +++ b/static/HitsCategoryContractAttackTemplate.json @@ -1,76 +1,69 @@ { - "$datacontext": { - "in": "$.data", - "datavalues": { - "NoContractsAvailableLine": "UI_MENU_PAGE_NO_CONTRACTS_AVAILABLE", - "GroupedHits": { + "controller": "category", + "id": "sub_category_container", + "row": -1, + "col": 0, + "view": "menu3.containers.ScrollingTabsContainer", + "ncols": 10, + "direction": "horizontal", + "submenunavigation": true, + "loopedselection": false, + "data": { + "direction": "horizontal", + "submenu": true + }, + "children": { + "$each": { + "in": { "$arraygroupby": { "source": "$.data.Data.Hits", - "property": "UserCentricContract.Contract.Metadata.Season", - "order": ["0", "1", "2", "3"] + "property": "UserCentricContract.Contract.Metadata.Season" } - } - }, - "do": { - "controller": "category", - "id": "sub_category_container", - "row": -1, - "col": 0, - "view": "menu3.containers.ScrollingTabsContainer", - "ncols": 10, - "direction": "horizontal", - "submenunavigation": true, - "loopedselection": false, - "data": { - "direction": "horizontal", - "submenu": true }, - "children": { - "$each $.GroupedHits": { - "id": "$formatstring category_season_{$.by, .f}", - "view": "menu3.basic.SubCategoryElement", - "controller": "categoryitem", - "data": { - "title": { - "$if $eq ($.by, 0)": { - "$then": "$loc UI_PEACOCK_BRANDING_SHORT", - "$else": "$loc $formatstring UI_SEASON_{$.by, .f}" - } + "do": { + "id": "$formatstring category_season_{$.by, .f}", + "view": "menu3.basic.SubCategoryElement", + "controller": "categoryitem", + "data": { + "title": { + "$if $eq ($.by, 0)": { + "$then": "$loc UI_PEACOCK_BRANDING_SHORT", + "$else": "$loc $formatstring UI_SEASON_{$.by, .f}" } - }, - "children": [ - { - "controller": "group", - "view": "menu3.containers.ScrollingListContainer", - "layoutchildren": true, - "id": "hitscategory_container", - "row": 1, - "nrows": 3, - "ncols": 10, - "pressable": false, - "navigationmode": "leaf-selection", - "data": { - "direction": "horizontal" - }, - "hidedefaultnocontent": false, - "children": { - "$datacontext": { - "in": "$.", - "datavalues": { - "Data": { - "Hits": "$.group" - } - }, - "do": { - "$include": { - "$path": "menusystem/elements/contract/hitscategory_contracts.json" - } + } + }, + "children": [ + { + "controller": "group", + "view": "menu3.containers.ScrollingListContainer", + "layoutchildren": true, + "id": "hitscategory_container", + "row": 1, + "nrows": 3, + "ncols": 10, + "pressable": false, + "navigationmode": "leaf-selection", + "data": { + "direction": "horizontal" + }, + "hidedefaultnocontent": false, + "children": { + "$datacontext": { + "in": "$.", + "datavalues": { + "Data": { + "Hits": "$.group" + } + }, + "do": { + "$include": { + "$path": "menusystem/elements/contract/hitscategory_contracts.json" } } } } - ] - } + } + ] } } }