Group elusives by season

This commit is contained in:
AnthonyFuller 2023-04-14 04:15:58 +01:00
parent 4575924e80
commit f954ed3ee6
3 changed files with 122 additions and 6 deletions

View File

@ -113,6 +113,7 @@ import MasteryDataForLocationTemplate from "../static/MasteryDataForLocationTemp
import DefaultCpdConfig from "../static/DefaultCpdConfig.json"
import EvergreenGameChangerProperties from "../static/EvergreenGameChangerProperties.json"
import AreaMap from "../static/AreaMap.json"
import HitsCategoryElusiveTemplate from "../static/HitsCategoryElusiveTemplate.json"
import type { GameVersion } from "./types/types"
import { fastClone } from "./utils"
@ -213,6 +214,7 @@ const configs: Record<string, unknown> = {
DefaultCpdConfig,
EvergreenGameChangerProperties,
AreaMap,
HitsCategoryElusiveTemplate,
}
Object.keys(configs).forEach((cfg) => {

View File

@ -84,10 +84,6 @@ export class MenuSystemDatabase {
configs.push(
"menusystem/elements/settings/data/isnonvroptionvisible.json",
)
configs.push(
"menusystem/elements/contract/hitscategory_elusive.json",
)
}
if (["h3", "h1"].includes(gameVersion)) {
@ -108,6 +104,10 @@ export class MenuSystemDatabase {
"menusystem/pages/hub/dashboard/category_escalation/result.json",
)
configs.push(
"menusystem/elements/contract/hitscategory_elusive.json",
)
// The following is to allow restart/replan/save/load on elusive contracts
// alongside removing the warning when starting one in H2/3 - AF
configs.push(
@ -126,6 +126,9 @@ export class MenuSystemDatabase {
configs.push(
"menusystem/pages/multiplayer/content/lobbyslim.json",
)
configs.push(
"menusystem/elements/contract/contractshitcategoryloading.json",
)
}
},
)
@ -143,9 +146,49 @@ export class MenuSystemDatabase {
},
}
case "/elements/contract/hitscategory_elusive.json":
return getConfig("HitsCategoryElusiveTemplate", false)
case "/elements/contract/contractshitcategoryloading.json":
return {
$include:
"menusystem/elements/contract/hitscategory.json",
controller: "group",
view: "menu3.containers.ScrollingListContainer",
layoutchildren: true,
id: "hitscategory_container",
nrows: 3,
ncols: 10,
pressable: false,
data: { direction: "horizontal" },
actions: {
activated: {
"load-async": {
path: {
"$if $eq ($.Category,Elusive_Target_Hits)":
{
$then: "menusystem/elements/contract/hitscategory_elusive.json",
$else: "menusystem/elements/contract/hitscategory.json",
},
},
from: {
url: "hitscategory",
args: {
page: 0,
type: "$.Category",
mode: "dataonly",
},
},
target: "hitscategory_container",
showloadingindicator: true,
blocksinput: false,
"post-load-action": [
{
"set-selected": {
target: "hitscategory_container",
},
},
],
},
},
},
children: [{ pressable: false, selectable: true }],
}
case "/data/ishitman3available.json":
return {

View File

@ -0,0 +1,71 @@
{
"$datacontext": {
"in": "$.data",
"datavalues": {
"NoContractsAvailableLine": "UI_MENU_PAGE_NO_CONTRACTS_AVAILABLE",
"GroupedHits": {
"$arraygroupby": {
"source": "$.data.Data.Hits",
"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": "$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"
}
}
}
}
}
]
}
}
}
}
}