Implement CounterStrikeSharp port of MapDecals plugin from SwiftlyS2#1
Merged
Implement CounterStrikeSharp port of MapDecals plugin from SwiftlyS2#1
Conversation
Co-authored-by: erikpeik <52178013+erikpeik@users.noreply.github.com>
Co-authored-by: erikpeik <52178013+erikpeik@users.noreply.github.com>
Co-authored-by: erikpeik <52178013+erikpeik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create CounterStrikeSharp port of MapDecals plugin
Implement CounterStrikeSharp port of MapDecals plugin from SwiftlyS2
Jan 13, 2026
Member
|
@copilot Can you add github action which would make release and build version |
Co-authored-by: erikpeik <52178013+erikpeik@users.noreply.github.com>
Contributor
Author
Added GitHub Actions workflows for automated builds and releases (commit f09fe1d): CI Build (
Build and Release (
To create a release, simply: git tag v1.0.0
git push origin v1.0.0See RELEASE.md for full documentation on using the workflows and creating releases. |
erikpeik
approved these changes
Jan 13, 2026
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.
Complete port of the MapDecals plugin from SwiftlyS2 to CounterStrikeSharp (CS#), enabling CS2 server owners to place and manage persistent decals on maps through an interactive menu system with database persistence.
Core Implementation
Project Structure
Plugin System
IPluginConfig<T>with JSON serializationAddCommand()API with permission validationEventRoundStart,EventPlayerConnectFull,EventPlayerPingMenuManager.OpenChatMenu()Decal Management
Database Schema
API Adaptations
SwiftlyS2 → CounterStrikeSharp Mappings
BasePlugin→CounterStrikeSharp.API.Core.BasePluginAddCommand()+[CommandHelper]attributesCore.EntitySystem.CreateEntityByDesignerName→Utilities.CreateEntityByName<T>()MenuManagerAPICI/CD and Releases
GitHub Actions Workflows
.github/workflows/ci.yml): Automated builds on all pushes and pull requests in both Debug and Release configurations.github/workflows/build-release.yml): Automated release creation when version tags are pushedCreating Releases
Simply push a version tag to trigger automated release:
See
RELEASE.mdfor detailed documentation on the CI/CD system, release creation, and version management.Known Limitations
CS# entity API does not expose
CEnvDecalproperties (material, width, height, depth). Entity creation simplified to use only available base properties. Values stored in database for future API support.Security
AdminManager.PlayerHasPermissions()Original prompt
Create a complete CounterStrikeSharp (CS#) port of the MapDecals plugin originally built for SwiftlyS2.
Plugin Overview
MapDecals allows CS2 server owners to place decals on maps at predefined locations. Players with admin permissions can place decals using ping locations, edit their properties (width, height, depth, position), and toggle visibility.
Core Features to Implement
1. Plugin Structure
BasePlugin2. Configuration System
Create a JSON-based config with:
UniqId(string): Unique identifier for the decalName(string): Display nameMaterial(string): Material path (e.g., "materials/Example/exampleTexture.vmat")ShowPermission(string): Optional permission required to see the decalPlaceDecalCommands: Command and aliases for placing decals (default: "mapdecal", permission: "cc-mapdecals.admin")AdToggleCommands: Command and aliases for toggling decal visibility (default: "decal", permission: "cc-mapdecals.vip")3. Database Schema
Table:
cc_mapdecalsid(BIGINT, PRIMARY KEY, AUTO_INCREMENT)map(VARCHAR 64, NOT NULL, INDEXED)decal_id(VARCHAR 64, NOT NULL) - references config UniqIddecal_name(VARCHAR 64, NOT NULL)position(VARCHAR 64, NOT NULL) - stored as "X Y Z"angles(VARCHAR 64, NOT NULL) - stored as "X Y Z"depth(INT, NOT NULL, DEFAULT 12)width(FLOAT, NOT NULL, DEFAULT 128)height(FLOAT, NOT NULL, DEFAULT 128)force_on_vip(BOOLEAN, NOT NULL, DEFAULT FALSE)is_active(BOOLEAN, NOT NULL, DEFAULT TRUE)4. Commands
Implement two commands:
Place Decal Command (default:
!mapdecal)Toggle Decal Command (default:
!decal)5. Decal Placement System
6. Decal Entity Management
Create
env_decalentities with:7. Menu System
Implement menus using a CS# menu library (e.g., WASDMenu or ChatMenu):
Main Menu (opened by place decal command):
Place Decal Menu:
Edit Decals Menu:
Edit Decal Menu (for specific decal):
8. Event Handlers
9. Player Preferences System
10. Transmit Control
Technical Requirements
Dependencies
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.