-
Notifications
You must be signed in to change notification settings - Fork 0
Gear Buy Menu Render And Price Function Reference
Source-verified 2026-06-21 against master 0139a346. Paths relative to Missions/[55-2hc]warfarev2_073v48co.chernarus/ unless noted. Arma 2 OA 1.64.
The gear buy dialog (Rsc/Dialogs.hpp, IDC family 503xxx) is driven by a single long-lived loop in Client/GUI/GUI_BuyGearMenu.sqf. That loop owns all state; the WFBE_CL_FNC_UI_Gear_* functions documented here are the stateless view layer it calls to repaint listboxes, comboboxes, the price label, and to normalize the data it feeds them. This page is the per-function contract for that view layer. It is deliberately distinct from the gear content catalogs (the per-faction class lists and the EASA mutation concept) — see Gear Loadout And EASA Atlas and Gear Store Catalog Per Faction. All eight functions are compiled at client init alongside the other gear UI helpers in Client/Init/Init_Client.sqf:143-151. (That block is not exactly these eight: line 146 compiles a sibling, WFBE_CL_FNC_UI_Gear_FillTemplates, which is not covered on this page.)
Every render function below resolves a class name to a global tuple stored in missionNamespace. Weapon/item classes are stored under their own name; magazine classes are stored under a Mag_ prefix. The tuple field layout is fixed at catalog-build time and read positionally everywhere in this family:
| Index | Weapon tuple (Config_Weapons.sqf) |
Magazine tuple (Mag_*, Config_Magazines.sqf) |
|---|---|---|
| 0 | picture path (Config_Weapons.sqf:34) |
picture path (Config_Magazines.sqf:24) |
| 1 | displayName (Config_Weapons.sqf:35) |
displayName (Config_Magazines.sqf:25) |
| 2 | price (Config_Weapons.sqf:36) |
price (Config_Magazines.sqf:26) |
| 3 | required gear upgrade level (Config_Weapons.sqf:37) |
required gear upgrade level (Config_Magazines.sqf:27) |
| 4 | "belong" / slot type (Config_Weapons.sqf:38) |
pool type (Config_Magazines.sqf:28) |
| 5 | inventory size span (Config_Weapons.sqf:39) |
mag slot count = type/_div (Config_Magazines.sqf:29) |
| 6 | magazines array (Config_Weapons.sqf:40) |
own class name (Config_Magazines.sqf:30) |
Slot-type (index 4) values for weapons: 0 primary, 1 pistol, 2 launcher, 4 equipment, 5 item (Config_Weapons.sqf:21-26). Pool-type for magazines: 101 main pool, 100 secondary/hand pool (Config_Magazines.sqf:19-20). These literals are the switch keys the render layer branches on below.
Selectively repaints the equipped-loadout picture slots (the left-hand "what the unit is wearing" panel), section by section, so the loop never has to repaint the whole panel on every click.
| Aspect | Detail |
|---|---|
| Params |
[_weapons, _magazines, _refresh] (Client_UI_Gear_DisplayInventory.sqf:11-13) |
| Returns | nothing (side-effect: ctrlSetText on picture controls) |
| Refresh selector |
_refresh is a string array; "all" lights every section flag, else granular "items", "magazines_main", "magazines_hand", "weapons", "special" each set one flag (:21-26) |
| Weapon section | IDCs primary 503401 / secondary 503402 / sidearm 503403; switch on tuple index 4 routes each weapon to its slot, case 3 hides the secondary slot, cases 200/201 push to secondary (:28-46) |
| Empty-slot fallback | unfilled weapon IDCs get placeholder paas ui_gear_gun_gs / ui_gear_sec_gs / ui_gear_hgun_gs (:48-50) |
| Special section | up to 2 slots at IDC 503533-503534 for tuple type 4 (:53-72) |
| Items section | up to 12 slots from base IDC 503521, tuple type 5 (:73-90) |
| Main magazines | up to 12 slots from base IDC 503501, tuple type 101; a mag consumes _size-1 extra blanked cells per its index-5 span (:92-115) |
| Hand magazines | up to 8 slots from base IDC 503513, tuple type 100, same span logic (:117-140) |
| Magazine lookup | magazines are resolved via Format["Mag_%1",_x] (:97, :122) |
| Call site |
GUI_BuyGearMenu.sqf:508, only when _view == "gear"
|
Computes the net buy/sell cost of the pending loadout change as a single integer delta, used to drive the "Gear Cost" label. Compares an old loadout against a new one for weapons, magazines, and (non-vanilla) backpack/vehicle cargo.
| Aspect | Detail |
|---|---|
| Params |
[_gear, _gear_mags, _gear_bp, _gear_veh], each a [old, new] pair; deep-copied with + (Client_UI_Gear_UpdatePrice.sqf:7-10) |
| Returns |
[_price] — a one-element array holding the signed cost (:92); caller reads select 0 (GUI_BuyGearMenu.sqf:501) |
| Sell coefficient | refunds are scaled by _div; 0 when the active view is "vehicle" (no sell-back), otherwise WFBE_C_PLAYERS_GEAR_SELL_COEF (:13, default 0.6 at Common/Init/Init_CommonConstants.sqf:422) |
| View source | reads the current view from combobox 503003 via lbData (:11) |
| Diff algorithm | for weapons then magazines (Mag_ prefix added on the second pass, :34): items present in both old and new are cancelled (set [_find, false]), removed items refund price*_div, surviving new items add full price (:16-35) |
| Cargo branch | only when !WF_A2_Vanilla: walks backpack and vehicle cargo as [[mags],[counts]] per slot, charging/refunding the per-unit count difference (:37-90) |
| Constant |
WFBE_C_PLAYERS_GEAR_SELL_COEF (Common/Init/Init_CommonConstants.sqf:422) |
| Call sites |
GUI_BuyGearMenu.sqf:443 (total gear-cost stamp on equip — weapons+magazines+backpack with the vehicle pair passed empty; result stored as wfbe_custom_gear_cost at :444) and :500 (full pending-change price) |
Rebuilds the view combobox (IDC 503003) — the dropdown that switches the right-hand panel between Gear, Backpack, and Vehicle. Content is conditional on what the selected target can carry.
| Aspect | Detail |
|---|---|
| Params |
[_backpack, _target] (Client_UI_Gear_UpdateView.sqf:10-11) |
| Returns | nothing (side-effect: rebuilds combobox 503003) |
| Combobox | clears 503003, then lbAdd/lbSetData per entry (:13, :26) |
| Man target | offers "Backpack" only if _backpack resolves to a tuple of type 200 (:17), always offers "Gear", and offers "Vehicle" when non-vanilla and the unit is in a vehicle (:18-19) |
| Non-man target | a single "Vehicle" entry, pre-selected (:20-23) |
| Default selection | re-selects "gear" (or "vehicle" for non-man) by matching data string (:14, :26) |
| Call sites |
GUI_BuyGearMenu.sqf:104, :164, :326, plus :58 on backpack removal |
Rebuilds the target combobox (IDC 503004) — which friendly unit/vehicle the loadout edits apply to — gated by proximity to a barracks factory or a camp/depot, depending on the server's gear-buy mode.
| Aspect | Detail |
|---|---|
| Params |
_this is the currently-selected target object (Client_UI_Gear_UpdateTarget.sqf:6) |
| Returns | the eligible-targets array _temp (:54); caller stores it as _targets (GUI_BuyGearMenu.sqf:25) |
| Combobox | clears 503004, repopulates with lbAdd, restores selection (:8, :46-53) |
| Candidate set | leader gets all live units via WFBE_CO_FNC_GetLiveUnits, otherwise just [player] (:9) |
| Factory gate | nearest side barracks factories via GetFactories; a unit qualifies if within WFBE_C_UNITS_PURCHASE_GEAR_RANGE (:16, :24-26) |
| Camp/depot gate | active when WFBE_C_TOWNS_GEAR is 1/2/3 (:18-19); mode 1 = closest camp, 2 = closest depot, 3 = either, via WFBE_CL_FNC_GetClosestCamp/GetClosestDepot and the player-vs-AI mobile ranges (:27-36) |
| Vehicle add | non-vanilla also lists nearby local vehicles within WFBE_C_PLAYERS_GEAR_VEHICLE_RANGE (:40-42) |
| Locality guard | a unit/vehicle is only added when local (:37, :41) |
| Labels | men labelled [AIID] name, vehicles by displayName (:48) |
| Constant |
WFBE_C_TOWNS_GEAR modes 0/1/2/3 (Common/Init/Init_CommonConstants.sqf:485) |
| Call sites |
GUI_BuyGearMenu.sqf:25, :74, :492
|
Populates the purchasable-gear store listbox (an lnb/list-n-box) with one row per buyable class, applying the per-side gear upgrade-level visibility gate.
| Aspect | Detail |
|---|---|
| Params |
[_lb, _gear] where _gear is an array of [classNames, optionalPrefix] groups (Client_UI_Gear_FillList.sqf:9-11) |
| Returns | nothing (populates _lb) |
| Upgrade gate | reads the side's gear upgrade tier via (GetSideUpgrades) select WFBE_UP_GEAR and skips any class whose tuple index 3 exceeds it (:12, :21) |
| Row content | column 0 = $price., column 1 = displayName; picture set from tuple index 0; row data = the (prefixed) class name (:22-24) |
| Prefix | per group; the magazine group passes "Mag_" so lookups hit the Mag_ namespace (:17, :19) |
| Error path | an unresolved class logs an ERROR naming Team_x.sqf as the fix site (:27-28) |
| Constant |
WFBE_UP_GEAR = 13 (Common/Init/Init_CommonConstants.sqf:50) |
| Call sites |
GUI_BuyGearMenu.sqf:125-129 (tab dispatch: All / Primary / Secondary / Pistols / Equipment) and :409 (per-weapon compatible-magazine list) |
Populates the cargo-style listbox (IDC 503005) used for the Backpack and Vehicle views, where rows are [items, counts] rather than upgrade-gated store entries.
| Aspect | Detail |
|---|---|
| Params |
[_lb, _gear, _clear] (Client_UI_Gear_FillCargoList.sqf:9-12) |
| Returns | nothing (populates _lb) |
| Clear | optionally lnbClear first (:14) |
| Structure |
_gear is grouped slots; each slot is [items, counts]; sub-index 1 uses the "Mag_" prefix (:17-22) |
| Row content | column 0 = x{count}, column 1 = displayName; picture from tuple index 0; row data = prefixed class (:26-28) |
| No upgrade gate | unlike FillList, this resolves and shows whatever is in cargo without checking upgrade level |
| Call sites |
GUI_BuyGearMenu.sqf:144, :146, :197, :199, :216, :223, :269, :287, :357, :367 (backpack/vehicle repaints) |
Expands a compact [items, counts] magazine spec into a flat per-unit list, so a saved template's "3x of mag X" becomes three discrete entries the inventory pipeline can place individually.
| Aspect | Detail |
|---|---|
| Params |
_this is [items, counts] (Client_UI_Gear_ParseTemplateContent.sqf:8) |
| Returns | flat magazine array _magazines (:22); empty array when input is empty (:18-20) |
| Behavior | for each item, pushes it count times via WFBE_CO_FNC_ArrayPush (:14-17) |
| Call site |
GUI_BuyGearMenu.sqf:306 (template apply) |
Drops classes that have no registered gear tuple, so a stale or cross-faction loadout (e.g. from a profile saved on another side) cannot poison the render/price passes with undefined lookups.
| Aspect | Detail |
|---|---|
| Params |
[_content, _type] where _type is "magazines" or "weapons" (Client_UI_Gear_Sanitize.sqf:10-11) |
| Returns | a deep-copied, filtered list _sanitized (:13, :23) |
| Magazines | removes any class with no Mag_-prefixed tuple (:15-17) |
| Weapons | removes any class with no root-namespace tuple (:18-20) |
| Call sites |
GUI_BuyGearMenu.sqf:79-80 (sanitize the target's current weapons and magazines before they enter the edit loop) |
The view functions are not self-triggering; they fire in response to WFBE_MenuAction codes the dialog controls set. Relevant bindings, all in GUI_BuyGearMenu.sqf: combobox 503003 onLBSelChanged sets action 301 → _update_view (Rsc/Dialogs.hpp:663, GUI_BuyGearMenu.sqf:50); combobox 503004 sets 302 → _update_target (Rsc/Dialogs.hpp:668, GUI_BuyGearMenu.sqf:51). On each loop iteration the dirty flags drive, in order: UpdatePrice into the Gear Cost label (:496-503) then DisplayInventory when the gear view is active (:506-509). WF_A2_Vanilla (set in initJIPCompatible.sqf:95-97) is the master branch that turns off the vehicle/backpack cargo paths in UpdatePrice, UpdateView, and UpdateTarget for plain Arma 2.
Home | Agent Guide | Current live state | Release 1.2.2 (B91) | Quickstart | Progress | Lifecycle wait-chain | Join/disconnect | Parameters/build | Assets/config | SQF atlas | PV index | Modules | Support/specials | Commander/HQ | Commander vote/reassign | Construction/CoIn | Construction cleanup | WDDM compositions | Factory/purchase | Upgrades/research | Towns/camps/capture | Victory/endgame | Markers/cleanup | Server runtime | AI runtime/HC | AI commander audit | HC delegation | Town AI safety | Commander reassignment | Resistance supply | Player UI workflow | UI atlas | Respawn/death | Gear template filter | Vehicle cargo loop | Service guards | UI IDD repair | UI design inspiration | WASP overlay | Feature status | Source propagation | release readiness | Tooling readiness | Integration trust | AntiStack DB | Owner decisions | Shelved registry | Abandoned feature revival | Hardening roadmap | PVF dispatch | Server authority | ICBM authority | Attack-wave authority | Telemetry families | AICOM V2 cutover | Consumer port map | Testing workflow | Server ops | Web tools | Ecosystem repos | Arma 2 OA refs | A2 traps | OA compatibility audit | Coverage ledger | Navigation inventory | Pruning ledger | Knowledge roadmap | Agent context | Collab protocol | Worklog | Audit archive 2026-07 | Briefing reference | Utes invasion concept
- Shelved AICOM concepts - revivable someday ideas (owner-shelved 2026-07-03)
Docs rule: source-backed claims only; Arma 2 OA scripting docs only; gameplay edits start in Missions/[55-2hc]warfarev2_073v48co.chernarus.
- Getting started
- Status and coordination
- Agent context
- Agent collaboration protocol
- Agent worklog
- Agent worklog archive
- Progress dashboard
- PR cleanup and integration lab
- Shelved PR #169: gear price double-count
- Shelved PR #194: Chernarus no-trees
- Coordination board
- Codebase coverage ledger
- Bottleneck removal queue
- Current source status
- Wiki mirror reconciliation
- Navigation inventory
- Registers
- Agent orchestration
- Architecture
- Architecture overview
- Mission entrypoints and lifecycle
- Lifecycle wait chain
- Player join/disconnect and AntiStack lifecycle
- Mission parameters/localization/build inputs
- Stringtable localization key-family catalog
- Source inventory
- Content structure and maps
- Assets/config/localization/parameters
- Mission start parameters index
- Code and networking
- Gameplay systems
- Core systems index
- Gameplay systems atlas
- Commander/HQ lifecycle atlas
- Economy, towns and supply
- Economy system reference
- Balance asymmetries
- Anti-stack skill-balance mechanic
- Empty-side supply income stagnation
- Towns, camps and capture atlas
- Victory and endgame atlas
- Victory conditions reference
- Territorial victory reference
- Marker cleanup and restoration
- Marker loop engine and registries
- Map marker families content catalog
- Marker subsystem function reference
- Client marker FSM updater map
- Support specials and tactical modules
- SCUD TEL tactical munitions
- Naval HVT objectives (carriers/SCUD)
- SCUD saturation strike mechanic
- Takistan airfield FPV drone design
- Construction and CoIn systems
- Structure damage reduction & friendly-fire
- Construction logic list cleanup
- Flak tower & WDDM anchor compositions
- Resistance supply scaffold
- GUER Insurgents faction overview
- GUER Insurgents branch audit
- GUER insurgent player economy
- GUER air-defense loop (Ka-137/Mi-24)
- Upgrades and research atlas
- Supply mission architecture
- Supply mission authority cleanup
- Current supply helicopters PR1
- Respawn and death-loop lifecycle
- Vehicle theft economy pitch
- GUER tunnel network pitch
- Content, reference and catalogs
- Faction unit/vehicle roster catalog
- Auxiliary/SF/civilian unit catalog
- Gear store loadout route catalog
- Upgrade research (cross-faction)
- Gear store price and upgrade catalog
- Gear store catalog (complete, per faction)
- Defense structures catalog
- Artillery reference per faction
- AI squad team templates catalog
- Town AI lifecycle reference
- Town AI group composition catalog
- Class-skill system reference
- Player skill abilities reference
- Default gear template content catalog
- Chernarus map content reference
- Takistan map content reference
- Takistan features
- Takistan parity reference
- Takistan oilfields objective reference
- IRS IR-smoke countermeasure
- Arty module special munitions
- Zeta cargo sling-load reference
- Spawn primitive function reference
- Kill and score pipeline
- Waypoint helper function reference
- Position and proximity function reference
- Side/team state function reference
- Player AI watchdog and recovery
- AICOM stuck-recovery v2
- LoadoutManager data-model contributor guide
- Discord status bot setup and reference
- GLOBALGAMESTATS extension reference
- New player quickstart (player guide)
- Optional client mods (player guide)
- Earning funds and score (player guide)
- Vehicle service and logistics (player guide)
- Commander's handbook (player guide)
- Tactical support menu
- Paradrop player experience
- Supply missions (player guide)
- In-game briefing & Diary field manual
- Playable maps catalog
- Faction root variables reference
- Faction base structures catalog
- Counter-battery radar system
- Bank, Reserve and Artillery Radar structures
- Map ruleset model and object config
- Countermeasures module reference
- Vehicle countermeasure (flares/spoofing)
- UAV terminal and spotter system
- Artillery firing function reference
- Service Point pricing model
- Medic redeployment truck (forward spawn)
- Side-patrol runtime and convoy mechanics
- Day/night cycle and weather system
- Config lookup helper reference
- CIPHER sort utilities reference
- Modded maps status and content
- BattlEye filter setup and OA taxonomy
- Player squad/group join protocol
- AutoFlip vehicle recovery
- Engine stealth fuel toggle
- Valhalla vehicle climbing-assist
- Missile and ordnance Fired-EH reference
- Vehicle equip and rearm reference
- Array and collection utilities
- Server composition spawner reference
- Upgrade queue server loop
- Map boundaries and off-map enforcement
- Namespace/profile/diagnostic utilities
- Group bool getVariable A2-OA trap
- Vehicle weapon balance init
- View distance auto-throttle
- Camp & respawn-camp getters
- Performance audit writer
- Site clearance (bulldozer)
- Factory queue cancel & refund
- AI commander tunable constants
- Experimental feature-flag constants
- Flag system quick reference
- Mission tunable constants catalog
- Gear parsing & cargo capacity
- Structure dressing function
- Paradrop delivery functions
- ICBM nuke client VFX & radiation
- Server HandleSpecial router
- LocalizeMessage chat router
- Gear buy-menu render & price functions
- Server broadcast & telemetry loops
- Per-unit client init pipeline
- Vehicle marking & texture pipeline
- Defense category & budget
- Legacy AI order primitives
- Commander-team driver
- AICOM command verbs
- AICOM behavior fix taxonomy
- AI commander wildcard deck reference
- AICOM aircraft and airfield system
- Static-defense manning
- End-of-game stats screen
- AI commander execution loop
- Deployable bipod / weapon resting
- Town-economy getters
- Server-init deadspawn & airfield probe
- GUER VBIED detonate action
- Resource income-tick engine
- AI commander treasury accessors
- PVF send-helper contracts
- AICOM logging & AICOMSTAT telemetry
- AICOMSTAT v2 event census
- WASPSCALE v2 telemetry
- WASPSCALE v2-ext coverage audit
- Telemetry families reference
- Group lifecycle & entity reaping
- Batch AI spawner orchestrator
- Client funds/income HUD readout
- Server group GC & cap warning
- Town runtime tuning constants
- Client input/hotkey handler
- WASP base-repair system
- WASP DropRPG launcher/ordnance
- CoIn construction-interface client engine
- Town-capture garrison & airfield rebuild
- Map-control & minimap templates
- Client FPS & state telemetry
- Client service-proximity getters
- Airfield-exclusive roster & unit hints
- Unit-camera spectator system
- Town-garrison patrol/defense worker
- RequestTeamUpdate squad-discipline
- Arma2Warfare GPT assistant
- LoadoutManager build configs & defines
- GLOBALGAMESTATS extension logging
- Discord bot instrumented logging
- Eden/Everon & Taviana map content
- Cruise missile strike asset
- AI / HC
- AI headless and performance
- AI mods and pathfinding reference
- Headless client scaling and topology
- AI runtime/HC loop map
- Headless client init and stat loop
- HC delegation target selection
- Player AI caps and role balance
- Old WarfareBE FPS comparison
- AI commander autonomy audit
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- AI commander capture & fun plan
- AI commander B69 improvement roadmap
- AI commander B69 implementation sketches
- AICOM V2 cutover status
- Headless delegation and failover
- Commander reassignment call shape
- GUER Director living-resistance pitch
- Quality and operations
- Foundation perf findings & Tier-3 dead-ends
- Dead/stale code register
- Commander vote/reassignment
- Attack-wave authority
- Server runtime and operations
- Server ops runbook
- JIP enrollment & client data delivery (b74.2 lessons)
- Server gameplay runtime atlas
- PerformanceAuditAnalyzer
- Performance opportunity sweep
- Documentation plan
- Knowledge platform roadmap
- Wiki quality audit
- Wiki pruning and relevance ledger
- Audit findings queue (2026-06-03)
- Deep review findings
- Client UI / server-loop perf findings
- Performance gain simulation
- Self-host testing field notes
- Cleanup and work lanes
- Hardening and authority
- UI / player workflows
- Client UI, HUD and menus
- UI HUD and dialogs
- Player UI workflow map
- Client UI systems atlas
- UI IDD collision repair
- UI control class library reference
- UI theme palette and style macros
- UI design inspiration 2026-07
- Available-actions client gate FSM
- Gear/loadout/EASA atlas
- Gear template profile filter
- Vehicle cargo equip loop bounds
- Factory and purchase systems atlas
- Service menu affordability guards
- WASP overlay
- Class-skill system reference
- Skin selector and class swap
- Earplugs audio toggle
- Mission audio catalog
- HQ radio knowledge-base catalog
- QoL trio player hints
- Player vehicle/travel actions
- Tooling / release / integrations
- Tools and build workflow
- Warfare web tools
- Ecosystem & companion repos
- Zargabad tooling parity
- July 2026 release readiness
- Operator monitor and CPU affinity tools
- Tooling release readiness audit
- Source fix propagation queue
- Agent release readiness ledger
- Release source intake map
- Testing/debugging/release workflow
- Current RPT release gate
- RPT telemetry consumer port map
- External integrations
- Integration trust boundary audit
- AntiStack database extension audit
- Community & Dev
- Community & Dev
- Miksuu upstream wiki import / archive index
- Upstream changelog feature leads
- Developer history and upstream lessons
- Upstream Miksuu commit intel
- Upstream mining ledger
- Archive script mining v2
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- PR8 and Drone upstream lesson match
- Development lessons learned
- External research reports
- Audit archive 2026-07
- Briefing reference
- Utes invasion concept
- Miksuu archive: Home
- Miksuu archive: Welcome
- Miksuu archive: Big announcements
- Miksuu archive: Changelog
- Miksuu archive: Development process
- Miksuu archive: Discord bot
- Miksuu archive: Gameplay videos
- Miksuu archive: LoadoutManager
- Miksuu archive: Chernarus script architecture
- Base-game visual catalogs
- Compatibility and references
- HC upstream history and lessons
- Player stats branch audit
- BuyMenu EASA QoL branch audit
- Perf quick wins branch audit
- Commander positions branch audit
- Zargabad branch audit
- Quad AI Commander concept
- Arma 2 OA external reference guide
- Base-game config & image reference
- Arma 2 OA compatibility audit
- Arma 2 OA agent traps reference
- Arma 2 OA command versions
- Wiki source consistency
- External Arma 2 OA reference index