-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded project to SpaceWarp 0.4 and added configuration
- Loading branch information
Showing
11 changed files
with
105 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
# Community Fixes for KSP 2 | ||
This project aims to bring together community bug fixes for Kerbal Space Program 2 in one centralized place. | ||
|
||
## Current fixes | ||
## Compatibility | ||
- Tested with Kerbal Space Program 2 v0.1.0.0.20892 | ||
- Requires **[SpaceWarp 0.4+](https://github.com/SpaceWarpDev/SpaceWarp/releases/tag/spacewarp-0.4.0)** | ||
|
||
## Implemented fixes | ||
- **Separation CommNet Fix** by [munix](https://github.com/jan-bures) - Fixes CommNet disconnecting after separating two controllable vessels. | ||
- **Sticky Orbit Markers** by [munix](https://github.com/jan-bures) - Makes Ap/Pe and other orbit markers stay pinned when plotting a maneuver. | ||
|
||
## Planned fixes | ||
To see what fixes are planned to be implemented, you can visit the [Issues page](https://github.com/Bit-Studios/CommunityFixes/issues) on the project's GitHub. | ||
|
||
## Development wiki | ||
If you'd like to contribute to this project, please take a look at [our wiki](https://github.com/Bit-Studios/CommunityFixes/wiki/Adding-your-fix). |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using BepInEx.Configuration; | ||
|
||
namespace CommunityFixes; | ||
|
||
public class CommunityFixesConfig | ||
{ | ||
private const string TogglesSection = "Toggle fixes"; | ||
|
||
private Dictionary<Type, ConfigEntry<bool>> _fixesEnabled = new(); | ||
private ConfigFile _configFile; | ||
|
||
public CommunityFixesConfig(ConfigFile configFileFile) | ||
{ | ||
_configFile = configFileFile; | ||
} | ||
|
||
|
||
public bool LoadConfig(Type type, string name) | ||
{ | ||
// If the toggle value for a fix class is already defined, we return it | ||
if (_fixesEnabled.TryGetValue(type, out var isEnabled)) | ||
{ | ||
return isEnabled.Value; | ||
} | ||
|
||
// Otherwise create a new config entry for the fix class and return its default value (true) | ||
var configEntry = _configFile.Bind(TogglesSection, type.Name, true, name); | ||
_fixesEnabled.Add(type, configEntry); | ||
return configEntry.Value; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace CommunityFixes.Fix; | ||
|
||
[AttributeUsage(AttributeTargets.Class)] | ||
public class FixAttribute: Attribute | ||
{ | ||
public string Name { get; } | ||
|
||
public FixAttribute(string name) | ||
{ | ||
Name = name; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
|
||
public interface IFix | ||
{ | ||
public string Name { get; } | ||
public void OnInitialized(); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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