Contributing to ScheduleLua
Thank you for your interest in contributing to ScheduleLua! This guide will help you understand how to contribute to the project effectively.
Ways to Contribute
There are several ways you can contribute to ScheduleLua:
- Code contributions: Implement new features or fix bugs
- Documentation: Improve existing documentation or add new guides
- Examples: Create example scripts that demonstrate API usage
- Bug reports: Report issues you encounter
- Feature requests: Suggest new features or improvements
- Community support: Help other users in discussions and forums
Setting Up Development Environment
Prerequisites
- Visual Studio
- MelonLoader
- MoonSharp Interpreter (.NET 3.5) - Download the latest release and extract the .NET 3.5 DLL from
interpreter/net35/MoonSharp.Interpreter.dll
- Basic knowledge of C# and Lua
Getting the Source
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/ScheduleLua-Framework.git
- Add the upstream repository as a remote:
git remote add upstream https://github.com/ScheduleLua/ScheduleLua-Framework.git
Building the Project
- Open the solution file (
ScheduleLua.sln
) in Visual Studio - Add the MoonSharp .NET 3.5 DLL as an assembly reference to the project
- Right-click on "References" in Solution Explorer
- Select "Add Reference..."
- Click "Browse" and locate the MoonSharp DLL you downloaded
- Click "Add" and then "OK"
- Build the solution
- The compiled DLL will be copied to your Schedule 1 mods folder, and Visual Studio will start your Schedule 1 game
Contribution Workflow
Fork the repository: Create your own fork of the ScheduleLua repository on GitHub
- Click the "Fork" button at the top right of the ScheduleLua repository
Clone your fork: Download your fork to your local machine
git clone https://github.com/YOUR-USERNAME/ScheduleLua-Framework.git cd ScheduleLua
Make your changes: Implement your feature or fix the bug
Follow coding standards:
- Use consistent indentation (4 spaces)
- Follow C# naming conventions
- Include XML documentation comments for public APIs
- Add appropriate exception handling
Test your changes: Ensure your changes work as expected in the game
Commit your changes: Use clear commit messages that explain what and why
git commit -m "Added feature: description of what was added"
Push to your fork: Upload your changes to your GitHub fork
git push origin main
Create a Pull Request: Go to the original ScheduleLua repository and click "New Pull Request"
- Select "compare across forks"
- Select your fork and branch as the source
- The main ScheduleLua repository and branch as the destination
- Fill out the PR template with a clear description of your changes
Respond to feedback: Be prepared to make additional changes based on the code review
Keeping Your Fork Updated
Regularly sync your fork with the upstream repository:
git remote add upstream https://github.com/ScheduleLua/ScheduleLua-Framework.git
git fetch upstream
git checkout main
git merge upstream/main
git push origin main
For Documentation Changes
The ScheduleLua documentation uses VitePress, a static site generator optimized for documentation sites. When contributing to documentation:
Focus on Markdown Files: All documentation is in Markdown files in the
docs/
directory- Each
.md
file becomes a page in the documentation site - File names become part of the URL structure
- Each
Follow VitePress Conventions:
- Use standard Markdown for most content
- Organize content with proper headings (starting with
##
for main sections) - Use relative links to reference other documentation pages
Use VitePress-specific Features:
- Use
:::tip
,:::warning
, and:::danger
containers for callouts - Use code blocks with syntax highlighting by specifying the language: ```lua
- Use
Preview Your Changes:
- Install dependencies:
npm install
- Start local dev server:
npm run docs:dev
- Your changes will be visible at
http://localhost:5173/
- Install dependencies:
Keep Documentation Consistent:
- Follow existing documentation style and tone
- Use the same formatting patterns as other pages
- Keep explanations clear and concise with examples
Submit Documentation PRs the same way as code PRs:
- Push changes to your fork
- Create a Pull Request to the main repository
Pull Request Guidelines
When submitting a PR, please:
- Describe your changes: Explain what your PR does and why it should be included
- Link related issues: Reference any related issues with "Fixes #12" or "Relates to #3"
- Keep it focused: Each PR should address a single concern, don't make PR to refactor the entire framework, it will be closed
- Be responsive: Respond to review comments and make requested changes
- Be patient: PRs are reviewed as time permits
Documentation Guidelines
When writing documentation:
- Use clear, concise language
- Include code examples where appropriate
- Structure content with proper headings
- Link to related documentation when relevant
- Follow the existing documentation format
Creating Example Scripts
Example scripts are valuable for demonstrating how to use ScheduleLua. When creating examples:
- Place scripts in the
ScheduleLua/Resources
directory of theScheduleLua
GitHub Repository - Include detailed comments explaining what the code does
- Focus on demonstrating specific features or patterns
- Ensure examples are complete and functional
- Follow best practices for Lua 5.2 scripting
Bug Reports
When reporting bugs:
- Check if the bug has already been reported
- Use the issue template if available
- Include detailed steps to reproduce the issue
- Provide information about your environment (OS, game version, etc.)
- Include any error messages or logs
- Attach screenshots or videos if they help illustrate the issue
Feature Requests
When requesting features:
- Check if the feature has already been requested
- Use the feature request template if available
- Clearly describe the feature and its use case
- Explain why it would be valuable to the project
- Provide examples of how the feature might work
Community Guidelines
When participating in the ScheduleLua community:
- Be respectful and inclusive
- Help newcomers with patience and understanding
- Give constructive feedback
- Stay on topic in discussions
- Follow the project's code of conduct
License
By contributing to ScheduleLua, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to ScheduleLua and helping make it better for everyone!