Skip to content

Commit c21fc4f

Browse files
Added stock settings page to specify height of vessel when using the CenterAdjust mode ('b'), one entry for vab and one for sph
1 parent c244df0 commit c21fc4f

File tree

8 files changed

+63
-5
lines changed

8 files changed

+63
-5
lines changed
4 KB
Binary file not shown.

ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
ChangeLog
22

3+
3.4.1
4+
Added stock settings page to specify height of vessel when using the CenterAdjust mode ('b'), one entry for vab and one for sph
5+
36
3.4.0.3
47
Removed LineDrawer.cs since it was unused. Untested
58
Moved "enabled = false" from cctor to Awake methods()

EditorExtensionsRedux.version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"VERSION": {
66
"MAJOR": 3,
77
"MINOR": 4,
8-
"PATCH": 0,
9-
"BUILD": 3
8+
"PATCH": 1,
9+
"BUILD": 0
1010
},
1111
"KSP_VERSION_MIN": {
1212
"MAJOR": 1,

EditorExtensionsRedux/AssemblyVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
using System.Reflection;
1212

13-
[assembly: AssemblyVersion("3.4.0.0")]
13+
[assembly: AssemblyVersion("3.4.0.3")]

EditorExtensionsRedux/EditorExtensionsRedux.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,9 @@ void CenterAlign(bool otherHorizontal = false)
19241924
float x = 9999;
19251925
foreach (var p in l)
19261926
x = Math.Min(x, p.transform.position.y);
1927-
float yDiff = 5 - x;
1927+
float height = (EditorDriver.editorFacility == EditorFacility.VAB) ?
1928+
HighLogic.CurrentGame.Parameters.CustomParams<EEX>().vabHeight : HighLogic.CurrentGame.Parameters.CustomParams<EEX>().sphHeight;
1929+
float yDiff = height - x;
19281930

19291931
//move selected part
19301932
CenterHorizontallyOnPoint(sp, yDiff);

EditorExtensionsRedux/EditorExtensionsRedux.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<Compile Include="Config\ConfigManager.cs" />
6666
<Compile Include="PartInfoWindow.cs" />
6767
<Compile Include="ShowAngleSnaps.cs" />
68+
<Compile Include="StockSettings.cs" />
6869
<Compile Include="Utility.cs" />
6970
<Compile Include="GUIWindow.cs" />
7071
<Compile Include="StrutWindow.cs" />
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+

2+
using System.Collections;
3+
using System.Reflection;
4+
5+
namespace EditorExtensionsRedux
6+
{
7+
// http://forum.kerbalspaceprogram.com/index.php?/topic/147576-modders-notes-for-ksp-12/#comment-2754813
8+
// search for "Mod integration into Stock Settings
9+
10+
public class EEX : GameParameters.CustomParameterNode
11+
{
12+
public override string Title { get { return ""; } }
13+
public override GameParameters.GameMode GameMode { get { return GameParameters.GameMode.ANY; } }
14+
public override string Section { get { return "Editor Extensions"; } }
15+
public override string DisplaySection { get { return "Editor Extensions"; } }
16+
public override int SectionOrder { get { return 1; } }
17+
public override bool HasPresets { get { return false; } }
18+
19+
20+
21+
[GameParameters.CustomFloatParameterUI("Height of bottom of vessel in VAB", minValue = 0, maxValue = 20f, stepCount = 101, displayFormat = "F4",
22+
toolTip = "In the VAB, height bottom of vessel is moved to when using the 'b' function to adjust the position")]
23+
public float vabHeight = 5f;
24+
25+
[GameParameters.CustomFloatParameterUI("Height of bottom of vessel in SPH", minValue = 0, maxValue = 20, stepCount = 101, displayFormat = "F4",
26+
toolTip = "In the VAB, height bottom of vessel is moved to when using the 'b' function to adjust the position")]
27+
public float sphHeight = 5f;
28+
29+
30+
public override void SetDifficultyPreset(GameParameters.Preset preset)
31+
{
32+
}
33+
34+
public override bool Enabled(MemberInfo member, GameParameters parameters)
35+
{
36+
37+
return true;
38+
}
39+
40+
bool unread = false;
41+
public override bool Interactible(MemberInfo member, GameParameters parameters)
42+
{
43+
44+
return true;
45+
}
46+
47+
public override IList ValidValues(MemberInfo member)
48+
{
49+
return null;
50+
}
51+
}
52+
}

GameData/EditorExtensionsRedux/EditorExtensionsRedux.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"MAJOR": 3,
77
"MINOR": 4,
88
"PATCH": 0,
9-
"BUILD":
9+
"BUILD": 3
1010
},
1111
"KSP_VERSION_MIN": {
1212
"MAJOR": 1,

0 commit comments

Comments
 (0)