Skip to content

Commit

Permalink
Merge pull request #276 from ihsoft/next
Browse files Browse the repository at this point in the history
Release v1.16
  • Loading branch information
ihsoft authored Oct 30, 2018
2 parents 42f8731 + cf0d422 commit cf460fb
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 75 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.16 (October 29th, 2018):
* [Fix #275] No preview meshes shown.

# 1.15 (October 27th, 2018):
* [Change] KSP 1.5.* compatibility.
* [Fix #268] Wrong size detection on the MH expansion parts. READ #273!!!
Expand Down
6 changes: 3 additions & 3 deletions KIS.version
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
3 changes: 2 additions & 1 deletion Source/KISAddonPointer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ static void CollectMeshesFromAssembly(Part assembly,
// Get all meshes from the part's model.
var meshFilters = assembly
.FindModelComponents<MeshFilter>()
.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 => {
Expand Down
1 change: 0 additions & 1 deletion Source/KIS_Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions Source/MainScreenTweaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ public class ModelTweak {
public List<string> itemNames = new List<string>();
}

#pragma warning disable 0649
/// <summary>Tells if tweaks should be applied.</summary>
[PersistentField("MainScreenTweaker/enabled")]
public bool twekerEnabled;
public bool tweakerEnabled;

/// <summary>Tells if all object paths in the scene needs to be logged.</summary>
/// <remarks>Only enable it to get the full hierarchy dump.</remarks>
[PersistentField("MainScreenTweaker/logAllObjects")]
public bool logAllObjects;
#pragma warning restore 0649

/// <summary>Full list of configured tweaks on the screan.</summary>
[PersistentField("MainScreenTweaker/modelTweak", isCollection = true)]
Expand All @@ -51,7 +53,7 @@ public class ModelTweak {

void Awake() {
ConfigAccessor.ReadFieldsInType(GetType(), this);
if (twekerEnabled) {
if (tweakerEnabled) {
AsyncCall.CallOnEndOfFrame(this, WaitAndApplyTweaks);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 for KSP 1.5+")]
[assembly: KSPAssembly ("KIS", 1, 16)]
2 changes: 1 addition & 1 deletion Tools/KspReleaseBuilder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Public domain license.
# Author: [email protected]
# 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.
Expand Down
30 changes: 11 additions & 19 deletions Tools/PublishCurseForge.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Public domain license.
# Author: [email protected]
# 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.
Expand Down Expand Up @@ -72,6 +72,7 @@
import textwrap

from clients import CurseForgeClient
from utils import ChangelogUtils


LOGGER = logging.getLogger()
Expand Down Expand Up @@ -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='<GitHub>',
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']
Expand Down Expand Up @@ -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']:
Expand Down Expand Up @@ -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)
30 changes: 8 additions & 22 deletions Tools/PublishGitHub.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Public domain license.
# Author: [email protected]
# 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.
Expand All @@ -11,7 +11,7 @@
Example:
$ PublishCurseForge.py\
$ PublishGitHub.py\
--user=my_github_user\
--repo=MyGitHubMod\
--token=1111111111122222222222222333333333333333\
Expand Down Expand Up @@ -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,
Expand All @@ -67,6 +67,7 @@
import textwrap

from clients import GitHubClient
from utils import ChangelogUtils


LOGGER = logging.getLogger()
Expand Down Expand Up @@ -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']

Expand Down Expand Up @@ -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:
Expand Down
32 changes: 12 additions & 20 deletions Tools/PublishSpacedock.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Public domain license.
# Author: [email protected]
# 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.
Expand Down Expand Up @@ -62,6 +62,7 @@
import textwrap

from clients import SpacedockClient
from utils import ChangelogUtils


LOGGER = logging.getLogger()
Expand Down Expand Up @@ -90,7 +91,7 @@ def main(argv):
parser.add_argument(
'--project', action='store', metavar='<project ID>', 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/<project ID>/...''')
parser.add_argument(
'--changelog', action='store', metavar='<file path>', required=True,
Expand Down Expand Up @@ -125,6 +126,10 @@ def main(argv):
'--pass', action='store', metavar='<SD password>',
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='<GitHub>',
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']
Expand All @@ -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))
Expand Down Expand Up @@ -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)
3 changes: 2 additions & 1 deletion Tools/publish_curseforge_args.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--project=228561
--token=<<SECRET>>
--changelog=../CHANGELOG.md
--github=ihsoft/KIS
--versions=latest_all_builds
--title=KIS {tag}
--archive=../KIS_v1.15.zip
--archive=../KIS_v1.16.zip
2 changes: 1 addition & 1 deletion Tools/publish_github_args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
--changelog=../CHANGELOG.md
--as_draft
--title=KIS v{tag}
--archive=../KIS_v1.15.zip
--archive=../KIS_v1.16.zip
3 changes: 2 additions & 1 deletion Tools/publish_spacedock_args.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--project=1909
--login=<<SECRET>>
--changelog=../CHANGELOG.md
--github=ihsoft/KIS
--ksp_version=latest
--archive=../KIS_v1.15.zip
--archive=../KIS_v1.16.zip
37 changes: 37 additions & 0 deletions Tools/utils/ChangelogUtils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Public domain license.
# Author: [email protected]
# 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

0 comments on commit cf460fb

Please sign in to comment.