Skip to content

Commit

Permalink
Merge pull request #9 from ChrisAdderley/dev
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
ChrisAdderley authored Apr 15, 2019
2 parents 67d6add + c2bd833 commit 16f2b20
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 671 deletions.
17 changes: 17 additions & 0 deletions .mod_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mod-name: DeployableEngines
package:
include-dependencies: true # Include dependencies in the package
included-gamedata:
- DeployableEngines
included-support: # Include these root-level files in packages
- readme.txt
- changelog.txt
deploy:
SpaceDock:
enabled: false # activate/deactivate this deployment script
mod-id: 558 # The Spacedock mod ID for deployment
CurseForge:
enabled: false # activate/deactivate this deployment script
mod-id: 220671 # The CurseForge mod ID for deployment
GitHub:
enabled: true # activate/deactivate this deployment script
45 changes: 15 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,28 @@ branches:
only:
- master
script:
- python build_scripts/build.py
- git clone https://github.com/post-kerbin-mining-corporation/build-deploy.git # clone this repo, it contains the stuff that does the heavy lifting
- cd build-deploy
- git checkout master
- cd ..
- pytest -s --testpath "GameData/" build-deploy/src/tests/ # run the deploy tests
- python build-deploy/src/package.py --f ".mod_data.yml" # Build package
before_deploy:
- VERSION=$(cat build_scripts/version.txt)
- CHANGELOG=$(cat build_scripts/changelog.md)
- IFS='/'; BASENAME=($TRAVIS_REPO_SLUG); unset IFS;
- RELEASE_NAME="${BASENAME[1]} $VERSION"
- echo $VERSION
- git config --local user.name "ChrisAdderley"
- git config --local user.email "[email protected]"
- git remote set-url origin https://ChrisAdderley:${GITHUB_OAUTH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
# Only tag if this is the first before_deploy (runs for all providers)
- >
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
git tag $VERSION;
git push origin $VERSION;
fi
- python build-deploy/src/stage.py --f ".mod_data.yml" # Run the staging script
deploy:
- provider: s3
- provider: script
script: python build-deploy/src/deploy.py --f ".mod_data.yml" # Deploy package to spacedock, curse, github
skip_cleanup: true
on:
branch: master
- provider: s3 # releases to S3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: "nertea-ksp-modding-releases"
local_dir: deploy
local_dir: deploy/DeployableEngines
skip_cleanup: true
acl: public_read
region: us-east-2
upload-dir: deployable-engines
on:
condition: $TRAVIS_BRANCH = master
- deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: deploy/*
body: $CHANGELOG
name: $RELEASE_NAME
skip_cleanup: true
on:
tags: false
condition: $TRAVIS_BRANCH = master
branch: master
23 changes: 23 additions & 0 deletions CKAN/DeployableEngines.netkan
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"spec_version": "v1.4",
"identifier": "DeployableEngines",
"abstract": "A plugin to manage extending/retracting engine nozzles",
"name": "Deployable Engines Plugin",
"$kref": "#/ckan/github/ChrisAdderley/DeployableEngines",
"$vref": "#/ckan/ksp-avc",
"license": "MIT",
"resources": {
"homepage": "https://github.com/ChrisAdderley/DeployableEngines/wiki",
"repository": "https://github.com/ChrisAdderley/DeployableEngines"
},
"supports": [
{ "name": "KerbalAtomics" },
{ "name": "CryoEngines" }
],
"install": [
{
"find": "DeployableEngines",
"install_to": "GameData"
}
]
}
12 changes: 6 additions & 6 deletions GameData/DeployableEngines/Versioning/DeployableEngines.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
{
"MAJOR":1,
"MINOR":0,
"PATCH":0,
"PATCH":1,
"BUILD":0
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":6,
"PATCH":1
"MINOR":7,
"PATCH":0
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":6,
"PATCH":1
"MINOR":7,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":6,
"MINOR":7,
"PATCH":99
}
}
40 changes: 20 additions & 20 deletions Source/DeployableEngines/ModuleDeployableEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ModuleDeployableEngine : PartModule
{
[KSPField(isPersistant = false)]
public string EngineAnimationName;

[KSPField(isPersistant = false)]
public float WaitForAnimation = 0f;

Expand All @@ -37,13 +37,13 @@ public void ToggleAnimationEditor()
{
engineIsOn = !engineIsOn;
}


public void Start()
{
Events["ToggleAnimationEditor"].guiName = Localizer.Format("#autoLOC_502068");
engineStates = SetUpAnimation(EngineAnimationName, this.part);

if(HighLogic.LoadedSceneIsFlight)
{
engines = this.GetComponents<ModuleEnginesFX>().ToList();
Expand All @@ -54,7 +54,7 @@ public void Start()
hasMultiEngine = true;
}


foreach(AnimationState anim in engineStates)
{
if (engineIsOn)
Expand All @@ -66,11 +66,11 @@ public void Start()
anim.normalizedTime = 0f;
}
}

}



public void FixedUpdate()
{
if(HighLogic.LoadedSceneIsFlight)
Expand Down Expand Up @@ -104,8 +104,8 @@ public void FixedUpdate()
}
}
}


if(HighLogic.LoadedSceneIsFlight && anim.normalizedTime >= WaitForAnimation && anim.speed > 0)
{
if (hasMultiEngine)
Expand All @@ -124,27 +124,27 @@ public void FixedUpdate()
}
}
}

if(anim.normalizedTime>=1)
{
anim.speed = 0;
anim.normalizedTime = 1;
}

if(anim.normalizedTime >=1 && !engineIsOn)
{
anim.speed = -1;

}

if(anim.normalizedTime <0)
{
anim.speed = 0;
anim.normalizedTime = 0;
}

}

}

private bool QueryEngineOn()
Expand All @@ -160,9 +160,9 @@ private bool QueryEngineOn(ModuleEnginesFX fxEng)
{
return false;
}



public AnimationState[] SetUpAnimation(string animationName, Part part) //Thanks Majiir!
{
var states = new List<AnimationState>();
Expand All @@ -175,7 +175,7 @@ public AnimationState[] SetUpAnimation(string animationName, Part part) //Thank
animationState.wrapMode = WrapMode.ClampForever;
animation.Blend(animationName);
states.Add(animationState);

}
return states.ToArray();
}
Expand Down
Loading

0 comments on commit 16f2b20

Please sign in to comment.