Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels.js
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | g_SelectionPanels.Barter = { | ||||
{ | { | ||||
return 4; | return 4; | ||||
}, | }, | ||||
"rowLength": 4, | "rowLength": 4, | ||||
"conflictsWith": ["Garrison"], | "conflictsWith": ["Garrison"], | ||||
"getItems": function(unitEntStates) | "getItems": function(unitEntStates) | ||||
{ | { | ||||
// If more than `rowLength` resources, don't display icons. | // If more than `rowLength` resources, don't display icons. | ||||
if (unitEntStates.every(state => !state.isBarterMarket) || g_ResourceData.GetCodes().length > this.rowLength) | if (unitEntStates.every(state => !state.isBarterMarket) || g_ResourceData.GetCodes("barterable").length > this.rowLength) | ||||
return []; | return []; | ||||
return g_ResourceData.GetCodes(); | return g_ResourceData.GetCodes("barterable"); | ||||
}, | }, | ||||
"setupButton": function(data) | "setupButton": function(data) | ||||
{ | { | ||||
barterOpenCommon(data.item, data.i, "unitBarter"); | barterOpenCommon(data.item, data.i, "unitBarter"); | ||||
barterUpdateCommon(data.item, data.i, "unitBarter", data.player); | barterUpdateCommon(data.item, data.i, "unitBarter", data.player); | ||||
let button = {}; | let button = {}; | ||||
for (let action of g_BarterActions) | for (let action of g_BarterActions) | ||||
▲ Show 20 Lines • Show All 1,083 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator