-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Deleted settings file to avoid stomping over user settings - Added SITUATION_TEXT element - Added new placeholder values - Added support for Custom Text
- Loading branch information
Zeenobit
committed
May 24, 2015
1 parent
c22779a
commit 54e0489
Showing
13 changed files
with
254 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
KSEA_HISTORIAN_LAYOUT | ||
{ | ||
Name = Alternative | ||
|
||
{ | ||
RECTANGLE | ||
{ | ||
Anchor = 0.0,0.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
KSEA_HISTORIAN_LAYOUT | ||
{ | ||
RECTANGLE | ||
{ | ||
Anchor = 0.0,1.0 | ||
Size = 1.0,0.175 | ||
Position = 0.0,1.0 | ||
Color = 0.0,0.0,0.0,0.5 | ||
} | ||
|
||
FLAG | ||
{ | ||
Anchor = 0.0,0.0 | ||
Position = 0.02,0.05 | ||
Scale = 1,1 | ||
DefaultTexture = Squad/Flags/default | ||
} | ||
|
||
SITUATION_TEXT | ||
{ | ||
Anchor = 0.0,1.0 | ||
Size = 1.0,0.175 | ||
Position = 0.025,1.0 | ||
Color = 1.0,1.0,1.0,1.0 | ||
TextAnchor = MiddleLeft | ||
FontSize = 12 | ||
FontStyle = Normal | ||
Default = <b><UT></b><N><T+><N><Custom> | ||
Landed = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Landed on <Body>'s <LandingZone><N><Custom></size> | ||
Splashed = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Splashed in <Body>'s Waters<N><Custom></size> | ||
Prelaunch = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Preparing for launch from <Body><N><Custom></size> | ||
Flying = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Flying at Mach <Mach> (<Speed> m/s) <Altitude> meters over <Body>'s <Biome><N><Custom></size> | ||
SubOrbital = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Flying in a sub-orbital trajectory <Altitude> meters over <Body><N><Custom></size> | ||
Orbiting = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Orbiting around <Body><N><Custom></size> | ||
Escaping = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Escaping from <Body><N><Custom></size> | ||
Docked = <size=22><b><Vessel></b></size><N><size=8><N></size><b><UT></b><N><T+><N><size=12>Docked at <Body><N><Custom></size> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using UnityEngine; | ||
|
||
namespace KSEA.Historian | ||
{ | ||
public class SituationText : Text | ||
{ | ||
private string m_Default = ""; | ||
private string m_Landed = ""; | ||
private string m_Splashed = ""; | ||
private string m_Prelaunch = ""; | ||
private string m_Flying = ""; | ||
private string m_SubOrbital = ""; | ||
private string m_Orbiting = ""; | ||
private string m_Escaping = ""; | ||
private string m_Docked = ""; | ||
|
||
protected override void OnLoad(ConfigNode node) | ||
{ | ||
base.OnLoad(node); | ||
|
||
m_Default = node.GetString("Default", ""); | ||
m_Landed = node.GetString("Landed", ""); | ||
m_Splashed = node.GetString("Splashed", ""); | ||
m_Prelaunch = node.GetString("Prelaunch", ""); | ||
m_Flying = node.GetString("Flying", ""); | ||
m_SubOrbital = node.GetString("SubOrbital", ""); | ||
m_Orbiting = node.GetString("Orbiting", ""); | ||
m_Escaping = node.GetString("Escaping", ""); | ||
m_Docked = node.GetString("Docked", ""); | ||
} | ||
|
||
protected override void OnDraw(Rect bounds) | ||
{ | ||
var text = m_Default; | ||
var vessel = FlightGlobals.ActiveVessel; | ||
|
||
if (vessel != null) | ||
{ | ||
var situation = vessel.situation; | ||
text = ResolveText(situation); | ||
} | ||
|
||
SetText(text); | ||
|
||
base.OnDraw(bounds); | ||
} | ||
|
||
private string ResolveText(Vessel.Situations situation) | ||
{ | ||
switch (situation) | ||
{ | ||
case Vessel.Situations.LANDED: | ||
|
||
return m_Landed; | ||
|
||
case Vessel.Situations.SPLASHED: | ||
|
||
return m_Splashed; | ||
|
||
case Vessel.Situations.PRELAUNCH: | ||
|
||
return m_Prelaunch; | ||
|
||
case Vessel.Situations.FLYING: | ||
|
||
return m_Flying; | ||
|
||
case Vessel.Situations.SUB_ORBITAL: | ||
|
||
return m_SubOrbital; | ||
|
||
case Vessel.Situations.ORBITING: | ||
|
||
return m_Orbiting; | ||
|
||
case Vessel.Situations.ESCAPING: | ||
|
||
return m_Escaping; | ||
|
||
case Vessel.Situations.DOCKED: | ||
|
||
return m_Docked; | ||
} | ||
|
||
return m_Default; | ||
} | ||
} | ||
} |
Oops, something went wrong.