Template:BuildingsNavNext/doc: Difference between revisions

Template page
(Created page with "This navbox end goal is to mimick the game build UI. Dev notes: - Game orders category just by declaring them in order in data.categories - Order within a category seems to be done with some "id" of who registered first? Not implemented here. - (but if we need that, maybe it's enough to just add an ordering field with the same logic as the one for filter categories.) - In game code, BuildView.lua is where most of the stuff happens - Game filters entities by: - o...")
 
No edit summary
Line 3: Line 3:
Dev notes:   
Dev notes:   


- Game orders category just by declaring them in order in data.categories
* Game orders category just by declaring them in order in data.categories
- Order within a category seems to be done with some "id" of who registered first? Not implemented here.  
* Order within a category seems to be done with some "id" of who registered first? Not implemented here.  
  - (but if we need that, maybe it's enough to just add an ordering field with the same logic as the one for filter categories.)
** (but if we need that, maybe it's enough to just add an ordering field with the same logic as the one for filter categories.)
- In game code, BuildView.lua is where most of the stuff happens
* In game code, BuildView.lua is where most of the stuff happens
- Game filters entities by:
* Game filters entities by:
  - only stuff that is unlocked by faction
** only stuff that is unlocked by faction
  - `if not frame_def.construction_recipe then return end -- not a building` -> This one matches our `entity.recipeType != Construction` in the sub template BuildingsNavCat
** `if not frame_def.construction_recipe then return end -- not a building` -> This one matches our `entity.recipeType != Construction` in the sub template (BuildingsNavCat)
  - `if not bp_frame_def and not def.visual then return end -- no default visual` -> Extract code already skips this
** `if not bp_frame_def and not def.visual then return end -- no default visual` -> Extract code already skips this

Revision as of 06:30, 3 August 2025

This navbox end goal is to mimick the game build UI.

Dev notes:

  • Game orders category just by declaring them in order in data.categories
  • Order within a category seems to be done with some "id" of who registered first? Not implemented here.
    • (but if we need that, maybe it's enough to just add an ordering field with the same logic as the one for filter categories.)
  • In game code, BuildView.lua is where most of the stuff happens
  • Game filters entities by:
    • only stuff that is unlocked by faction
    • `if not frame_def.construction_recipe then return end -- not a building` -> This one matches our `entity.recipeType != Construction` in the sub template (BuildingsNavCat)
    • `if not bp_frame_def and not def.visual then return end -- no default visual` -> Extract code already skips this