Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

### Bug Fixes

- The name tag part module is now provided by the shared [KSPCommunityPartModules](https://github.com/KSPModdingLibs/KSPCommunityPartModules) mod, a new **required dependency**, instead of kOS shipping its own copy. kOS and kRPC previously each defined a `KOSNameTag` module, which KSP resolved by load order and could pick the wrong one (#829). Name tags on existing craft and saves are migrated automatically, so `part:TAG` keeps working.
- Fixed numeric formatting patters (thanks @sisve) [commit](https://github.com/KSP-KOS/KOS/commit/5780b75ff90e238c441ab71d366391b051e8bd14)
- Fixed many documentation issues (thanks @sisve) [commit1](https://github.com/KSP-KOS/KOS/commit/727d345679fe992077fa5604c27b43c34a80fbe7) [commit2](https://github.com/KSP-KOS/KOS/commit/afabb19e860adc67ad63f939a3d624e9344ad7b8) [commit3](https://github.com/KSP-KOS/KOS/commit/110b209ad89225bf447caa079334c434df0e9746)
- Fixed `GetSignalDelayToSatellite` for RemoteTech (thanks @KerbalOne) [commit](https://github.com/KSP-KOS/KOS/commit/b76759f24ba43e7cb2d82437c2251caf7d3a582f)
Expand Down
23 changes: 13 additions & 10 deletions Resources/GameData/kOS/kOS-module-manager.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
//
// ADD the KOSNameTag to all parts in the game.
// ADD the name tag module to all parts in the game.
//
// The ModuleNameTag part module is provided by KSPCommunityPartModules (a
// dependency of kOS); kOS just patches it onto every part.
//
// THE FOLLOWING EXPLANATION IS FOR ISSUE #2764
//
// The "[!KOSNameTag]" rule below attempted to prevent duplicates
// The "[!ModuleNameTag]" rule below attempted to prevent duplicates
// in a part, but it doesn't entirely succeed at that in the
// case of KerbalEVA parts if the installation has all the DLCs,
// due to a wacky messy way SQUAD implemented the alternate
Expand All @@ -15,17 +18,17 @@
// cause because they were two *different* parts when it was looking
// at them.
//
// Therefore there is extra code inside kOS's C# code to additionally
// enforce the "no more than one KOSNameTag" rule, in its OnAwake().
// You *cannot* force more than one KOSNameTag to exist in a part
// no matter what you do in ModuleManager now, because KOSNameTag
// Therefore there is extra code inside ModuleNameTag's C# code to additionally
// enforce the "no more than one name tag" rule, in its OnAwake().
// You *cannot* force more than one ModuleNameTag to exist in a part
// no matter what you do in ModuleManager now, because ModuleNameTag
// itself refuses to allow it.
//
@PART[*]:FOR[kOS]:HAS[!KOSNameTag]
@PART[*]:FOR[kOS]:HAS[!ModuleNameTag]
{
MODULE
{
name = KOSNameTag
name = ModuleNameTag
}
}

Expand All @@ -35,13 +38,13 @@
// going with it, it's saved here for reference to look at later should
// we change our mind and want to go to this instead:
//
// (In a nutshell, this removes the extra KOSNameTag PartModules from
// (In a nutshell, this removes the extra ModuleNameTag PartModules from
// those specfic part definitions in the known specific DLC folders
// that trigger this exact problem, rather than creating a generic
// solution that says "there can be only one, ever"):
//
// @PART[kerbalEV*]:HAS[~name[*Future],@MODULE[ModuleScienceExperiment]:HAS[#experimentID[ROCScience]]]:AFTER[kOS]
// {
// !MODULE[KOSNameTag]{}
// !MODULE[ModuleNameTag]{}
// }
//
119 changes: 0 additions & 119 deletions src/kOS/Module/KOSNameTag.cs

This file was deleted.

7 changes: 4 additions & 3 deletions src/kOS/Module/kOSProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using kOS.Binding;
using KSPCommunityPartModules.Modules;
using kOS.Callback;
using kOS.Execution;
using kOS.Communication;
Expand Down Expand Up @@ -46,13 +47,13 @@ public string Tag
{
get
{
KOSNameTag tag = part.Modules.OfType<KOSNameTag>().FirstOrDefault();
ModuleNameTag tag = part.Modules.OfType<ModuleNameTag>().FirstOrDefault();
return tag == null ? string.Empty : tag.nameTag;
}
set
{
KOSNameTag tag = part.Modules.OfType<KOSNameTag>().FirstOrDefault();
// Really a null tag shouldn't ever happen. It would mean kOS is installed but KOSNameTag's aren't on all the things.
ModuleNameTag tag = part.Modules.OfType<ModuleNameTag>().FirstOrDefault();
// Really a null tag shouldn't ever happen. It would mean kOS is installed but ModuleNameTag's aren't on all the things.
// And that should only happen if someone has a bad ModuleManager config that's screwing with kOS.
if (tag != null)
tag.nameTag = value;
Expand Down
6 changes: 5 additions & 1 deletion src/kOS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("324da3fe-391b-421d-93b7-29499dcf9ef3")]

[assembly: KSPAssemblyDependency("kOS.Safe", 0, 0)]
[assembly: KSPAssemblyDependency("kOS.Safe", 0, 0)]

// The name-tag part module lives in KSPCommunityPartModules, so KSP must load that mod before kOS.
// This is a hard dependency: KSP refuses to load kOS unless it is present.
[assembly: KSPAssemblyDependency("KSPCommunityPartModules", 0, 5)]
Loading