A browser extension to integrate sc4pac to SimCity 4 file exchanges.
This browser extension adds buttons to a SimCity 4 plugin page that trigger actions on sc4pac.
The mapping between exchange packages and sc4pac packages is sourced from sebamarynissen/sc4pac-helpers repository. The extension uses these lists to map exchange files to their corresponding sc4pac package ID:
- One-click installation buttons on supported SimCity 4 exchange sites
- Direct integration with sc4pac package manager
- Settings configuration for sc4pac server connection (hostname and port)
- Simtropolis
- SC4Evermore
Each exchange provides:
- Direct download integration
- One-click installation through sc4pac
- Package dependency management
- Download the latest release from the releases page
- Install the extension in your browser
- Ensure sc4pac is installed on your system and its API server is running
- Configure the server hostname and port in the extension settings
- Add channels in the extension settings as required
Visit a supported file exchange page to see the sc4pac integration buttons:
- View Package: Opens the package in sc4pac
- Add Package: Installs the package using sc4pac
- sc4pac installed and working
- Modern web browser (Chrome, Firefox, Edge)
The extension requires the following settings to connect to your sc4pac server:
- Server hostnname: The hostname where sc4pac API server is running (default: localhost)
- Port: The port number which sc4pac API server is running (default: 51515)
You can configure these settings through the extension's options page in your browser:
- Click the extension icon in your browser
- Select "Options" or "Settings"
- Enter your sc4pac server hostname and port
- Click Save
This ensures the extension can communicate with your local sc4pac installation.
- Support multiple sc4pac packages per exchange file
- Update package mapping structure
- Update UI to show all available packages
- Add support for more SimCity 4 exchanges
- Swap add/remove buttons.
- Use configuration from profiles.
- Add server API version support.
- Use file IDs from channels instead of from sebarynissen/sc4pac-helpers (see sebamarynissen/sc4pac-helpers#4 (comment)).
- Add caching of fetched contents.
- Implement scanning of comments and files description for package with detection from
- Package ID pattern (group:name)
- File URL
- Add inline buttons next to matched references
- Implementation steps:
- Create regex pattern matcher for package ID
- Scan text content for matches
- For each match:
- Verify existence in sc4pac package list
- Create inline button group using
buttonHelper.createButtonGroup()
- Position buttons next to matched text
- Update button URLs using
buttonHelper.updateButtonHref()
Technical considerations:
- Reuse existing button creation logic from
buttonHelper.js
- Maintain consistent button styling and behavior
- Handle multiple matches in same description
- Consider performance impact of regex scanning
Contributions are welcome! Feel free to submit issues and pull requests.