Conversation
Co-authored-by: Copilot <copilot@github.com>
- Implemented the goods editor interface for managing resources. - Added functionality to edit resource properties including name, category, value, chance, model, and bonuses. - Introduced event listeners for user interactions such as adding, removing, and modifying goods. - Enabled the ability to toggle between absolute and percentage modes for resource visibility. - Implemented icon selection and color change features for goods. - Added functionality to regenerate and restore default goods. - Included CSV export functionality for goods data. - Enhanced user experience with confirmation dialogs and tooltips for actions. Co-authored-by: Copilot <copilot@github.com>
- Added ProductionModule to handle goods collection based on biome and river production. - Introduced goods editor UI for managing resource properties, including name, category, value, and bonuses. - Implemented functionality to add, remove, and modify goods, including visual representation on the map. - Added support for toggling goods visibility and editing styles with Ctrl+click. - Enhanced goods rendering logic to account for pinned resources and display options. Co-authored-by: Copilot <copilot@github.com>
- Removed goods rendering functions from `goods-renderer.ts` and moved them to a new file `draw-goods.ts`. - Updated global declarations to reflect the new location of `toggleGoods` and `drawGoods` functions. - Created a new `goods-editor.ts` file to handle the goods editing functionality, including UI interactions and data management. - Adjusted the global type definitions in `global.ts` to remove unused function declarations. - Ensured that the new structure maintains existing functionality while improving code organization and readability. Co-authored-by: Copilot <copilot@github.com>
…and enhance goods editor functionality Co-authored-by: Copilot <copilot@github.com>
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a “Trade Goods” system into the map generator by adding goods generation, a dedicated render layer, a UI editor, persistence in .map files, and a first pass at burg-level production derived from nearby goods/biomes.
Changes:
- Add
GoodsandProductionmodules, store goods on cells (pack.cells.good) and inpack.goods, and persist/load them in.mapfiles. - Add a new SVG
#goodslayer with rendering (drawGoods) + UI toggles/hotkeys + style-preset support. - Add a “Trade Goods Editor” controller for editing goods metadata, icons, and manual cell assignment.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/global.ts | Adds global typings for Goods, Production, goods layer, and legacy UI globals used by the new modules/UI. |
| src/types/PackedGraph.ts | Extends packed graph schema with cells.good and pack.goods. |
| src/renderers/draw-goods.ts | Implements goods layer toggle + rendering into the new #goods SVG group. |
| src/modules/production-generator.ts | Adds production calculation (burg.produced) based on nearby goods/biomes and burg population. |
| src/modules/markers-generator.ts | Formatting-only refactors (imports/arrow functions/object formatting). |
| src/modules/index.ts | Registers new modules and editor/renderer entrypoints. |
| src/modules/goods-generator.ts | Implements default goods catalog + spread models + cell assignment generation. |
| src/modules/burgs-generator.ts | Extends Burg type with produced and includes formatting refactors. |
| src/controllers/goods-editor.ts | Adds a full editor UI for goods (list, models, bonuses, icon upload, manual assignment). |
| src/controllers/coastline-editor.ts | Formatting-only refactors. |
| public/versioning.js | Bumps app version to 1.122.0. |
| public/styles/*.json | Adds default styling for the new #goods layer across presets. |
| public/modules/ui/tools.js | Hooks the goods editor and goods regeneration into UI tool actions. |
| public/modules/ui/style.js | Adds goods-specific style controls (data-circle, stroke width) to the style editor. |
| public/modules/ui/style-presets.js | Includes #goods properties in style preset serialization. |
| public/modules/ui/layers.js | Ensures goods are drawn in layer redraws and maps toggleGoods to #goods. |
| public/modules/ui/hotkeys.js | Adds hotkeys for opening the editor and toggling the goods layer. |
| public/modules/ui/general.js | Adds tooltip + cell info display for goods. |
| public/modules/ui/editors.js | Opens the goods editor when interacting with the goods layer. |
| public/modules/ui/burg-editor.js | Displays computed production (burg.produced) in the burg editor UI. |
| public/modules/io/save.js | Appends goods arrays to .map save format. |
| public/modules/io/load.js | Loads goods arrays from .map files into pack. |
| public/modules/dynamic/auto-update.js | Adds migration logic for maps older than 1.122.0 to initialize goods. |
| public/main.js | Adds #goods layer creation, goods generation during map generation, and goods bonus in rankCells. |
| public/index.css | Adds cursor + editor styling for goods UI elements. |
- Updated goods structure to replace 'category' with 'type' and added 'tags' for better classification. - Introduced a normalization function for tags in the GoodsModule to handle legacy categories. - Adjusted production calculations to utilize the new 'tags' structure instead of 'category'. - Refactored utility functions to use a new TYPED_ARRAY_MAX structure for better clarity and maintainability. - Enhanced the goods editor UI in index.html to reflect the new tags and sorting options. - Cleaned up code formatting and improved readability across multiple files. Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
- Introduced getHeight function to convert height values from generator scale to real-world height with units. - Updated unitUtils to include height conversion logic based on selected unit (meters, feet, fathoms). - Exposed getHeight function to the global window object for accessibility. - Cleaned up the convertTemperature function formatting for consistency. Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…nd functionality Co-authored-by: Copilot <copilot@github.com>
…sibility Co-authored-by: Copilot <copilot@github.com>
…duction and new goods - Added biome production capabilities to goods, allowing for specific production rates based on biome types. - Introduced new goods such as "Vinegar", "Preserved food", and "Candles" with associated recipes and attributes. - Updated existing goods to include biome production values and adjusted their properties (e.g., value, chance). - Refactored production generation logic to utilize new biome production data and improved recipe handling for manufactured goods. - Enhanced culture modifiers for goods production based on cultural types. Co-authored-by: Copilot <copilot@github.com>
…nd recipe yield calculation
…nd enhance good editing dialog with refresh capability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description