mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Allow toggling multiprojection in editor
This commit is contained in:
parent
596675ad8d
commit
df95601416
@ -15,7 +15,7 @@ Localization
|
|||||||
#LOC_ConformalDecals_gui-opacity = Opacity
|
#LOC_ConformalDecals_gui-opacity = Opacity
|
||||||
#LOC_ConformalDecals_gui-cutoff = Cutoff
|
#LOC_ConformalDecals_gui-cutoff = Cutoff
|
||||||
#LOC_ConformalDecals_gui-wear = Edge Wear
|
#LOC_ConformalDecals_gui-wear = Edge Wear
|
||||||
#LOC_ConformalDecals_gui-aspectratio = Aspect Ratio
|
#LOC_ConformalDecals_gui-multiproject = Project onto Multiple
|
||||||
#LOC_ConformalDecals_gui-select-flag = Select Flag
|
#LOC_ConformalDecals_gui-select-flag = Select Flag
|
||||||
#LOC_ConformalDecals_gui-reset-flag = Reset Flag
|
#LOC_ConformalDecals_gui-reset-flag = Reset Flag
|
||||||
#LOC_ConformalDecals_gui-set-text = Set Text
|
#LOC_ConformalDecals_gui-set-text = Set Text
|
||||||
|
Binary file not shown.
@ -79,7 +79,9 @@ namespace ConformalDecals {
|
|||||||
UI_FloatRange()]
|
UI_FloatRange()]
|
||||||
public float wear = 100;
|
public float wear = 100;
|
||||||
|
|
||||||
[KSPField(isPersistant = true)] public bool projectMultiple = true;
|
[KSPField(guiName = "#LOC_ConformalDecals_gui-multiproject", guiActive = false, guiActiveEditor = true, isPersistant = true),
|
||||||
|
UI_Toggle()]
|
||||||
|
public bool projectMultiple = true;
|
||||||
|
|
||||||
[KSPField] public MaterialPropertyCollection materialProperties;
|
[KSPField] public MaterialPropertyCollection materialProperties;
|
||||||
|
|
||||||
@ -301,7 +303,7 @@ namespace ConformalDecals {
|
|||||||
Destroy(materialProperties);
|
Destroy(materialProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnSizeTweakEvent(BaseField field, object obj) {
|
protected void OnProjectionTweakEvent(BaseField field, object obj) {
|
||||||
// scale or depth values have been changed, so update scale
|
// scale or depth values have been changed, so update scale
|
||||||
// and update projection matrices if attached
|
// and update projection matrices if attached
|
||||||
UpdateProjection();
|
UpdateProjection();
|
||||||
@ -521,6 +523,7 @@ namespace ConformalDecals {
|
|||||||
var opacityField = Fields[nameof(opacity)];
|
var opacityField = Fields[nameof(opacity)];
|
||||||
var cutoffField = Fields[nameof(cutoff)];
|
var cutoffField = Fields[nameof(cutoff)];
|
||||||
var wearField = Fields[nameof(wear)];
|
var wearField = Fields[nameof(wear)];
|
||||||
|
var multiprojectField = Fields[nameof(projectMultiple)];
|
||||||
|
|
||||||
scaleField.guiActiveEditor = scaleAdjustable;
|
scaleField.guiActiveEditor = scaleAdjustable;
|
||||||
depthField.guiActiveEditor = depthAdjustable;
|
depthField.guiActiveEditor = depthAdjustable;
|
||||||
@ -538,7 +541,7 @@ namespace ConformalDecals {
|
|||||||
scaleEditor.minValue = minValue;
|
scaleEditor.minValue = minValue;
|
||||||
scaleEditor.maxValue = maxValue;
|
scaleEditor.maxValue = maxValue;
|
||||||
scaleEditor.stepIncrement = (maxValue - minValue) / steps;
|
scaleEditor.stepIncrement = (maxValue - minValue) / steps;
|
||||||
scaleEditor.onFieldChanged = OnSizeTweakEvent;
|
scaleEditor.onFieldChanged = OnProjectionTweakEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depthAdjustable) {
|
if (depthAdjustable) {
|
||||||
@ -549,7 +552,7 @@ namespace ConformalDecals {
|
|||||||
depthEditor.minValue = minValue;
|
depthEditor.minValue = minValue;
|
||||||
depthEditor.maxValue = maxValue;
|
depthEditor.maxValue = maxValue;
|
||||||
depthEditor.stepIncrement = (maxValue - minValue) / steps;
|
depthEditor.stepIncrement = (maxValue - minValue) / steps;
|
||||||
depthEditor.onFieldChanged = OnSizeTweakEvent;
|
depthEditor.onFieldChanged = OnProjectionTweakEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opacityAdjustable) {
|
if (opacityAdjustable) {
|
||||||
@ -586,6 +589,9 @@ namespace ConformalDecals {
|
|||||||
wearEditor.stepIncrement = (maxValue - minValue) / steps;
|
wearEditor.stepIncrement = (maxValue - minValue) / steps;
|
||||||
wearEditor.onFieldChanged = OnMaterialTweakEvent;
|
wearEditor.onFieldChanged = OnMaterialTweakEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var multiprojectEditor = (UI_Toggle) multiprojectField.uiControlEditor;
|
||||||
|
multiprojectEditor.onFieldChanged = OnProjectionTweakEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Render(Camera camera) {
|
public void Render(Camera camera) {
|
||||||
|
Loading…
Reference in New Issue
Block a user