From 7e37c39100692fd1b2a0e70fff9f99cde4d802a4 Mon Sep 17 00:00:00 2001 From: ihsoft Date: Sun, 28 Oct 2018 22:24:53 -0700 Subject: [PATCH 1/6] Start 1.16 pre-release --- CHANGELOG.md | 2 ++ Source/Properties/AssemblyInfo.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a79f335c..e3b2927c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +# 1.16 (pre-release): + # 1.15 (October 27th, 2018): * [Change] KSP 1.5.* compatibility. * [Fix #268] Wrong size detection on the MH expansion parts. READ #273!!! diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 6f997ace..4edc2115 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("1.15.*")] -[assembly: AssemblyInformationalVersion ("1.15 for KSP 1.5+")] -[assembly: KSPAssembly ("KIS", 1, 15)] +[assembly: AssemblyVersion ("1.16.*")] +[assembly: AssemblyInformationalVersion ("1.16-pre for KSP 1.5+")] +[assembly: KSPAssembly ("KIS", 1, 16)] From 5efe075c2c0b5155b3649df5d6d35fc9af7315b5 Mon Sep 17 00:00:00 2001 From: ihsoft Date: Sun, 28 Oct 2018 22:25:31 -0700 Subject: [PATCH 2/6] Fix #275 Skip actiev state checking fro the prefub models. --- CHANGELOG.md | 1 + Source/KISAddonPointer.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3b2927c..6828ee3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # 1.16 (pre-release): +* [Fix #275] No preview meshes shown. # 1.15 (October 27th, 2018): * [Change] KSP 1.5.* compatibility. diff --git a/Source/KISAddonPointer.cs b/Source/KISAddonPointer.cs index 75bb7de6..5652afa6 100644 --- a/Source/KISAddonPointer.cs +++ b/Source/KISAddonPointer.cs @@ -795,7 +795,8 @@ static void CollectMeshesFromAssembly(Part assembly, // Get all meshes from the part's model. var meshFilters = assembly .FindModelComponents() - .Where(mf => mf.gameObject.activeInHierarchy) + // Prefab models are always inactive, so ignore the check. + .Where(mf => mf.gameObject.activeInHierarchy || assembly == assembly.partInfo.partPrefab) .ToList(); DebugEx.Fine("Found {0} children meshes in: {1}", meshFilters.Count, assembly); meshFilters.ForEach(meshFilter => { From 0792b5083c2f5c5bd5e0b88f0e1162650bcb5029 Mon Sep 17 00:00:00 2001 From: ihsoft Date: Sun, 28 Oct 2018 22:25:42 -0700 Subject: [PATCH 3/6] Drop unused code --- Source/KIS_Item.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/KIS_Item.cs b/Source/KIS_Item.cs index fcc31f83..3900e5e6 100644 --- a/Source/KIS_Item.cs +++ b/Source/KIS_Item.cs @@ -486,7 +486,6 @@ public void Equip(ActorType actorType = ActorType.API) { evaTransform = KISAddonConfig.FindEquipBone(inventory.part.transform, prefabModule.equipBoneName); if (evaTransform == null) { - UnityEngine.Object.Destroy(equippedGameObj); return; // Cannot equip! } if (equipMode == EquipMode.Model) { From d8bd593e0878203fcce879132a9f37a4bd909c8a Mon Sep 17 00:00:00 2001 From: ihsoft Date: Mon, 29 Oct 2018 21:44:43 -0700 Subject: [PATCH 4/6] Upgrade to ReleaseTools v1.1 --- Tools/KspReleaseBuilder.py | 2 +- Tools/PublishCurseForge.py | 30 +++++++++---------------- Tools/PublishGitHub.py | 30 +++++++------------------ Tools/PublishSpacedock.py | 32 ++++++++++---------------- Tools/publish_curseforge_args.txt | 1 + Tools/publish_spacedock_args.txt | 1 + Tools/utils/ChangelogUtils.py | 37 +++++++++++++++++++++++++++++++ 7 files changed, 71 insertions(+), 62 deletions(-) create mode 100644 Tools/utils/ChangelogUtils.py diff --git a/Tools/KspReleaseBuilder.py b/Tools/KspReleaseBuilder.py index eddbcf64..c3deea8b 100644 --- a/Tools/KspReleaseBuilder.py +++ b/Tools/KspReleaseBuilder.py @@ -1,6 +1,6 @@ # Public domain license. # Author: igor.zavoychinskiy@gmail.com -# GitHub: https://github.com/ihsoft/KSPDev/tree/master/Sources/ReleaseBuilder +# GitHub: https://github.com/ihsoft/KSPDev_ReleaseBuilder SCRIPT_VERSION = "2.1" # (check if SUPPORTED_JSON_SCHEMA_VERSION needs to be updated!) # A very simple class to produce a .ZIP archive with a KSP mod distribution. diff --git a/Tools/PublishCurseForge.py b/Tools/PublishCurseForge.py index 3f538a74..b4dc3fe9 100644 --- a/Tools/PublishCurseForge.py +++ b/Tools/PublishCurseForge.py @@ -1,8 +1,8 @@ # Public domain license. # Author: igor.zavoychinskiy@gmail.com # GitHub: https://github.com/ihsoft/KSPDev_ReleaseBuilder -# $version: 2 -# $date: 10/16/2018 +# $version: 4 +# $date: 10/28/2018 """ Script to publish releases to Kerbal CurseForge. @@ -72,6 +72,7 @@ import textwrap from clients import CurseForgeClient +from utils import ChangelogUtils LOGGER = logging.getLogger() @@ -138,6 +139,10 @@ def main(argv): default='.+?_(v.+?)\\.zip', help='''the RegExp to extract the version tag from the archive name. [Default: %(default)s]''') + parser.add_argument( + '--github', action='store', metavar='', + help='''the GitHub project and user, separated by "/" symbol. Used when + expanding the GitHub links. Example: "ihsoft/KIS"''') opts = vars(parser.parse_args(argv[1:])) project_id = opts['project'] @@ -166,7 +171,10 @@ def main(argv): print 'ERROR: No versions found for RegExp: %s' % versions_re exit(-1) - desc = _ExtractDescription(opts['changelog'], opts['changelog_breaker']) + desc = ChangelogUtils.ExtractDescription( + opts['changelog'], opts['changelog_breaker']) + if opts['github']: + desc = ChangelogUtils.ProcessGitHubLinks(desc, opts['github']) filename = opts['archive'] if opts['title']: @@ -219,20 +227,4 @@ def _Shutdown(): logging.shutdown() -def _ExtractDescription(changelog_file, breaker_re): - """Helper method to extract the meaningful part of the release changelog.""" - with open(changelog_file, 'r') as f: - lines= f.readlines() - changelog = '' - for line in lines: - # Ignore any trailing empty lines. - if not changelog and not line.strip(): - continue - # Stop at the breaker. - if re.match(breaker_re, line.strip()): - break - changelog += line - return changelog.strip() - - main(sys.argv) diff --git a/Tools/PublishGitHub.py b/Tools/PublishGitHub.py index 95d33aca..6010e558 100644 --- a/Tools/PublishGitHub.py +++ b/Tools/PublishGitHub.py @@ -1,8 +1,8 @@ # Public domain license. # Author: igor.zavoychinskiy@gmail.com # GitHub: https://github.com/ihsoft/KSPDev_ReleaseBuilder -# $version: 1 -# $date: 07/17/2018 +# $version: 2 +# $date: 10/28/2018 """ Script to publish releases to GitHub. @@ -11,7 +11,7 @@ Example: - $ PublishCurseForge.py\ + $ PublishGitHub.py\ --user=my_github_user\ --repo=MyGitHubMod\ --token=1111111111122222222222222333333333333333\ @@ -40,7 +40,7 @@ Not to mention the quotes and back slashes issues. To avoid all this burden, simple put all the options into a text file and provide it to the script: - $ PublishCurseForge.py @my_params.txt + $ PublishGitHub.py @my_params.txt Don't bother about escaping in this file. Anything, placed in a line goes to the parameter value *as-is*. So you don't need to escape backslashes, @@ -67,6 +67,7 @@ import textwrap from clients import GitHubClient +from utils import ChangelogUtils LOGGER = logging.getLogger() @@ -136,10 +137,11 @@ def main(argv): user = opts['user'] repo = opts['repo'] - # Init CurseForge client. + # Init GitHub client. GitHubClient.API_TOKEN = opts['token'] - desc = _ExtractDescription(opts['changelog'], opts['changelog_breaker']) + desc = ChangelogUtils.ExtractDescription( + opts['changelog'], opts['changelog_breaker']) filename = opts['archive'] as_draft = opts['as_draft'] @@ -190,22 +192,6 @@ def _Shutdown(): logging.shutdown() -def _ExtractDescription(changelog_file, breaker_re): - """Helper method to extract the meaningful part of the release changelog.""" - with open(changelog_file, 'r') as f: - lines= f.readlines() - changelog = '' - for line in lines: - # Ignore any trailing empty lines. - if not changelog and not line.strip(): - continue - # Stop at the breaker. - if re.match(breaker_re, line.strip()): - break - changelog += line - return changelog.strip() - - try: main(sys.argv) except Exception, ex: diff --git a/Tools/PublishSpacedock.py b/Tools/PublishSpacedock.py index c8bf0f51..0c6e419f 100644 --- a/Tools/PublishSpacedock.py +++ b/Tools/PublishSpacedock.py @@ -1,8 +1,8 @@ # Public domain license. # Author: igor.zavoychinskiy@gmail.com # GitHub: https://github.com/ihsoft/KSPDev_ReleaseBuilder -# $version: 1 -# $date: 07/13/2018 +# $version: 5 +# $date: 10/28/2018 """ Script to publish releases to Spacedock. @@ -62,6 +62,7 @@ import textwrap from clients import SpacedockClient +from utils import ChangelogUtils LOGGER = logging.getLogger() @@ -90,7 +91,7 @@ def main(argv): parser.add_argument( '--project', action='store', metavar='', required=True, help='''the ID of the project to publish to. To get it, go to the mod - overview on Spacedock and extarct the number from the URL: + overview on Spacedock and extract the number from the URL: /mod//...''') parser.add_argument( '--changelog', action='store', metavar='', required=True, @@ -125,6 +126,10 @@ def main(argv): '--pass', action='store', metavar='', help='''the password for the Spacedock account. If not set, then it will be asked in the command line.''') + parser.add_argument( + '--github', action='store', metavar='', + help='''the GitHub project and user, separated by "/" symbol. Used when + expanding the GitHub links. Example: "ihsoft/KIS"''') opts = vars(parser.parse_args(argv[1:])) mod_id = opts['project'] @@ -149,7 +154,10 @@ def main(argv): exit(-1) game_version = all_versions[0]['name'] - desc = _ExtractDescription(opts['changelog'], opts['changelog_breaker']) + desc = ChangelogUtils.ExtractDescription( + opts['changelog'], opts['changelog_breaker']) + if opts['github']: + desc = ChangelogUtils.ProcessGitHubLinks(desc, opts['github']) filename = opts['archive'] parts = re.findall(opts['version_extract'], os.path.basename(filename)) @@ -214,20 +222,4 @@ def _Shutdown(): logging.shutdown() -def _ExtractDescription(changelog_file, breaker_re): - """Helper method to extract the meaningful part of the release changelog.""" - with open(changelog_file, 'r') as f: - lines= f.readlines() - changelog = '' - for line in lines: - # Ignore any trailing empty lines. - if not changelog and not line.strip(): - continue - # Stop at the breaker. - if re.match(breaker_re, line.strip()): - break - changelog += line - return changelog.strip() - - main(sys.argv) diff --git a/Tools/publish_curseforge_args.txt b/Tools/publish_curseforge_args.txt index d946d456..c2a21aed 100644 --- a/Tools/publish_curseforge_args.txt +++ b/Tools/publish_curseforge_args.txt @@ -1,6 +1,7 @@ --project=228561 --token=<> --changelog=../CHANGELOG.md +--github=ihsoft/KIS --versions=latest_all_builds --title=KIS {tag} --archive=../KIS_v1.15.zip diff --git a/Tools/publish_spacedock_args.txt b/Tools/publish_spacedock_args.txt index 6ebe2e5b..cc33857a 100644 --- a/Tools/publish_spacedock_args.txt +++ b/Tools/publish_spacedock_args.txt @@ -1,5 +1,6 @@ --project=1909 --login=<> --changelog=../CHANGELOG.md +--github=ihsoft/KIS --ksp_version=latest --archive=../KIS_v1.15.zip diff --git a/Tools/utils/ChangelogUtils.py b/Tools/utils/ChangelogUtils.py new file mode 100644 index 00000000..53583b6c --- /dev/null +++ b/Tools/utils/ChangelogUtils.py @@ -0,0 +1,37 @@ +# Public domain license. +# Author: igor.zavoychinskiy@gmail.com +# GitHub: https://github.com/ihsoft/KSPDev_ReleaseBuilder +# $version: 1 +# $date: 10/28/2018 + +"""Provides helpers to deal with the markup CHANGELOG file.""" +import re + + +def ExtractDescription(changelog_file, breaker_re): + """Loads the file and extarcts the lines up to the specified breaker.""" + with open(changelog_file, 'r') as f: + lines= f.readlines() + changelog = '' + for line in lines: + # Ignore any trailing empty lines. + if not changelog and not line.strip(): + continue + # Stop at the breaker. + if re.match(breaker_re, line.strip()): + break + changelog += line + return changelog.strip() + + +def ProcessGitHubLinks(markup, github): + """Replaces the GitHub local links by the external variants.""" + markup = re.sub( + r'#(\d+)', + r'[#\1](https://github.com/%s/issues/\1)' % github, + markup) + markup = re.sub( + r'\[(.+?)\]\((wiki/.+?)\)', + r'[\1](https://github.com/%s/\2)' % github, + markup) + return markup From 5f825dc001cfbe32c5bcf52a33c4425b6a3f5b25 Mon Sep 17 00:00:00 2001 From: ihsoft Date: Mon, 29 Oct 2018 21:48:40 -0700 Subject: [PATCH 5/6] Small style change --- Source/MainScreenTweaker.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/MainScreenTweaker.cs b/Source/MainScreenTweaker.cs index 2c23f7b9..49b18f64 100644 --- a/Source/MainScreenTweaker.cs +++ b/Source/MainScreenTweaker.cs @@ -33,14 +33,16 @@ public class ModelTweak { public List itemNames = new List(); } + #pragma warning disable 0649 /// Tells if tweaks should be applied. [PersistentField("MainScreenTweaker/enabled")] - public bool twekerEnabled; + public bool tweakerEnabled; /// Tells if all object paths in the scene needs to be logged. /// Only enable it to get the full hierarchy dump. [PersistentField("MainScreenTweaker/logAllObjects")] public bool logAllObjects; + #pragma warning restore 0649 /// Full list of configured tweaks on the screan. [PersistentField("MainScreenTweaker/modelTweak", isCollection = true)] @@ -51,7 +53,7 @@ public class ModelTweak { void Awake() { ConfigAccessor.ReadFieldsInType(GetType(), this); - if (twekerEnabled) { + if (tweakerEnabled) { AsyncCall.CallOnEndOfFrame(this, WaitAndApplyTweaks); } } From cf0d42255bef001fba09f33ee1531b6a55cf224c Mon Sep 17 00:00:00 2001 From: ihsoft Date: Mon, 29 Oct 2018 21:59:14 -0700 Subject: [PATCH 6/6] Release 1.16 --- CHANGELOG.md | 2 +- KIS.version | 6 +++--- Source/Properties/AssemblyInfo.cs | 2 +- Tools/publish_curseforge_args.txt | 2 +- Tools/publish_github_args.txt | 2 +- Tools/publish_spacedock_args.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6828ee3c..4de08685 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.16 (pre-release): +# 1.16 (October 29th, 2018): * [Fix #275] No preview meshes shown. # 1.15 (October 27th, 2018): diff --git a/KIS.version b/KIS.version index cea61ac1..f3214d06 100644 --- a/KIS.version +++ b/KIS.version @@ -19,9 +19,9 @@ "NAME": "Kerbal Inventory System", "URL": "https://raw.githubusercontent.com/ihsoft/KIS/master/KIS.version", "VERSION": { - "BUILD": 42207, + "BUILD": 37464, "MAJOR": 1, - "MINOR": 15, - "PATCH": 6873 + "MINOR": 16, + "PATCH": 6876 } } \ No newline at end of file diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 4edc2115..273bf9f7 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion ("1.16.*")] -[assembly: AssemblyInformationalVersion ("1.16-pre for KSP 1.5+")] +[assembly: AssemblyInformationalVersion ("1.16 for KSP 1.5+")] [assembly: KSPAssembly ("KIS", 1, 16)] diff --git a/Tools/publish_curseforge_args.txt b/Tools/publish_curseforge_args.txt index c2a21aed..e534af8f 100644 --- a/Tools/publish_curseforge_args.txt +++ b/Tools/publish_curseforge_args.txt @@ -4,4 +4,4 @@ --github=ihsoft/KIS --versions=latest_all_builds --title=KIS {tag} ---archive=../KIS_v1.15.zip +--archive=../KIS_v1.16.zip diff --git a/Tools/publish_github_args.txt b/Tools/publish_github_args.txt index 97d4930a..e10d16da 100644 --- a/Tools/publish_github_args.txt +++ b/Tools/publish_github_args.txt @@ -4,4 +4,4 @@ --changelog=../CHANGELOG.md --as_draft --title=KIS v{tag} ---archive=../KIS_v1.15.zip +--archive=../KIS_v1.16.zip diff --git a/Tools/publish_spacedock_args.txt b/Tools/publish_spacedock_args.txt index cc33857a..15b5fc09 100644 --- a/Tools/publish_spacedock_args.txt +++ b/Tools/publish_spacedock_args.txt @@ -3,4 +3,4 @@ --changelog=../CHANGELOG.md --github=ihsoft/KIS --ksp_version=latest ---archive=../KIS_v1.15.zip +--archive=../KIS_v1.16.zip