Conversation
- Implement `calculatePopulation` in `Settlement.ts` to only count working units (JobType or FIELD_WORK).
- Add detailed documentation to `Settlement.ts` explaining unit visibility and population rules.
- Update `TraversalUtils.findAllUnitsAt` to filter out working units from tile selection.
- Refine `UnitPanel.tsx` with auto-selection logic:
- Auto-select unit if it's the only option on a non-settlement tile.
- Auto-enter settlement if it's the only option on the tile.
- Show `UnitSelector` only when multiple options (units or settlement) exist.
- Add defensive checks in `WorldScene.ts` to prevent crashes in headless environments.
Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Implement `calculatePopulation` in `Settlement.ts` to only count working units (JobType or FIELD_WORK).
- Add detailed documentation to `Settlement.ts` explaining unit visibility and population rules.
- Update `TraversalUtils.findAllUnitsAt` to filter out working units from tile selection.
- Refine `UnitPanel.tsx` with auto-selection logic:
- Auto-select unit if it's the only option on a non-settlement tile.
- Auto-enter settlement if it's the only option on the tile.
- Show `UnitSelector` only when multiple options (units or settlement) exist.
- Add defensive checks in `WorldScene.ts` to prevent crashes in headless environments.
- Fix linting errors in `Settlement.ts`, `TraversalUtils.ts`, and `WorldScene.ts`.
Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
- Implement `calculatePopulation` in `Settlement.ts` to only count working units (JobType or FIELD_WORK). - Handle available units (RURE) as being "outside" and not counting toward population. - Update `TraversalUtils.findAllUnitsAt` to hide working units from tile selection. - Refine `UnitPanel.tsx` with auto-selection logic for single unit or settlement. - Add "Enter Settlement" label and icons to `UnitSelector`. - Add stability fixes in `WorldScene.ts` and documentation in `Settlement.ts`. - Resolve CI failures by fixing linting errors and handling undefined occupations in tests. Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
- Move auto-selection/entry logic from UnitPanel.tsx to selectionSlice.ts. - Add skipAutoSelection option to selectTile to prevent immediate re-entry when exiting settlements. - Fix MainMenuScene.ts crash by adding defensive checks and proper event listener cleanup on shutdown. - Resolve linting errors in selectionSlice.ts and MainMenuScene.ts. Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
- Move auto-selection/entry logic from UnitPanel.tsx to selectionSlice.ts. - Add skipAutoSelection option to selectTile to prevent immediate re-entry when exiting settlements. - Fix MainMenuScene.ts crash by adding defensive checks and proper event listener cleanup on shutdown. - Resolve linting errors and remove temporary test files. Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
- Implement `calculatePopulation` in `Settlement.ts` to only count working units (JobType or FIELD_WORK). - Hide working units from the world map's tile selection panel via `TraversalUtils`. - Move auto-selection/entry logic to `selectionSlice.ts` to improve UX and avoid ambiguity. - Add `skipAutoSelection` option to `selectTile` to prevent re-entry loops when exiting settlements. - Fix `MainMenuScene.ts` crash by properly cleaning up event listeners. - Resolve build and linting errors. - Add documentation to `Settlement.ts` explaining the new rules. Co-authored-by: b0x1 <21123655+b0x1@users.noreply.github.com>
This PR updates the logic for how units and population are handled in settlements.
Key changes:
UnitSelectorpanel only appears if there is more than one selectable option (e.g., a settlement and a unit, or multiple units).Settlemententity describing these rules.PR created automatically by Jules for task 15065278462599339849 started by @b0x1