├── .gitignore ├── LICENSE ├── README.md ├── REPOSoftTechUtils ├── .gitattributes ├── AppLauncherToolBarExtension.cs ├── LICENSE ├── README.md ├── RSTutilities.cs ├── RectExtentions.cs ├── StringFormatter │ ├── Arg.cs │ ├── Arg.tt │ ├── Culture.cs │ ├── CustomNumeric.cs │ ├── Numeric.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SR.cs │ ├── StringBuffer.cs │ ├── StringFormatter.csproj │ └── StringView.cs └── ToolBarManager.cs ├── TODO └── TarsierSpaceTechnology ├── TarsierSpaceTech.sln └── TarsierSpaceTech ├── AppLauncherToolBarExtension.cs ├── Distribution └── GameData │ ├── README.md │ └── TarsierSpaceTech │ ├── Agencies │ ├── Agents.cfg │ ├── TarsierSpaceTechnology.dds │ └── TarsierSpaceTechnology_scaled.truecolor │ ├── Changelog.txt │ ├── DmagicOrbitalScienceScopes.cfg.optional │ ├── Flags │ └── Tarsier Space Technology.dds │ ├── Galaxies │ ├── galaxies.cfg │ ├── galaxy1.dds │ ├── galaxy2.dds │ ├── galaxy3.dds │ ├── galaxy4.dds │ ├── galaxy5.dds │ ├── galaxy6.dds │ ├── galaxy7.dds │ └── galaxy8.dds │ ├── Icons │ ├── TSTIconOff.png │ ├── TSTIconOn.png │ ├── TSTToolTipBox.png │ ├── TSTbtnRedCross.png │ ├── TSTbtnResize.png │ └── ToolbarIcon.png │ ├── KSPedia │ └── tarsierspacetech.ksp │ ├── KopernicusOnDemandOff.cfg.optional │ ├── LICENSE │ ├── Localization.cfg │ ├── Parts │ ├── AdvSpaceTelescope │ │ ├── model.mu │ │ ├── part.cfg │ │ └── texture001.dds │ ├── ChemCam │ │ ├── model.mu │ │ ├── part.cfg │ │ └── texture.dds │ ├── ScienceHardDrive │ │ ├── model.mu │ │ ├── model000.dds │ │ ├── model001.dds │ │ └── part.cfg │ ├── ScienceHardDriveLarge │ │ ├── model.mu │ │ ├── model010.dds │ │ ├── model011.dds │ │ └── part.cfg │ └── SpaceTelescope │ │ ├── model.mu │ │ ├── part.cfg │ │ └── texture.dds │ ├── Plugins │ └── PluginData │ │ └── Config.cfg │ ├── Resources │ ├── MMOPMScienceDefs.cfg │ ├── MMRSSScienceDefs.cfg │ └── ScienceDefs.cfg │ ├── TSTAddKIS.cfg │ ├── TSTMMKopernicus.cfg │ ├── TSTMMResearchBodies.cfg │ ├── TSTResearchBodies.cfg │ └── TarsierSpaceTechnology.version ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs └── Resources.resx ├── RBWrapper.cs ├── RSTutilities.cs ├── RTWrapper.cs ├── SettingsParams.cs ├── TARGETS ├── Targets.ai ├── target-01.bin ├── target-02.bin ├── target-03.bin ├── target-04.bin ├── target-05.bin ├── target-06.bin ├── target-07.bin ├── target-08.bin ├── target-09.bin ├── target-10.bin ├── target-11.bin └── target-12.bin ├── TSTCameraModule.cs ├── TSTChemCam.cs ├── TSTChemCamContract.cs ├── TSTDOE.cs ├── TSTGalaxies.cs ├── TSTGalaxy.cs ├── TSTGyroReactionWheel.cs ├── TSTMenu.cs ├── TSTProgressTracker.cs ├── TSTScienceHardDrive.cs ├── TSTScienceParam.cs ├── TSTScienceProgressionBlocker.cs ├── TSTSettings.cs ├── TSTSpaceTelescope.cs ├── TSTTelescopeContract.cs ├── TSTTelescopeContractParam.cs ├── TarsierSpaceTech.csproj ├── Textures.cs ├── ToolBarManager.cs └── viewfinder.bak /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | 110 | */Thumbs.db -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 tobyb121 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TarsierSpaceTechnology 2 | ====================== 3 | 4 | Tarsier Space Technology 5 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/AppLauncherToolBarExtension.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * AppLauncherToolBar.cs 3 | * (C) Copyright 2016, Jamie Leighton (JPLRepo) 4 | * REPOSoft Technologies 5 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 6 | * project is in no way associated with nor endorsed by Squad. 7 | * 8 | * This file is part of RST Utils. My attempt at creating my own KSP Mod base Architecture. 9 | * 10 | * RST Utils is free software: you can redistribute it and/or modify 11 | * it under the terms of the MIT License 12 | * 13 | * RST Utils is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | * You should have received a copy of the MIT License 18 | * along with RST Utils. If not, see . 19 | * 20 | */ 21 | using System; 22 | using KSP.UI.Screens; 23 | using UnityEngine; 24 | 25 | namespace RSTUtils 26 | { 27 | public class AppLauncherToolBar 28 | { 29 | public static AppLauncherToolBar Instance { get; private set; } 30 | 31 | private bool usingToolbar = false; //Set to true if user is using ToolBar 32 | private IButton button1; //ToolBar button 33 | private string toolBarName; //set to Name for button on ToolBar (modname) 34 | private string toolBarToolTip; // set tooltip for ToolBar button 35 | private string toolBarTexturePath; //The TooBar formatted Texture Path 36 | private GameScenesVisibility toolBarGameScenes; //GameScenes toolbar button can be seen in 37 | 38 | private bool usingStock = false; //Set to true if user is using Stock AppLauncher 39 | private ApplicationLauncherButton stockToolbarButton; // Stock Toolbar Button 40 | private ApplicationLauncher.AppScenes VisibleinScenes; //What scenes is the applauncher button seen in 41 | private UnityEngine.Texture appbtnTexON; //Texture for AppLauncher button when ON 42 | private UnityEngine.Texture appbtnTexOFF; //Texture for AppLauncher button when OFF 43 | private bool showHoverText = false; //Whether to show AppLauncher Hover Text or not. 44 | 45 | private bool _gamePaused; 46 | public Boolean gamePaused 47 | { 48 | get { return _gamePaused; } 49 | private set 50 | { 51 | _gamePaused = value; //Set the private variable 52 | } 53 | } 54 | 55 | private bool _hideUI; 56 | public Boolean hideUI 57 | { 58 | get { return _hideUI; } 59 | private set 60 | { 61 | _hideUI = value; //Set the private variable 62 | } 63 | } 64 | 65 | public bool StockButtonNotNull 66 | { 67 | get { return stockToolbarButton != null; } 68 | } 69 | 70 | public bool ToolBarButtonNotNull 71 | { 72 | get { return button1 != null; } 73 | } 74 | 75 | public bool usingToolBar 76 | { 77 | get { return usingToolbar; } 78 | } 79 | 80 | public bool usingAppLauncher 81 | { 82 | get { return usingStock; } 83 | } 84 | 85 | //GuiVisibility 86 | private bool _Visible; 87 | public Boolean GuiVisible 88 | { 89 | get { return _Visible; } 90 | set 91 | { 92 | _Visible = value; //Set the private variable 93 | } 94 | } 95 | 96 | public bool ShowHoverText 97 | { 98 | get { return showHoverText; } 99 | } 100 | 101 | private void GamePaused() 102 | { 103 | gamePaused = true; 104 | } 105 | 106 | private void GameUnPaused() 107 | { 108 | gamePaused = false; 109 | } 110 | 111 | private void onHideUI() 112 | { 113 | hideUI = true; 114 | } 115 | 116 | private void onShowUI() 117 | { 118 | hideUI = false; 119 | } 120 | /// 121 | /// Constructor for AppLauncherToolBar. You need to construct one of these for your Mod Menu/GUI environment. 122 | /// 123 | /// A string passed into ToolBar indicating the Name of the Mod 124 | /// A string passed into ToolBar to use for the Icon ToolTip 125 | /// A string in ToolBar expected format of the TexturePath for the ToolBarIcon 126 | /// ApplicationLauncher.AppScenes list - logically OR'd 127 | /// Texture reference for the AppLauncher ON Icon 128 | /// Texture reference for the AppLauncher OFF Icon 129 | /// A list of GameScenes use for ToolBar icon visiblity 130 | public AppLauncherToolBar(string toolBarName, string toolBarToolTip, string toolBarTexturePath, 131 | ApplicationLauncher.AppScenes VisibleinScenes, UnityEngine.Texture appbtnTexON, UnityEngine.Texture appbtnTexOFF, params GameScenes[] gameScenes) 132 | { 133 | Instance = this; 134 | if (ToolbarManager.ToolbarAvailable) 135 | { 136 | this.toolBarName = toolBarName; 137 | this.toolBarToolTip = toolBarToolTip; 138 | this.toolBarTexturePath = toolBarTexturePath; 139 | this.toolBarGameScenes = new GameScenesVisibility(gameScenes); 140 | } 141 | this.VisibleinScenes = VisibleinScenes; 142 | this.appbtnTexON = appbtnTexON; 143 | this.appbtnTexOFF = appbtnTexOFF; 144 | } 145 | 146 | private void OnGUIAppLauncherReady() 147 | { 148 | Utilities.Log_Debug("OnGUIAppLauncherReady"); 149 | if (ApplicationLauncher.Ready) 150 | { 151 | Utilities.Log_Debug("Adding AppLauncherButton"); 152 | stockToolbarButton = ApplicationLauncher.Instance.AddModApplication( 153 | onAppLaunchToggle, 154 | onAppLaunchToggle, 155 | onHoverOn, 156 | onHoverOff, 157 | DummyVoid, 158 | DummyVoid, 159 | VisibleinScenes, 160 | appbtnTexOFF); 161 | } 162 | } 163 | 164 | private void DummyVoid() 165 | { 166 | } 167 | 168 | private void onHoverOn() 169 | { 170 | showHoverText = true; 171 | } 172 | private void onHoverOff() 173 | { 174 | showHoverText = false; 175 | } 176 | 177 | public void onAppLaunchToggle() 178 | { 179 | GuiVisible = !GuiVisible; 180 | if (stockToolbarButton != null) 181 | { 182 | stockToolbarButton.SetTexture(GuiVisible ? appbtnTexON : appbtnTexOFF); 183 | } 184 | } 185 | 186 | private void DestroyToolBar() 187 | { 188 | if (ToolbarManager.ToolbarAvailable) 189 | { 190 | if (button1 != null) 191 | button1.Destroy(); 192 | } 193 | } 194 | 195 | private void CreateToolBar() 196 | { 197 | if (ToolbarManager.ToolbarAvailable) 198 | { 199 | button1 = ToolbarManager.Instance.add(toolBarName, "button1"); 200 | button1.TexturePath = toolBarTexturePath; 201 | button1.ToolTip = toolBarToolTip; 202 | button1.Visibility = toolBarGameScenes; 203 | button1.OnClick += e => GuiVisible = !GuiVisible; 204 | } 205 | } 206 | 207 | private void DestroyStockButton() 208 | { 209 | GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); 210 | if (stockToolbarButton != null) 211 | { 212 | ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton); 213 | stockToolbarButton = null; 214 | } 215 | } 216 | 217 | private void CreateStockButton() 218 | { 219 | Utilities.Log_Debug("Adding onGUIAppLauncher callbacks"); 220 | if (ApplicationLauncher.Ready) 221 | { 222 | if (stockToolbarButton == null) 223 | OnGUIAppLauncherReady(); 224 | } 225 | else 226 | GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); 227 | } 228 | 229 | private void OnGameSceneLoadRequestedForAppLauncher(GameScenes SceneToLoad) 230 | { 231 | if (stockToolbarButton != null) 232 | { 233 | ApplicationLauncherButton[] lstButtons = UnityEngine.Object.FindObjectsOfType(); 234 | Utilities.Log_Debug("TSTMenu AppLauncher: Destroying Button-Button Count:" + lstButtons.Length); 235 | ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton); 236 | stockToolbarButton = null; 237 | } 238 | } 239 | 240 | /// 241 | /// This Class is not using MonoBehaviour but has a Start Method that must be called. 242 | /// Call this in your Start Method for a Mod GUI/Menu Class. 243 | /// 244 | /// True if we are to use the Stock Applauncher, False to use ToolBar mod 245 | public void Start(bool stock) 246 | { 247 | DestroyToolBar(); 248 | if (ToolbarManager.ToolbarAvailable && !stock) 249 | { 250 | // Set up ToolBar button 251 | CreateToolBar(); 252 | usingToolbar = true; 253 | usingStock = false; 254 | } 255 | else 256 | { 257 | // Set up the stock toolbar 258 | CreateStockButton(); 259 | usingToolbar = false; 260 | usingStock = true; 261 | } 262 | GameEvents.onGameSceneLoadRequested.Add(OnGameSceneLoadRequestedForAppLauncher); 263 | GameEvents.onGamePause.Add(GamePaused); 264 | GameEvents.onGameUnpause.Add(GameUnPaused); 265 | GameEvents.onHideUI.Add(onHideUI); 266 | GameEvents.onShowUI.Add(onShowUI); 267 | } 268 | 269 | /// 270 | /// This Class is not using MonoBehaviour but has a Destroy Method that must be called. 271 | /// Call this in your OnDestroy Method for a Mod GUI/Menu Class. 272 | /// 273 | public void Destroy() 274 | { 275 | DestroyToolBar(); 276 | 277 | // Stock toolbar 278 | Utilities.Log_Debug("Removing onGUIAppLauncher callbacks"); 279 | 280 | DestroyStockButton(); 281 | 282 | if (GuiVisible) GuiVisible = !GuiVisible; 283 | GameEvents.onGameSceneLoadRequested.Remove(OnGameSceneLoadRequestedForAppLauncher); 284 | GameEvents.onGamePause.Remove(GamePaused); 285 | GameEvents.onGameUnpause.Remove(GameUnPaused); 286 | GameEvents.onHideUI.Remove(onHideUI); 287 | GameEvents.onShowUI.Remove(onShowUI); 288 | } 289 | 290 | /// 291 | /// Sets the ToolBar Icon visible or not. To be extended in future to not require calling from Mod. 292 | /// Currently it is because I haven't incorporated the mod's Setting for Whether the user wants to use Stock AppLauncher or Toolbar. 293 | /// 294 | /// True if set to visible, false will turn it off 295 | public void setToolBarBtnVisibility(bool visible) 296 | { 297 | button1.Visible = visible; 298 | } 299 | 300 | /// 301 | /// Sets the Applauncher Icon visible or not. To be extended in future to not require calling from Mod. 302 | /// Currently it is because I haven't incorporated the mod's Setting for Whether the user wants to use Stock AppLauncher or Toolbar. 303 | /// 304 | /// True if set to visible, false will turn it off 305 | public void setAppLSceneVisibility(ApplicationLauncher.AppScenes visibleinScenes) 306 | { 307 | VisibleinScenes = visibleinScenes; 308 | stockToolbarButton.VisibleInScenes = VisibleinScenes; 309 | } 310 | 311 | /// 312 | /// Call this to change from AppLauncher to Toobar or vice-versa. 313 | /// Will Destroy ToolBar or AppLauncher Icon and create a new one. 314 | /// 315 | /// True if using AppLauncher, False if using ToolBar 316 | public void chgAppIconStockToolBar(bool stock) 317 | { 318 | if (!stock && ToolbarManager.ToolbarAvailable) 319 | { 320 | DestroyStockButton(); 321 | DestroyToolBar(); 322 | CreateToolBar(); 323 | usingToolbar = true; 324 | usingStock = false; 325 | 326 | } 327 | else 328 | { 329 | DestroyToolBar(); 330 | DestroyStockButton(); 331 | CreateStockButton(); 332 | usingToolbar = false; 333 | usingStock = true; 334 | } 335 | } 336 | 337 | /// 338 | /// Change the ToolBar TexturePath - to say change the Icon 339 | /// 340 | /// string in ToolBar TexturePath format 341 | public void setToolBarTexturePath(string icontoSet) 342 | { 343 | button1.TexturePath = icontoSet; 344 | } 345 | 346 | /// 347 | /// Change the AppLauncher Icon Texture - to say change the Icon 348 | /// 349 | /// Texture to set Icon to 350 | public void setAppLauncherTexture(Texture icontoSet) 351 | { 352 | stockToolbarButton.SetTexture(icontoSet); 353 | } 354 | } 355 | } 356 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/LICENSE: -------------------------------------------------------------------------------- 1 | The Createive Commons Attribution-NonCommercial-ShareAlike 4.0 International license (CC BY-NC-SA 4.0) 2 | 3 | Copyright (c) 2015 JPLRepo 4 | 5 | You are free to: 6 | Share — copy and redistribute the material in any medium or format 7 | Adapt — remix, transform, and build upon the material 8 | The licensor cannot revoke these freedoms as long as you follow the license terms. 9 | 10 | Under the following terms: 11 | Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 12 | NonCommercial — You may not use the material for commercial purposes. 13 | ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. 14 | No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 15 | 16 | Notices: 17 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. 18 | No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. 19 | 20 | Human Readable license: https://creativecommons.org/licenses/by-nc-sa/4.0/ 21 | Legalcode: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode 22 | 23 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/README.md: -------------------------------------------------------------------------------- 1 | REPOSoftTech Utilities 2 | ====================== 3 | 4 | This is a collection of common software utilities used throughout my Kerbal Space Program mods. 5 | 6 | 7 | For support please refer to the KSP forum thread and raise an issue here on GitHub. 8 | 9 | License 10 | ========== 11 | These Utilities are licensed under a Creative Commons 4.0 Share-Alike Attribution Non-Commercial license. 12 | 13 | Mod Contributors: 14 | =========== 15 | JPLRepo - Plugin design and development, C# coding, Implementation and releases. 16 | 17 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/RectExtentions.cs: -------------------------------------------------------------------------------- 1 | // This program is free software: you can redistribute it and/or modify 2 | // it under the terms of the GNU General Public License as published by 3 | // the Free Software Foundation, either version 3 of the License, or 4 | // (at your option) any later version. 5 | // 6 | // This program is distributed in the hope that it will be useful, 7 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | // GNU General Public License for more details. 10 | // 11 | // You should have received a copy of the GNU General Public License 12 | // along with this program. If not, see . 13 | // 14 | using UnityEngine; 15 | 16 | namespace RSTUtils.Extensions 17 | { 18 | public static class RectExtensions 19 | { 20 | /// 21 | /// Clamps the rectangle inside the screen region. 22 | /// 23 | public static Rect ClampInsideScreen(this Rect value) 24 | { 25 | value.x = Mathf.Clamp(value.x, 0, Screen.width - value.width); 26 | value.y = Mathf.Clamp(value.y, 0, Screen.height - value.height); 27 | 28 | return value; 29 | } 30 | 31 | /// 32 | /// Clamps the rectangle into the screen region by the specified margin. 33 | /// 34 | public static Rect ClampToScreen(this Rect value, float margin = 25.0f) 35 | { 36 | value.x = Mathf.Clamp(value.x, -(value.width - margin), Screen.width - margin); 37 | value.y = Mathf.Clamp(value.y, -(value.height - margin), Screen.height - margin); 38 | 39 | return value; 40 | } 41 | 42 | /// 43 | /// Returns whether the mouse is within the coordinates of this rectangle. 44 | /// 45 | public static bool MouseIsOver(this Rect value) 46 | { 47 | return value.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)); 48 | } 49 | 50 | public static Rect Translate(this Rect value, Rect rectangle) 51 | { 52 | value.x += rectangle.x; 53 | value.y += rectangle.y; 54 | 55 | return value; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/Arg.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="false" hostspecific="false" language="C#" #> 2 | <#@ output extension=".cs" #> 3 | // This file is auto-generated from the Arg.tt T4 template. 4 | 5 | // The types here are used to forward arguments through to the string 6 | // formatter routine without introducing any copying of the argument 7 | // (if it's a value type) and preserving its statically known type via 8 | // the generic type parameters. 9 | 10 | // The switch statement in each Format() method looks ugly but gets 11 | // translated by the compiler into a nice direct jump table. 12 | 13 | using System.Runtime.CompilerServices; 14 | 15 | namespace System.Text.Formatting { 16 | /// 17 | /// A low-allocation version of the built-in type. 18 | /// 19 | partial class StringBuffer {<# for(int i = 1; i <= 8; i++) { 20 | var simpleName = "Arg" + i; 21 | var genericParams = " 28 | 29 | /// 30 | /// Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a single argument. 31 | /// 32 | /// A composite format string.<#for(int j = 0; j < i; j++) { 33 | #> 34 | 35 | /// A value to format.<#}#> 36 | public void AppendFormat<#=genericParams#>(string format, T0 arg0<#for(int j = 1; j < i; j++) { #>, T<#=j#> arg<#=j#><#}#>) { 37 | var args = new <#=fullName#>(__makeref(arg0)<#for(int j = 1; j < i; j++) { #>, __makeref(arg<#=j#>)<#}#>); 38 | AppendArgSet(format, ref args); 39 | } 40 | 41 | /// 42 | /// Converts the value of objects to strings based on the formats specified and inserts them into another string. 43 | /// 44 | /// A composite format string.<#for(int j = 0; j < i; j++) { 45 | #> 46 | 47 | /// A value to format.<#}#> 48 | public static string Format<#=genericParams#>(string format, T0 arg0<#for(int j = 1; j < i; j++) { #>, T<#=j#> arg<#=j#><#}#>) { 49 | var buffer = Acquire(format.Length + <#=i * 8#>); 50 | buffer.AppendFormat(format, arg0<#for(int j = 1; j < i; j++) { #>, arg<#=j#><#}#>); 51 | var result = buffer.ToString(); 52 | Release(buffer); 53 | return result; 54 | } 55 | <#}#> 56 | } 57 | <# for(int i = 1; i <= 8; i++) { 58 | var simpleName = "Arg" + i; 59 | var fullName = simpleName + " 65 | 66 | unsafe struct <#=fullName#> : IArgSet { 67 | <#for(int j = 0; j < i; j++) { #> IntPtr t<#=j#>; 68 | <#}#> 69 | 70 | public int Count => <#=i#>; 71 | 72 | public <#=simpleName#> (TypedReference t0<#for(int j = 1; j < i; j++) { #>, TypedReference t<#=j#><#}#>) { 73 | <#for(int j = 0; j < i; j++) { #> this.t<#=j#> = *(IntPtr*)&t<#=j#>; 74 | <#}#> 75 | } 76 | 77 | //[MethodImpl(MethodImplOptions.AggressiveInlining)] 78 | public void Format (StringBuffer buffer, int index, StringView format) { 79 | switch (index) { 80 | <#for(int j = 0; j < i; j++) { #> case <#=j#>: buffer.AppendGeneric>(t<#=j#>, format); break; 81 | <#}#> 82 | } 83 | } 84 | } 85 | <#}#>} -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/Culture.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace System.Text.Formatting { 4 | // caches formatting information from culture data 5 | // some of the accessors on NumberFormatInfo allocate copies of their data 6 | sealed class CachedCulture { 7 | public readonly CultureInfo Culture; 8 | 9 | public readonly NumberFormatData CurrencyData; 10 | public readonly NumberFormatData FixedData; 11 | public readonly NumberFormatData NumberData; 12 | public readonly NumberFormatData ScientificData; 13 | public readonly NumberFormatData PercentData; 14 | 15 | public readonly string CurrencyNegativePattern; 16 | public readonly string CurrencyPositivePattern; 17 | public readonly string CurrencySymbol; 18 | 19 | public readonly string NumberNegativePattern; 20 | public readonly string NumberPositivePattern; 21 | 22 | public readonly string PercentNegativePattern; 23 | public readonly string PercentPositivePattern; 24 | public readonly string PercentSymbol; 25 | 26 | public readonly string NegativeSign; 27 | public readonly string PositiveSign; 28 | 29 | public readonly string NaN; 30 | public readonly string PositiveInfinity; 31 | public readonly string NegativeInfinity; 32 | 33 | public readonly int DecimalBufferSize; 34 | 35 | public CachedCulture (CultureInfo culture) { 36 | Culture = culture; 37 | 38 | var info = culture.NumberFormat; 39 | CurrencyData = new NumberFormatData( 40 | info.CurrencyDecimalDigits, 41 | info.NegativeSign, 42 | info.CurrencyDecimalSeparator, 43 | info.CurrencyGroupSeparator, 44 | info.CurrencyGroupSizes, 45 | info.CurrencySymbol.Length 46 | ); 47 | 48 | FixedData = new NumberFormatData( 49 | info.NumberDecimalDigits, 50 | info.NegativeSign, 51 | info.NumberDecimalSeparator, 52 | null, 53 | null, 54 | 0 55 | ); 56 | 57 | NumberData = new NumberFormatData( 58 | info.NumberDecimalDigits, 59 | info.NegativeSign, 60 | info.NumberDecimalSeparator, 61 | info.NumberGroupSeparator, 62 | info.NumberGroupSizes, 63 | 0 64 | ); 65 | 66 | ScientificData = new NumberFormatData( 67 | 6, 68 | info.NegativeSign, 69 | info.NumberDecimalSeparator, 70 | null, 71 | null, 72 | info.NegativeSign.Length + info.PositiveSign.Length * 2 // for number and exponent 73 | ); 74 | 75 | PercentData = new NumberFormatData( 76 | info.PercentDecimalDigits, 77 | info.NegativeSign, 78 | info.PercentDecimalSeparator, 79 | info.PercentGroupSeparator, 80 | info.PercentGroupSizes, 81 | info.PercentSymbol.Length 82 | ); 83 | 84 | CurrencyNegativePattern = NegativeCurrencyFormats[info.CurrencyNegativePattern]; 85 | CurrencyPositivePattern = PositiveCurrencyFormats[info.CurrencyPositivePattern]; 86 | CurrencySymbol = info.CurrencySymbol; 87 | NumberNegativePattern = NegativeNumberFormats[info.NumberNegativePattern]; 88 | NumberPositivePattern = PositiveNumberFormat; 89 | PercentNegativePattern = NegativePercentFormats[info.PercentNegativePattern]; 90 | PercentPositivePattern = PositivePercentFormats[info.PercentPositivePattern]; 91 | PercentSymbol = info.PercentSymbol; 92 | NegativeSign = info.NegativeSign; 93 | PositiveSign = info.PositiveSign; 94 | NaN = info.NaNSymbol; 95 | PositiveInfinity = info.PositiveInfinitySymbol; 96 | NegativeInfinity = info.NegativeInfinitySymbol; 97 | DecimalBufferSize = 98 | NumberFormatData.MinBufferSize + 99 | info.NumberDecimalSeparator.Length + 100 | (NegativeSign.Length + PositiveSign.Length) * 2; 101 | } 102 | 103 | static readonly string[] PositiveCurrencyFormats = { 104 | "$#", "#$", "$ #", "# $" 105 | }; 106 | 107 | static readonly string[] NegativeCurrencyFormats = { 108 | "($#)", "-$#", "$-#", "$#-", 109 | "(#$)", "-#$", "#-$", "#$-", 110 | "-# $", "-$ #", "# $-", "$ #-", 111 | "$ -#", "#- $", "($ #)", "(# $)" 112 | }; 113 | 114 | static readonly string[] PositivePercentFormats = { 115 | "# %", "#%", "%#", "% #" 116 | }; 117 | 118 | static readonly string[] NegativePercentFormats = { 119 | "-# %", "-#%", "-%#", 120 | "%-#", "%#-", 121 | "#-%", "#%-", 122 | "-% #", "# %-", "% #-", 123 | "% -#", "#- %" 124 | }; 125 | 126 | static readonly string[] NegativeNumberFormats = { 127 | "(#)", "-#", "- #", "#-", "# -", 128 | }; 129 | 130 | static readonly string PositiveNumberFormat = "#"; 131 | } 132 | 133 | // contains format information for a specific kind of format string 134 | // e.g. (fixed, number, currency) 135 | sealed class NumberFormatData { 136 | readonly int bufferLength; 137 | readonly int perDigitLength; 138 | 139 | public readonly int DecimalDigits; 140 | public readonly string NegativeSign; 141 | public readonly string DecimalSeparator; 142 | public readonly string GroupSeparator; 143 | public readonly int[] GroupSizes; 144 | 145 | public NumberFormatData (int decimalDigits, string negativeSign, string decimalSeparator, string groupSeparator, int[] groupSizes, int extra) { 146 | DecimalDigits = decimalDigits; 147 | NegativeSign = negativeSign; 148 | DecimalSeparator = decimalSeparator; 149 | GroupSeparator = groupSeparator; 150 | GroupSizes = groupSizes; 151 | 152 | bufferLength = MinBufferSize; 153 | bufferLength += NegativeSign.Length; 154 | bufferLength += DecimalSeparator.Length; 155 | bufferLength += extra; 156 | 157 | if (GroupSeparator != null) 158 | perDigitLength = GroupSeparator.Length; 159 | } 160 | 161 | public int GetBufferSize (ref int maxDigits, int scale) { 162 | if (maxDigits < 0) 163 | maxDigits = DecimalDigits; 164 | 165 | var digitCount = scale >= 0 ? scale + maxDigits : 0; 166 | long len = bufferLength; 167 | 168 | // calculate buffer size 169 | len += digitCount; 170 | len += perDigitLength * digitCount; 171 | return checked((int)len); 172 | } 173 | 174 | internal const int MinBufferSize = 105; 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/CustomNumeric.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace System.Text.Formatting { 3 | // this file contains the custom numeric formatting routines split out from the Numeric.cs file 4 | partial class Numeric { 5 | static void NumberToCustomFormatString (StringBuffer formatter, ref Number number, StringView specifier, CachedCulture culture) { 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("StringFormatter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("StringFormatter")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8a0ef787-605f-44ba-ae5c-d616451f8724")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/SR.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace System.Text.Formatting { 3 | // currently just contains some hardcoded exception messages 4 | static class SR { 5 | public const string InvalidGroupSizes = "Invalid group sizes in NumberFormatInfo."; 6 | public const string UnknownFormatSpecifier = "Unknown format specifier '{0}'."; 7 | public const string ArgIndexOutOfRange = "No format argument exists for index '{0}'."; 8 | public const string TypeNotFormattable = "Type '{0}' is not a built-in type, does not implement IStringFormattable, and no custom formatter was found for it."; 9 | public const string InvalidFormatString = "Invalid format string."; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/StringFormatter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8A0EF787-605F-44BA-AE5C-D616451F8724} 8 | Library 9 | Properties 10 | System.Text.Formatting 11 | StringFormatter 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | true 34 | bin\Release\StringFormatter.XML 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | True 43 | True 44 | Arg.tt 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | TextTemplatingFileGenerator 57 | Arg.cs 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | -------------------------------------------------------------------------------- /REPOSoftTechUtils/StringFormatter/StringView.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace System.Text.Formatting { 3 | // TODO: clean this up 4 | public unsafe struct StringView { 5 | public static readonly StringView Empty = new StringView(); 6 | 7 | public readonly char* Data; 8 | public readonly int Length; 9 | 10 | public bool IsEmpty { 11 | get { return Length == 0; } 12 | } 13 | 14 | public StringView (char* data, int length) { 15 | Data = data; 16 | Length = length; 17 | } 18 | 19 | public static bool operator ==(StringView lhs, string rhs) { 20 | var count = lhs.Length; 21 | if (count != rhs.Length) 22 | return false; 23 | 24 | fixed (char* r = rhs) 25 | { 26 | var lhsPtr = lhs.Data; 27 | var rhsPtr = r; 28 | for (int i = 0; i < count; i++) { 29 | if (*lhsPtr++ != *rhsPtr++) 30 | return false; 31 | } 32 | } 33 | 34 | return true; 35 | } 36 | 37 | public static bool operator !=(StringView lhs, string rhs) { 38 | return !(lhs == rhs); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TarsierSpaceTech", "TarsierSpaceTech\TarsierSpaceTech.csproj", "{65838CDB-28B2-408C-BC76-A927B67378DC}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {65838CDB-28B2-408C-BC76-A927B67378DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {65838CDB-28B2-408C-BC76-A927B67378DC}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {65838CDB-28B2-408C-BC76-A927B67378DC}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {65838CDB-28B2-408C-BC76-A927B67378DC}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/AppLauncherToolBarExtension.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * AppLauncherToolBar.cs 3 | * (C) Copyright 2016, Jamie Leighton (JPLRepo) 4 | * REPOSoft Technologies 5 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 6 | * project is in no way associated with nor endorsed by Squad. 7 | * 8 | * This file is part of RST Utils. My attempt at creating my own KSP Mod base Architecture. 9 | * 10 | * RST Utils is free software: you can redistribute it and/or modify 11 | * it under the terms of the MIT License 12 | * 13 | * RST Utils is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | * You should have received a copy of the MIT License 18 | * along with RST Utils. If not, see . 19 | * 20 | */ 21 | using System; 22 | using KSP.UI.Screens; 23 | 24 | namespace RSTUtils 25 | { 26 | public class AppLauncherToolBar 27 | { 28 | public static AppLauncherToolBar Instance { get; private set; } 29 | 30 | private IButton button1; //ToolBar button 31 | private string toolBarName; //set to Name for button on ToolBar (modname) 32 | private string toolBarToolTip; // set tooltip for ToolBar button 33 | private string toolBarTexturePath; //The TooBar formatted Texture Path 34 | private GameScenesVisibility toolBarGameScenes; //GameScenes toolbar button can be seen in 35 | 36 | private ApplicationLauncherButton stockToolbarButton; // Stock Toolbar Button 37 | private ApplicationLauncher.AppScenes VisibleinScenes; //What scenes is the applauncher button seen in 38 | private UnityEngine.Texture appbtnTexON; //Texture for AppLauncher button when ON 39 | private UnityEngine.Texture appbtnTexOFF; //Texture for AppLauncher button when OFF 40 | 41 | private bool _gamePaused; 42 | public Boolean gamePaused 43 | { 44 | get { return _gamePaused; } 45 | private set 46 | { 47 | _gamePaused = value; //Set the private variable 48 | } 49 | } 50 | 51 | private bool _hideUI; 52 | public Boolean hideUI 53 | { 54 | get { return _hideUI; } 55 | private set 56 | { 57 | _hideUI = value; //Set the private variable 58 | } 59 | } 60 | 61 | //GuiVisibility 62 | private bool _Visible; 63 | public Boolean GuiVisible 64 | { 65 | get { return _Visible; } 66 | set 67 | { 68 | _Visible = value; //Set the private variable 69 | } 70 | } 71 | 72 | private void GamePaused() 73 | { 74 | gamePaused = true; 75 | } 76 | 77 | private void GameUnPaused() 78 | { 79 | gamePaused = false; 80 | } 81 | 82 | private void onHideUI() 83 | { 84 | hideUI = true; 85 | } 86 | 87 | private void onShowUI() 88 | { 89 | hideUI = false; 90 | } 91 | /// 92 | /// Constructor for AppLauncherToolBar. You need to construct one of these for your Mod Menu/GUI environment. 93 | /// 94 | /// A string passed into ToolBar indicating the Name of the Mod 95 | /// A string passed into ToolBar to use for the Icon ToolTip 96 | /// A string in ToolBar expected format of the TexturePath for the ToolBarIcon 97 | /// ApplicationLauncher.AppScenes list - logically OR'd 98 | /// Texture reference for the AppLauncher ON Icon 99 | /// Texture reference for the AppLauncher OFF Icon 100 | /// A list of GameScenes use for ToolBar icon visiblity 101 | public AppLauncherToolBar(string toolBarName, string toolBarToolTip, string toolBarTexturePath, 102 | ApplicationLauncher.AppScenes VisibleinScenes, UnityEngine.Texture appbtnTexON, UnityEngine.Texture appbtnTexOFF, params GameScenes[] gameScenes) 103 | { 104 | Instance = this; 105 | if (ToolbarManager.ToolbarAvailable) 106 | { 107 | this.toolBarName = toolBarName; 108 | this.toolBarToolTip = toolBarToolTip; 109 | this.toolBarTexturePath = toolBarTexturePath; 110 | this.toolBarGameScenes = new GameScenesVisibility(gameScenes); 111 | } 112 | this.VisibleinScenes = VisibleinScenes; 113 | this.appbtnTexON = appbtnTexON; 114 | this.appbtnTexOFF = appbtnTexOFF; 115 | } 116 | 117 | private void OnGUIAppLauncherReady() 118 | { 119 | Utilities.Log_Debug("OnGUIAppLauncherReady"); 120 | if (ApplicationLauncher.Ready) 121 | { 122 | Utilities.Log_Debug("Adding AppLauncherButton"); 123 | stockToolbarButton = ApplicationLauncher.Instance.AddModApplication( 124 | onAppLaunchToggle, 125 | onAppLaunchToggle, 126 | DummyVoid, 127 | DummyVoid, 128 | DummyVoid, 129 | DummyVoid, 130 | VisibleinScenes, 131 | appbtnTexOFF); 132 | } 133 | } 134 | 135 | private void DummyVoid() 136 | { 137 | } 138 | 139 | public void onAppLaunchToggle() 140 | { 141 | GuiVisible = !GuiVisible; 142 | if (stockToolbarButton != null) 143 | { 144 | stockToolbarButton.SetTexture(GuiVisible ? appbtnTexON : appbtnTexOFF); 145 | } 146 | } 147 | 148 | private void DestroyToolBar() 149 | { 150 | if (ToolbarManager.ToolbarAvailable) 151 | { 152 | if (button1 != null) 153 | button1.Destroy(); 154 | } 155 | } 156 | 157 | private void CreateToolBar() 158 | { 159 | if (ToolbarManager.ToolbarAvailable) 160 | { 161 | button1 = ToolbarManager.Instance.add(toolBarName, "button1"); 162 | button1.TexturePath = toolBarTexturePath; 163 | button1.ToolTip = toolBarToolTip; 164 | button1.Visibility = toolBarGameScenes; 165 | button1.OnClick += e => GuiVisible = !GuiVisible; 166 | } 167 | } 168 | 169 | private void DestroyStockButton() 170 | { 171 | GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); 172 | if (stockToolbarButton != null) 173 | { 174 | ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton); 175 | stockToolbarButton = null; 176 | } 177 | } 178 | 179 | private void CreateStockButton() 180 | { 181 | Utilities.Log_Debug("Adding onGUIAppLauncher callbacks"); 182 | if (ApplicationLauncher.Ready) 183 | { 184 | if (stockToolbarButton == null) 185 | OnGUIAppLauncherReady(); 186 | } 187 | else 188 | GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); 189 | } 190 | 191 | private void OnGameSceneLoadRequestedForAppLauncher(GameScenes SceneToLoad) 192 | { 193 | if (stockToolbarButton != null) 194 | { 195 | ApplicationLauncherButton[] lstButtons = UnityEngine.Object.FindObjectsOfType(); 196 | Utilities.Log_Debug("TSTMenu AppLauncher: Destroying Button-Button Count:" + lstButtons.Length); 197 | ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton); 198 | stockToolbarButton = null; 199 | } 200 | } 201 | 202 | /// 203 | /// This Class is not using MonoBehaviour but has a Start Method that must be called. 204 | /// Call this in your Start Method for a Mod GUI/Menu Class. 205 | /// 206 | /// True if we are to use the Stock Applauncher, False to use ToolBar mod 207 | public void Start(bool stock) 208 | { 209 | DestroyToolBar(); 210 | if (ToolbarManager.ToolbarAvailable && !stock) 211 | { 212 | // Set up ToolBar button 213 | CreateToolBar(); 214 | } 215 | else 216 | { 217 | // Set up the stock toolbar 218 | CreateStockButton(); 219 | } 220 | GameEvents.onGameSceneLoadRequested.Add(OnGameSceneLoadRequestedForAppLauncher); 221 | GameEvents.onGamePause.Add(GamePaused); 222 | GameEvents.onGameUnpause.Add(GameUnPaused); 223 | GameEvents.onHideUI.Add(onHideUI); 224 | GameEvents.onShowUI.Add(onShowUI); 225 | } 226 | 227 | /// 228 | /// This Class is not using MonoBehaviour but has a Destroy Method that must be called. 229 | /// Call this in your OnDestroy Method for a Mod GUI/Menu Class. 230 | /// 231 | public void Destroy() 232 | { 233 | DestroyToolBar(); 234 | 235 | // Stock toolbar 236 | Utilities.Log_Debug("Removing onGUIAppLauncher callbacks"); 237 | 238 | DestroyStockButton(); 239 | 240 | if (GuiVisible) GuiVisible = !GuiVisible; 241 | GameEvents.onGameSceneLoadRequested.Remove(OnGameSceneLoadRequestedForAppLauncher); 242 | GameEvents.onGamePause.Remove(GamePaused); 243 | GameEvents.onGameUnpause.Remove(GameUnPaused); 244 | GameEvents.onHideUI.Remove(onHideUI); 245 | GameEvents.onShowUI.Remove(onShowUI); 246 | } 247 | 248 | /// 249 | /// Sets the ToolBar Icon visible or not. To be extended in future to not require calling from Mod. 250 | /// Currently it is because I haven't incorporated the mod's Setting for Whether the user wants to use Stock AppLauncher or Toolbar. 251 | /// 252 | /// True if set to visible, false will turn it off 253 | public void setToolBarBtnVisibility(bool visible) 254 | { 255 | button1.Visible = visible; 256 | } 257 | 258 | /// 259 | /// Sets the Applauncher Icon visible or not. To be extended in future to not require calling from Mod. 260 | /// Currently it is because I haven't incorporated the mod's Setting for Whether the user wants to use Stock AppLauncher or Toolbar. 261 | /// 262 | /// True if set to visible, false will turn it off 263 | public void setAppLSceneVisibility(ApplicationLauncher.AppScenes visibleinScenes) 264 | { 265 | VisibleinScenes = visibleinScenes; 266 | stockToolbarButton.VisibleInScenes = VisibleinScenes; 267 | } 268 | 269 | /// 270 | /// Call this to change from AppLauncher to Toobar or vice-versa. 271 | /// Will Destroy ToolBar or AppLauncher Icon and create a new one. 272 | /// 273 | /// True if using AppLauncher, False if using ToolBar 274 | public void chgAppIconStockToolBar(bool stock) 275 | { 276 | if (!stock && ToolbarManager.ToolbarAvailable) 277 | { 278 | DestroyStockButton(); 279 | DestroyToolBar(); 280 | CreateToolBar(); 281 | } 282 | else 283 | { 284 | DestroyToolBar(); 285 | DestroyStockButton(); 286 | CreateStockButton(); 287 | } 288 | 289 | } 290 | } 291 | } 292 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/README.md: -------------------------------------------------------------------------------- 1 | ModuleManager 2 | ============= 3 | 4 | 5 | Original (c) from Ialdabaoth ( https://github.com/Ialdabaoth ) 6 | 7 | Modified by // Modifications by // Maintained by sarbian ( https://github.com/sarbian ) 8 | 9 | 10 | The original licence requirement was: 11 | 12 | --- 13 | 14 | under a CC share-alike license. Anyone is free to do anything they like with ModuleManager's source, with two caveats: 15 | 16 | 1. You credit me as the original creator that your code is based on 17 | 2. You make it ABSOLUTELY CLEAR that your code is not the original ModuleManager, and that any problems that people have with your fork should be taken up with YOU, not me. 18 | 19 | --- 20 | 21 | 22 | THIS IS NOT THE ORIGINAL MODULEMANAGER CODE. 23 | 24 | Do not bother Ialdabaoth about any problems with it. 25 | 26 | ## Dependencies 27 | 28 | - mono resgen2 29 | - Fedora: `sudo dnf install mono-devel` 30 | - Mono C# Compiler 31 | - Fedora: `sudo ln -s /usr/bin/mcs /usr/bin/gmcs` 32 | 33 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Agencies/Agents.cfg: -------------------------------------------------------------------------------- 1 | AGENT 2 | { 3 | name = Tarsier Space Technology 4 | title = #autoLOC_TST_0236 //Tarsier Space Technology 5 | description = #autoLOC_TST_0220 //Experts in the field of space science equipment, Tarsier Space Technology are building some of the most advanced components around but come with a hefty price tag. 6 | 7 | logoURL = TarsierSpaceTech/Agencies/TarsierSpaceTechnology 8 | logoScaledURL = TarsierSpaceTech/Agencies/TarsierSpaceTechnology_scaled 9 | 10 | mentality = Scientific 11 | mentality = Pioneer 12 | mentality = Commercial 0.4 13 | mentality = Stern 0.25 14 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Agencies/TarsierSpaceTechnology.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Agencies/TarsierSpaceTechnology.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Agencies/TarsierSpaceTechnology_scaled.truecolor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Agencies/TarsierSpaceTechnology_scaled.truecolor -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/DmagicOrbitalScienceScopes.cfg.optional: -------------------------------------------------------------------------------- 1 | @PART[dmReconLarge]:FOR[TarsierSpaceTech]:NEEDS[DMagic] 2 | { 3 | @MODULE[DMReconScope] 4 | { 5 | @openDoorsOnly = true 6 | } 7 | MODULE 8 | { 9 | name = TSTSpaceTelescope 10 | maxZoom = 6 11 | xmitDataScalar = 0.5 12 | labBoostScalar = 1.2 13 | baseTransformName = Base 14 | cameraTransformName = camera.forward.000 15 | lookTransformName = Aperture 16 | overrideModuleName = DMReconScope 17 | overrideEventNameOpen = openDoors 18 | overrideEventNameClose = closeDoors 19 | disableModuleName = DMReconScope 20 | disableEventName = toggleEvent 21 | } 22 | MODULE 23 | { 24 | name = TSTGyroReactionWheel 25 | PitchTorque = 5 26 | YawTorque = 5 27 | RollTorque = 5 28 | powerscale = 0.1 29 | sensitivity = 0.002 30 | 31 | RESOURCE 32 | { 33 | name = ElectricCharge 34 | rate = 1 35 | } 36 | } 37 | } 38 | 39 | @PART[dmReconSmall]:FOR[TarsierSpaceTech]:NEEDS[DMagic] 40 | { 41 | @MODULE[DMReconScope] 42 | { 43 | @openDoorsOnly = true 44 | } 45 | MODULE 46 | { 47 | name = TSTSpaceTelescope 48 | maxZoom = 4 49 | xmitDataScalar = 0.5 50 | labBoostScalar = 1.2 51 | baseTransformName = Base 52 | cameraTransformName = camera.forward.000 53 | lookTransformName = Aperture 54 | overrideModuleName = DMReconScope 55 | overrideEventNameOpen = openDoors 56 | overrideEventNameClose = closeDoors 57 | disableModuleName = DMReconScope 58 | disableEventName = toggleEvent 59 | } 60 | MODULE 61 | { 62 | name = TSTGyroReactionWheel 63 | PitchTorque = 5 64 | YawTorque = 5 65 | RollTorque = 5 66 | powerscale = 0.2 67 | sensitivity = 0.05 68 | 69 | RESOURCE 70 | { 71 | name = ElectricCharge 72 | rate = 1 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Flags/Tarsier Space Technology.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Flags/Tarsier Space Technology.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxies.cfg: -------------------------------------------------------------------------------- 1 | GALAXY 2 | { 3 | name = Galaxy1 4 | displayName = #autoLOC_TST_0001 //Twin Clouds 5 | textureURL = TarsierSpaceTech/Galaxies/galaxy1 6 | location = 0.85696, -0.77464, -0.22952 7 | size = 10 8 | } 9 | GALAXY 10 | { 11 | name = Galaxy2 12 | displayName = #autoLOC_TST_0002 //Big Plate Galaxy 13 | textureURL = TarsierSpaceTech/Galaxies/galaxy2 14 | location = -0.50454, -0.13956, -0.99025 15 | size = 12 16 | } 17 | GALAXY 18 | { 19 | name = Galaxy3 20 | displayName = #autoLOC_TST_0003 //The Roundabout 21 | textureURL = TarsierSpaceTech/Galaxies/galaxy3 22 | location = 0.67248, 0.031668, -0.644117 23 | size = 15 24 | } 25 | GALAXY 26 | { 27 | name = Galaxy4 28 | displayName = #autoLOC_TST_0004 //The Purple Donkey Nebula 29 | textureURL = TarsierSpaceTech/Galaxies/galaxy4 30 | location = -0.15908, -0.86295, 0.37152 31 | size = 18 32 | } 33 | GALAXY 34 | { 35 | name = Galaxy5 36 | displayName = #autoLOC_TST_0005 //The Big Pop 37 | textureURL = TarsierSpaceTech/Galaxies/galaxy5 38 | location = -0.4057026, -0.55695, 0.123896 39 | size = 2 40 | } 41 | GALAXY 42 | { 43 | name = Galaxy6 44 | displayName = #autoLOC_TST_0006 //The Great Plug Hole 45 | textureURL = TarsierSpaceTech/Galaxies/galaxy6 46 | location = 0.767182995, 0.742178, -0.310394 47 | size = 6.5 48 | } 49 | GALAXY 50 | { 51 | name = Galaxy7 52 | displayName = #autoLOC_TST_0007 //The Fingerprint Galaxy 53 | textureURL = TarsierSpaceTech/Galaxies/galaxy7 54 | location = 0.125135, 0.372324, -0.08718506 55 | size = 17 56 | } 57 | GALAXY 58 | { 59 | name = Galaxy8 60 | displayName = #autoLOC_TST_0008 //Strawberries and Cream Cloud 61 | textureURL = TarsierSpaceTech/Galaxies/galaxy8 62 | location = 0.848314, -0.4493518, 0.4242199 63 | size = 4 64 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy1.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy1.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy2.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy2.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy3.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy3.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy4.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy4.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy5.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy5.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy6.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy6.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy7.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy7.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy8.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Galaxies/galaxy8.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTIconOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTIconOff.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTIconOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTIconOn.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTToolTipBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTToolTipBox.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTbtnRedCross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTbtnRedCross.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTbtnResize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/TSTbtnResize.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/ToolbarIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Icons/ToolbarIcon.png -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/KSPedia/tarsierspacetech.ksp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/KSPedia/tarsierspacetech.ksp -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/KopernicusOnDemandOff.cfg.optional: -------------------------------------------------------------------------------- 1 | @Kopernicus:FINAL 2 | { 3 | %useOnDemand = false 4 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2013 tobyb121 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 13 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 15 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 16 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/AdvSpaceTelescope/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/AdvSpaceTelescope/model.mu -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/AdvSpaceTelescope/part.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = tarsierAdvSpaceTelescope 4 | module = Part 5 | author = TarsierTech 6 | 7 | mesh = model.mu 8 | rescaleFactor = 1 9 | 10 | node_attach = 0.0, 0, 0, 0.0, -1.0, 0.0 11 | node_stack_bottom01 = 0.0, 0, 0, 0.0, -1.0, 0.0 12 | 13 | TechRequired = advScienceTech 14 | entryCost = 20000 15 | cost = 25000 16 | category = Science 17 | subcategory = 0 18 | title = #autoLOC_TST_0221 //Deep Space Telescope 19 | manufacturer = #autoLOC_TST_0236 //Tarsier Space Technology 20 | description = #autoLOC_TST_0222 //The pinnacle of Kerbal technology, capable of peering into the deepest parts of the Kerbol system. Instructions not included. 21 | 22 | attachRules = 1,0,1,0,0 23 | 24 | // --- standard part parameters --- 25 | mass = 1.25 26 | dragModelType = default 27 | maximum_drag = 0.2 28 | minimum_drag = 0.2 29 | angularDrag = 1 30 | crashTolerance = 8 31 | maxTemp = 1200 // = 2900 32 | PhysicsSignificance = 0 33 | bulkheadProfiles = srf 34 | tags = #autoLOC_TST_0223 //tarsier tst advanced telescope science 35 | 36 | MODULE 37 | { 38 | name = TSTSpaceTelescope 39 | maxZoom = 6 40 | xmitDataScalar = 0.5 41 | labBoostScalar = 1.2 42 | } 43 | 44 | MODULE 45 | { 46 | name = FlagDecal 47 | textureQuadName = flag 48 | } 49 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/AdvSpaceTelescope/texture001.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/AdvSpaceTelescope/texture001.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ChemCam/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ChemCam/model.mu -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ChemCam/part.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = tarsierChemCam 4 | module = Part 5 | author = TarsierTech 6 | 7 | mesh = model.mu 8 | rescaleFactor = 1 9 | 10 | node_attach = 0.0, 0, 0, 0.0, 0.0, -1.0 11 | 12 | TechRequired = fieldScience 13 | entryCost = 7000 14 | cost = 7000 15 | category = Science 16 | subcategory = 0 17 | title = #autoLOC_TST_0053 //ChemCam 18 | manufacturer = #autoLOC_TST_0236 //Tarsier Space Technology 19 | description = #autoLOC_TST_0224 //The ChemCam fires high powered lasers at rocks and works out what they're made of from the colour of the flame. Kerbal scientists came up with the idea while ritualistically burning office furniture and noticing the different colours it gave off. 20 | 21 | attachRules = 1,1,0,0,1 22 | 23 | // --- standard part parameters --- 24 | mass = 0.05 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 1 29 | crashTolerance = 8 30 | maxTemp = 1200 // = 2900 31 | PhysicsSignificance = 0 32 | bulkheadProfiles = srf 33 | tags = #autoLOC_TST_0225 //tarsier tst advanced science chemcam rovercam camera 34 | 35 | MODULE 36 | { 37 | name = TSTChemCam 38 | experimentID = TarsierSpaceTech.ChemCam 39 | xmitDataScalar = 0.5 40 | labBoostScalar = 1.2 41 | } 42 | 43 | MODULE 44 | { 45 | name = FlagDecal 46 | textureQuadName = flag 47 | } 48 | 49 | MODULE 50 | { 51 | name = ModuleCargoPart 52 | stackableQuantity = 1 53 | packedVolume = 2 54 | } 55 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ChemCam/texture.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ChemCam/texture.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model.mu -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model000.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model000.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model001.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/model001.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDrive/part.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = scienceHardDrive 4 | module = Part 5 | author = TarsierTech 6 | 7 | mesh = model.mu 8 | rescaleFactor = 1 9 | 10 | node_attach = 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 11 | 12 | TechRequired = precisionEngineering 13 | entryCost = 2200 14 | cost = 900 15 | category = Science 16 | subcategory = 0 17 | title = #autoLOC_TST_0226 //Science Storage Device (Small) 18 | manufacturer = #autoLOC_TST_0236 //Tarsier Space Technology 19 | description = #autoLOC_TST_0227 //A small hard drive, great for storing science data but unfortunately prone to data corruption. Can be attached and removed in EVA using KIS/KAS. 20 | attachRules = 0,1,0,0,1 21 | 22 | // --- standard part parameters --- 23 | mass = 0.1 24 | dragModelType = default 25 | maximum_drag = 0.2 26 | minimum_drag = 0.2 27 | angularDrag = 1 28 | crashTolerance = 8 29 | maxTemp = 1200 // = 2900 30 | PhysicsSignificance = 0 31 | bulkheadProfiles = srf 32 | tags = #autoLOC_TST_0228 //tarsier tst advanced science sdd harddrive disk storage 33 | 34 | MODULE 35 | { 36 | name = TSTScienceHardDrive 37 | Capacity = 120 38 | corruption = 0.3 39 | powerUsage = 0.5 40 | fillFromEVA = true 41 | EVARange = 1.2 42 | } 43 | 44 | MODULE 45 | { 46 | name = ModuleCargoPart 47 | stackableQuantity = 4 48 | packedVolume = 5 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model.mu -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model010.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model010.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model011.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/model011.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/ScienceHardDriveLarge/part.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = scienceHardDriveLarge 4 | module = Part 5 | author = TarsierTech 6 | 7 | mesh = model.mu 8 | rescaleFactor = 1.25 9 | 10 | // --- node definitions --- 11 | node_stack_top = 0.0, 0.24, 0.0, 0.0, 1.0, 0.0 12 | node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0 13 | 14 | node_attach = 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 15 | 16 | TechRequired = electronics 17 | entryCost = 5000 18 | cost = 1800 19 | category = Science 20 | subcategory = 0 21 | title = #autoLOC_TST_0229 //Science Storage Device (Large) 22 | manufacturer = #autoLOC_TST_0236 //Tarsier Space Technology 23 | description = #autoLOC_TST_0230 //A larger hard drive, made by connecting 4 smaller ones together. They have less data corruption, but it has a higher power usage. 24 | attachRules = 1,0,1,1,0 25 | 26 | // --- standard part parameters --- 27 | mass = 0.5 28 | dragModelType = default 29 | maximum_drag = 0.2 30 | minimum_drag = 0.2 31 | angularDrag = 1 32 | crashTolerance = 8 33 | maxTemp = 1200 // = 2900 34 | PhysicsSignificance = 0 35 | bulkheadProfiles = srf 36 | tags = #autoLOC_TST_0228 //tarsier tst advanced science sdd harddrive disk storage 37 | 38 | MODULE 39 | { 40 | name = TSTScienceHardDrive 41 | Capacity = 480 42 | corruption = 0.1 43 | powerUsage = 1.0 44 | fillFromEVA = true 45 | EVARange = 1.2 46 | } 47 | MODULE 48 | { 49 | name = ModuleCargoPart 50 | stackableQuantity = 1 51 | packedVolume = 300 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/SpaceTelescope/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/SpaceTelescope/model.mu -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/SpaceTelescope/part.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = tarsierSpaceTelescope 4 | module = Part 5 | author = TarsierTech 6 | 7 | mesh = model.mu 8 | rescaleFactor = 1 9 | 10 | node_attach = 0.0, -0.127145, -0.1118595, 0.0, -1.0, 0.0 11 | node_stack_bottom = 0.0, -0.127145, -0.1118595, 0.0, -1.0, 0.0 12 | 13 | TechRequired = scienceTech 14 | entryCost = 10000 15 | cost = 10000 16 | category = Science 17 | subcategory = 0 18 | title = #autoLOC_TST_0058 //Space Telescope 19 | manufacturer = #autoLOC_TST_0236 //Tarsier Space Technology 20 | description = #autoLOC_TST_0232 //The pinnacle of Kerbal technology, capable of peering into the deepest parts of the Kerbol system. Instructions not included. 21 | 22 | attachRules = 1,1,0,0,1 23 | 24 | // --- standard part parameters --- 25 | mass = 0.25 26 | dragModelType = default 27 | maximum_drag = 0.2 28 | minimum_drag = 0.2 29 | angularDrag = 1 30 | crashTolerance = 8 31 | maxTemp = 1200 // = 2900 32 | PhysicsSignificance = 0 33 | bulkheadProfiles = srf 34 | tags = #autoLOC_TST_0223 //tarsier tst advanced telescope science 35 | 36 | MODULE 37 | { 38 | name = TSTSpaceTelescope 39 | maxZoom = 4 40 | xmitDataScalar = 0.5 41 | labBoostScalar = 1.2 42 | baseTransformName = Telescope 43 | cameraTransformName = CameraTransform 44 | lookTransformName = LookTransform 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/SpaceTelescope/texture.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Parts/SpaceTelescope/texture.dds -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Plugins/PluginData/Config.cfg: -------------------------------------------------------------------------------- 1 | TSTSettings 2 | { 3 | FwindowPosX = 40 4 | FwindowPosY = 440 5 | CwindowPosX = 510 6 | CwindowPosY = 104 7 | GalwindowPosX = 512 8 | GalwindowPosY = 128 9 | BodwindowPosX = 1186 10 | BodwindowPosY = 269 11 | scienceUndiscoveredScope = 20 12 | scienceDiscoveredScope = 2 13 | repUndiscoveredScope = 20 14 | repDiscoveredScope = 2 15 | fundsUndiscoveredScope = 12000 16 | fundsdiscoveredScope = 1000 17 | scienceUndiscoveredChem = 20 18 | scienceDiscoveredChem = 5 19 | repUndiscoveredChem = 35 20 | repDiscoveredChem = 5 21 | fundsUndiscoveredChem = 10000 22 | fundsdiscoveredChem = 1000 23 | } 24 | TSTStockPlanetOrder 25 | { 26 | planets = Sun,Kerbin,Mun,Minmus,Duna,Eve,Moho,Jool,Dres,Eeloo,Ike,Laythe,Gilly,Tylo,Vall,Bop,Pol,Galaxy1,Galaxy2,Galaxy3,Galaxy4,Galaxy5,Galaxy6,Galaxy7,Galaxy8 27 | } 28 | TSTRSSPlanetOrder 29 | { 30 | planets = Sun,Earth,Moon,Mercury,Venus,Mars,Jupiter,Deimos,Phobos,Io,Europa,Ganymede,Callisto,Saturn,Titan,Uranus,Pluto,Galaxy1,Galaxy2,Galaxy3,Galaxy4,Galaxy5,Galaxy6,Galaxy7,Galaxy8 31 | } 32 | TSTOPMPlanetOrder 33 | { 34 | planets = Sun,Kerbin,Mun,Minmus,Duna,Eve,Moho,Jool,Dres,Ike,Laythe,Gilly,Tylo,Vall,Bop,Pol,Sarnus,Eeloo,Ovok,Slate,Tekto,Urlum,Polta,Priax,Wal,Tal,Neidon,Thatmo,Nissee,Plock,Galaxy1,Galaxy2,Galaxy3,Galaxy4,Galaxy5,Galaxy6,Galaxy7,Galaxy8 35 | } 36 | TSTNHPlanetOrder 37 | { 38 | planets = Sun,Kerbin,Mun,Sonnah,Aptur,Serran,Laythe,Derso,Lave,Eli,Jool,Eve,Dres,Duna,Ike,Leouch,Nolas,Arin,Astid,Atell,Titanus,Ete,Tylo,Oree,Moh,Moho,Ernus,Eeloo,Minmus,Vanor,Tidus,Pol,Gilly,Vall,Etal,Bop,Galaxy1,Galaxy2,Galaxy3,Galaxy4,Galaxy5,Galaxy6,Galaxy7,Galaxy8 39 | } 40 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Resources/MMOPMScienceDefs.cfg: -------------------------------------------------------------------------------- 1 | @EXPERIMENT_DEFINITION[*]:HAS[#id[TarsierSpaceTech.SpaceTelescope]:NEEDS[OPM]] 2 | { 3 | @RESULTS 4 | { 5 | LookingAtSarnus=#autoLOC_TST_0125 //A gas giant. The rings around it are beautiful. 6 | LookingAtHale=#autoLOC_TST_0126 //This tiny moon is so hard to see through Sarnus' rings, but it must be responsible for keeping the rings in place. 7 | LookingAtOvok=#autoLOC_TST_0127 //It looks like a giant egg. Could it be an unhatched space kraken? 8 | LookingAtSlate=#autoLOC_TST_0128 //It looks a lot like Kerbin but without an atmosphere, closer inspection is warranted. 9 | LookingAtTekto=#autoLOC_TST_0129 //There is a very thick atmosphere, possibly liquids on the surface. The possibilities here are beyond imagination. 10 | LookingAtUrlum=#autoLOC_TST_0130 //An Ice giant. It looks very cold. The colours are simply breathtaking. 11 | LookingAtPolta=#autoLOC_TST_0131 //An icy moon with striking swils in its terrain. 12 | LookingAtPriax=#autoLOC_TST_0132 //A heavily cratered moon. 13 | LookingAtWal=#autoLOC_TST_0133 //Rocky on the surface yet the golden colour can't help but make you think of well.. gold. 14 | LookingAtTal=#autoLOC_TST_0134 //A sub-satelite of Wal. It also has a shiny, golden surface 15 | LookingAtNeidon=#autoLOC_TST_0135 //Another ice giant. The strikingly beautiful blue and purple colours are mesmerising. 16 | LookingAtThatmo=#autoLOC_TST_0136 //An icy moon that appears to have a very thin atmosphere. 17 | LookingAtNissee=#autoLOC_TST_0137 //This tiny moon looks like a marble. 18 | LookingAtPlock=#autoLOC_TST_0138 //It looks like a icy dwarf. It's a very long way away. 19 | } 20 | } 21 | 22 | @EXPERIMENT_DEFINITION[*]:HAS[#id[TarsierSpaceTech.ChemCam]:NEEDS[OPM]] 23 | { 24 | @RESULTS 25 | { 26 | HaleSrfLanded=#autoLOC_TST_0139 //There is nothing but rock, and amazing that we can keep the ChemCam on the ground to do any analysis of it's composition. 27 | OvokSrfLanded=#autoLOC_TST_0140 //Laser analysis of the surface of Ovok reveals ice. Maybe it's not a space kraken egg after all. 28 | SlateSrfLanded=#autoLOC_TST_0141 //Sustained blasts from the laser vaporize the surface layers of slate, showing a lot of very interesting compounds. If only there was an atmosphere. 29 | TektoSrfLanded=#autoLOC_TST_0142 //The laser analysis indicates chlorine & hydrocarbons. Is this ethane? Could this support life? 30 | PoltaSrfLanded=#autoLOC_TST_0143 //The surface steams as the ice on the surface melts under the gaze of the laser. 31 | PriaxSrfLanded=#autoLOC_TST_0144 //The laser creates its own small crater but with so many already it will go unnoticed. 32 | WalSrfLanded=#autoLOC_TST_0145 //The laser analysis indicates there is no gold here. 33 | TalSrfLanded=#autoLOC_TST_0146 //The laser analysis indicates ice and... gold. 34 | ThatmoSrfLanded=#autoLOC_TST_0147 //Blasts from the laser vaporize the ice. Lots of ice. 35 | NisseeSrfLanded=#autoLOC_TST_0148 //The laser has a hard time calibrating out here. But it appears to be rock, and marble? 36 | PlockSrfLanded=#autoLOC_TST_0149 //How did we manage to get here. Analysis indicates ice. 37 | } 38 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Resources/MMRSSScienceDefs.cfg: -------------------------------------------------------------------------------- 1 | @EXPERIMENT_DEFINITION[*]:HAS[#id[TarsierSpaceTech.SpaceTelescope]:NEEDS[RealSolarSystem]] 2 | { 3 | @RESULTS 4 | { 5 | LookingAtMercury=#autoLOC_TST_0150 //Mercury's surface is covered with craters of various ages; the ejecta from some newer craters is clearly visible through the telescope. 6 | LookingAtVenus=#autoLOC_TST_0151 //Faint changes in the cloud cover suggest the presence of some high altitude mountains or volcanoes in this area. 7 | LookingAtMoon=#autoLOC_TST_0152 //Much of the Moon's bright surface is covered with overlapping craters. 8 | LookingAtMars=#autoLOC_TST_0153 //There seem to be a lot of red things on Mars, closer inspection is warranted. 9 | LookingAtDeimos=#autoLOC_TST_0154 //This thing looks more like a large asteroid than a moon when viewed up close. 10 | LookingAtPhobos=#autoLOC_TST_0155 //Up close, Phobos resembles nothing if not a large, very dark, asteroid. 11 | LookingAtJupiter=#autoLOC_TST_0156 //Bands of different coloured clouds are visible in Jupiter's atmosphere; each band being driven in opposite directions by fierce winds. 12 | LookingAtIo=#autoLOC_TST_0157 //Colourful yellow, red, and sometimes green materials coat areas of Io's surface, sometimes centered around active volcanoes. 13 | LookingAtEuropa=#autoLOC_TST_0158 //Relatively smooth, bright white terrain covers most of Europa's surface. 14 | LookingAtGanymede=#autoLOC_TST_0159 //Ganymede's terrain is heavily cratered in most areas and appears to be mostly water ice covered by a thin layer of dark regolith. 15 | LookingAtCallisto=#autoLOC_TST_0160 //The surface of Callisto is almost saturated with impact craters, every further impact will almost always overlap with older craters. 16 | LookingAtSaturn=#autoLOC_TST_0161 //Saturn's thick cloud layer obscures all but the outermost layers of its atmosphere. 17 | LookingAtTitan=#autoLOC_TST_0162 //Dense clouds obscure most of the surface in the visible portion of the spectrum, providing little useful data. 18 | LookingAtUranus=#autoLOC_TST_0163 //Uranus' light blue and white clouds cover the entire planet, obscuring any observations of its interior. 19 | LookingAtPluto=#autoLOC_TST_0164 //Pluto looks a bit dim and blurry from this distance, a closer view will be necessary to see any details. 20 | } 21 | } 22 | 23 | @EXPERIMENT_DEFINITION[*]:HAS[#id[TarsierSpaceTech.ChemCam]:NEEDS[RealSolarSystem]] 24 | { 25 | @RESULTS 26 | { 27 | MercurySrfLanded=#autoLOC_TST_0165 //Scans of vaporized surface materials indicate that Mercury is nearly entirely covered with layers of igneous rock. 28 | VenusSrfLanded=#autoLOC_TST_0166 //Laser analysis of the surface of Venus reveals an elemental composition similar to that of most rocky planets; primarily silicate in nature. 29 | MoonSrfLanded=#autoLOC_TST_0167 //Sustained blasts from the laser vaporize the surface layers of Lunar regolith, however nothing but more regolith is discovered below. 30 | MarsSrfLanded=#autoLOC_TST_0168 //Significant concentrations of iron oxide are detected in the surface of Mars, the presence of which is responsible for the planet's red colouring. 31 | DeimosSrfLanded=#autoLOC_TST_0169 //The loosely compacted surface of Deimos is nearly blasted apart by the laser beam. Nothing but ordinary silicates are detected in the vaporized remains. 32 | PhobosSrfLanded=#autoLOC_TST_0170 //Scans of the surface of Phobos reveal silicate minerals common to many types of asteroids. 33 | IoSrfLanded=#autoLOC_TST_0171 //Traces of various sulfur compounds are detected in scans of Io's surface. 34 | EuropaSrfLanded=#autoLOC_TST_0172 //The laser bores a surprisingly deep hole in Europa's surface, releasing a significant amount of steam. 35 | GanymedeSrfLanded=#autoLOC_TST_0173 //Scans of Ganymede's surface reveal a mix of water ice, silicate compounds, along with traces of some organic compounds. 36 | CallistoSrfLanded=#autoLOC_TST_0174 //Signs of water ice are found covering most of the surface of Callisto. 37 | TitanSrfLanded=#autoLOC_TST_0175 //The laser vaporizes a sample of Titan's surface, producing a brownish cloud of energetic dust. 38 | PlutoSrfLanded=#autoLOC_TST_0176 //Scans of the surface here reveal mostly oxygen and hydrogen, probably in the form of water ice. 39 | } 40 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/Resources/ScienceDefs.cfg: -------------------------------------------------------------------------------- 1 | EXPERIMENT_DEFINITION 2 | { 3 | id = TarsierSpaceTech.SpaceTelescope 4 | title = #autoLOC_TST_0248 //Space Telescope 5 | baseValue = 20 6 | scienceCap = 25 7 | dataScale = 3 8 | 9 | requireAtmosphere = False 10 | situationMask = 48 11 | biomeMask = 7 12 | 13 | RESULTS 14 | { 15 | default=#autoLOC_TST_0177 //Took a great scientific picture of a distant body. 16 | default=#autoLOC_TST_0178 //Ok who's the wise guy who put bubble gum on the camera lens? 17 | LookingAtSun=#autoLOC_TST_0179 //That burning smell is your corneas. 18 | LookingAtKerbin=#autoLOC_TST_0180 //Is that my house there? Or is there some dirt on the lens. 19 | LookingAtMun=#autoLOC_TST_0181 //Just what we need, another picture of the Mun. 20 | LookingAtMinmus=#autoLOC_TST_0182 //Hang on...there's another moon there? 21 | LookingAtMoho=#autoLOC_TST_0183 //That looks like a nice lump of clay. 22 | LookingAtEve=#autoLOC_TST_0184 //It's a shame more planets aren't purple. 23 | LookingAtDuna=#autoLOC_TST_0185 //You wonder if you can go skiing at the poles. 24 | LookingAtDres=#autoLOC_TST_0186 //Doesn't look like anything exciting is going on there. 25 | LookingAtJool=#autoLOC_TST_0187 //That's going to make a lovely postcard. 26 | LookingAtLaythe=#autoLOC_TST_0188 //That planet reminds you of home. 27 | LookingAtEeloo=#autoLOC_TST_0189 //This was a long way to come just for a picture. 28 | LookingAtGalaxy1=#autoLOC_TST_0190 //Two fluffy clouds. 29 | LookingAtGalaxy2=#autoLOC_TST_0191 //It's like a big plate or is it a dish? 30 | LookingAtGalaxy3=#autoLOC_TST_0192 //It goes around and around. 31 | LookingAtGalaxy4=#autoLOC_TST_0193 //Is it a horse? Eee Awww, No I think it's a Donkey. 32 | LookingAtGalaxy5=#autoLOC_TST_0194 //That's a big explosion! 33 | LookingAtGalaxy6=#autoLOC_TST_0195 //It kinda just looks like a giant plug hole. 34 | LookingAtGalaxy7=#autoLOC_TST_0196 //Is this a sign of alien life? Looks like my fingerprint. 35 | LookingAtGalaxy8=#autoLOC_TST_0197 //Mmmm Strawberries and Cream. 36 | } 37 | } 38 | 39 | EXPERIMENT_DEFINITION 40 | { 41 | id = TarsierSpaceTech.ChemCam 42 | title = #autoLOC_TST_0053 //ChemCam 43 | baseValue = 15 44 | scienceCap = 18 45 | dataScale = 2.5 46 | 47 | requireAtmosphere = False 48 | situationMask = 1 49 | biomeMask = 1 50 | 51 | RESULTS 52 | { 53 | default = #autoLOC_TST_0198 //The spectrometer confirms that the sample is indeed a combination of elements. 54 | default = #autoLOC_TST_0199 //The spectrometer data is nonsense, who thought firing a laser at a rock was actually a good idea. 55 | default = #autoLOC_TST_0200 /Shooting rocks is fun, lets do it again...what?! this is a science experiment? 56 | 57 | KerbinSrfLandedGrasslands = #autoLOC_TST_0201 //The spectrum shows large quantities of water and organic matter...you may have just shot an insect 58 | KerbinSrfLandedHighlands = #autoLOC_TST_0202 //The spectrum shows peaks at Silicon, Aluminium and Oxygen. 59 | KerbinSrfLandedMountains = #autoLOC_TST_0203 //The rocks here are very uninteresting, at least the scenery is nice. 60 | KerbinSrfLandedDeserts = #autoLOC_TST_0204 //Silicon, lots and lots of Silicon. 61 | KerbinSrfLandedTundra = #autoLOC_TST_0205 //The rocks here are very uninteresting, as is the scenery. 62 | KerbinSrfLandedIceCaps = #autoLOC_TST_0206 //The spectrum shows there is water present but not much else. 63 | KerbinSrfLandedShores = #autoLOC_TST_0207 //Silicon and Water, the ingredients for a sandcastle. 64 | KerbinSrfLandedBadlands = #autoLOC_TST_0208 //The geology of the area definitely does not live up to the name. 65 | KerbinSrfLandedLaunchPad = #autoLOC_TST_0209 //It turns out management do not like the laser being tested on the launch pad. 66 | KerbinSrfLandedRunway = #autoLOC_TST_0210 //You notice a nearby fuel spill that could make a great experiment. 67 | KerbinSrfLandedKSC = #autoLOC_TST_0211 //The experiment shows that is fun to shoot at scientists with lasers. 68 | 69 | MunSrfLanded = #autoLOC_TST_0212 //The composition is surprisingly similar to Kerbin's. 70 | MunSrfLanded = #autoLOC_TST_0213 //The spectrum is very close to that of Basalt. 71 | MunSrfLanded = #autoLOC_TST_0214 //The spectrum appears quite messy, this appears to be a mixture of many different rock types. 72 | MunSrfLanded = #autoLOC_TST_0215 //The rocks here are rich in precious metals. 73 | 74 | MinmusSrfLanded = #autoLOC_TST_0216 //The composition is almost identical to a mint dessert. 75 | 76 | EveSrfLanded = #autoLOC_TST_0217 //The spectrum shows the rock here consists of purple. 77 | 78 | DunaSrfLanded = #autoLOC_TST_0218 //The spectrum suggests the presence of water! 79 | 80 | GillySrfLanded = #autoLOC_TST_0219 //The spectrum is very similar to that of an asteroid. 81 | } 82 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/TSTAddKIS.cfg: -------------------------------------------------------------------------------- 1 | @PART[scienceHardDrive]:FOR[TarsierSpaceTech]:NEEDS[KIS] 2 | { 3 | 4 | //KIS 5 | MODULE 6 | { 7 | name = ModuleKISItemEvaTweaker 8 | editorItemsCategory = false 9 | carriable = true 10 | equipSlot = jetpack 11 | equipMeshName = jetpack_base01 12 | equipBoneName = bn_jetpack01 13 | equipPos = (0,-0.05,-0.3) 14 | equipDir = (0,270,0) 15 | runSpeed = 0.8 16 | } 17 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/TSTMMKopernicus.cfg: -------------------------------------------------------------------------------- 1 | @PART[tarsierSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[Kopernicus] 2 | { 3 | @MODULE[TSTSpaceTelescope] 4 | { 5 | @maxZoom = 6 6 | } 7 | } 8 | 9 | @PART[tarsierAdvSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[Kopernicus] 10 | { 11 | @MODULE[TSTSpaceTelescope] 12 | { 13 | @maxZoom = 10 14 | } 15 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/TSTMMResearchBodies.cfg: -------------------------------------------------------------------------------- 1 | @PART[tarsierSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[ResearchBodies] 2 | { 3 | MODULE 4 | { 5 | name = ModuleTrackBodies 6 | difficulty = 2 7 | minAltitude = 200000 8 | maxTrackDistance = 10000000000 9 | electricChargeRequest = 5 10 | landed = false 11 | viewAngle =12 12 | scienceReward = 8 13 | } 14 | } 15 | 16 | @PART[tarsierAdvSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[ResearchBodies] 17 | { 18 | MODULE 19 | { 20 | name = ModuleTrackBodies 21 | difficulty = 2 22 | minAltitude = 200000 23 | maxTrackDistance = 9999000000000 24 | electricChargeRequest = 5 25 | landed = false 26 | viewAngle =20 27 | scienceReward = 8 28 | } 29 | } 30 | 31 | @PART[tarsierSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[ResearchBodies,Kopernicus] 32 | { 33 | @MODULE[ModuleTrackBodies] 34 | { 35 | @maxTrackDistance = 540000000000 36 | } 37 | } 38 | 39 | @PART[tarsierAdvSpaceTelescope]:FOR[TarsierSpaceTech]:NEEDS[ResearchBodies,Kopernicus] 40 | { 41 | @MODULE[ModuleTrackBodies] 42 | { 43 | @maxTrackDistance = 324000000000 44 | } 45 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/TSTResearchBodies.cfg: -------------------------------------------------------------------------------- 1 | RESEARCHBODIES 2 | { 3 | loadAs = mod 4 | name = TarsierSpaceTech 5 | ONDISCOVERY 6 | { 7 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 8 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 9 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 10 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 11 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 12 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 13 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 14 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 15 | } 16 | 17 | IGNORELEVELS 18 | { 19 | // body = easy normal medium hard 20 | Galaxy1 = true false false false 21 | Galaxy2 = true false false false 22 | Galaxy3 = true false false false 23 | Galaxy4 = true false false false 24 | Galaxy5 = true false false false 25 | Galaxy6 = true false false false 26 | Galaxy7 = true false false false 27 | Galaxy8 = true false false false 28 | } 29 | } 30 | 31 | Localization 32 | { 33 | en-us 34 | { 35 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 36 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 37 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 38 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 39 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 40 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 41 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 42 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 43 | } 44 | } 45 | 46 | Localization 47 | { 48 | es-es 49 | { 50 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 51 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 52 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 53 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 54 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 55 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 56 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 57 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 58 | } 59 | } 60 | 61 | Localization 62 | { 63 | es-mx 64 | { 65 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 66 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 67 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 68 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 69 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 70 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 71 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 72 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 73 | } 74 | } 75 | 76 | Localization 77 | { 78 | ja 79 | { 80 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 81 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 82 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 83 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 84 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 85 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 86 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 87 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 88 | } 89 | } 90 | 91 | Localization 92 | { 93 | ru 94 | { 95 | #autoLOC_RBodies_discovery_Galaxy1 = Мы нашли новую галактику, похожую на два пушистых облака. 96 | #autoLOC_RBodies_discovery_Galaxy2 = Мы нашли новую галактику, которая выглядит, как большая тарелка... или это блюдо? 97 | #autoLOC_RBodies_discovery_Galaxy3 = Мы нашли новую галактику, которая ходит вокруг да около! 98 | #autoLOC_RBodies_discovery_Galaxy4 = Мы нашли новую галактику, похожую на лошадь. 99 | #autoLOC_RBodies_discovery_Galaxy5 = Мы нашли новую галактику, которая выглядит так, как будто она только что взорвалась! 100 | #autoLOC_RBodies_discovery_Galaxy6 = Мы нашли новую галактику, похожую на гигантскую пробку. 101 | #autoLOC_RBodies_discovery_Galaxy7 = Мы нашли новую галактику, которая удивительно похожа на отпечаток пальца. 102 | #autoLOC_RBodies_discovery_Galaxy8 = Мы нашли новую галактику, которая выглядит как десерт. 103 | } 104 | } 105 | 106 | Localization 107 | { 108 | zh-cn 109 | { 110 | #autoLOC_RBodies_discovery_Galaxy1 = We found a new galaxy that looks like two fluffy clouds. 111 | #autoLOC_RBodies_discovery_Galaxy2 = We found a new galaxy that looks like a big plate or is it a dish? 112 | #autoLOC_RBodies_discovery_Galaxy3 = We found a new galaxy that goes around and around! 113 | #autoLOC_RBodies_discovery_Galaxy4 = We found a new galaxy that looks like a horse. 114 | #autoLOC_RBodies_discovery_Galaxy5 = We found a new galaxy that looks like it just popped! 115 | #autoLOC_RBodies_discovery_Galaxy6 = We found a new galaxy that looks like a giant plughole. 116 | #autoLOC_RBodies_discovery_Galaxy7 = We found a new galaxy that looks amazingly like a fingerprint. 117 | #autoLOC_RBodies_discovery_Galaxy8 = We found a new galaxy that looks like, well, a dessert. 118 | } 119 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Distribution/GameData/TarsierSpaceTech/TarsierSpaceTechnology.version: -------------------------------------------------------------------------------- 1 | { 2 | "NAME":"TarsierSpaceTechnology", 3 | "URL":"http://ksp-avc.cybutek.net/version.php?id=148", 4 | "DOWNLOAD":"http://spacedock.info/mod/143/Tarsier%20Space%20Technology%20with%20Galaxies%20Continued...", 5 | "VERSION":{"MAJOR":7,"MINOR":13,"PATCH":0,"BUILD":0}, 6 | "KSP_VERSION":{"MAJOR":1,"MINOR":12,"PATCH":1}, 7 | "KSP_VERSION_MIN":{"MAJOR":1,"MINOR":12,"PATCH":0}, 8 | "KSP_VERSION_MAX":{"MAJOR":1,"MINOR":12,"PATCH":99} 9 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TarsierSpaceTech")] 8 | [assembly: AssemblyDescription("Addon MOD for KerbalSpaceProgram")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TarsierSpaceTech")] 12 | [assembly: AssemblyCopyright("Copyright © 2014-9")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("86273159-6994-4e43-9ef8-5e253aa935b9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("7.13.0")] 35 | [assembly: KSPAssembly("TarsierSpaceTech", 7, 13, 0)] 36 | 37 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TarsierSpaceTech.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TarsierSpaceTech.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Byte[]. 65 | /// 66 | internal static byte[] target_01 { 67 | get { 68 | object obj = ResourceManager.GetObject("target_01", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Byte[]. 75 | /// 76 | internal static byte[] target_02 { 77 | get { 78 | object obj = ResourceManager.GetObject("target_02", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Byte[]. 85 | /// 86 | internal static byte[] target_03 { 87 | get { 88 | object obj = ResourceManager.GetObject("target_03", resourceCulture); 89 | return ((byte[])(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Byte[]. 95 | /// 96 | internal static byte[] target_04 { 97 | get { 98 | object obj = ResourceManager.GetObject("target_04", resourceCulture); 99 | return ((byte[])(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Byte[]. 105 | /// 106 | internal static byte[] target_05 { 107 | get { 108 | object obj = ResourceManager.GetObject("target_05", resourceCulture); 109 | return ((byte[])(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Byte[]. 115 | /// 116 | internal static byte[] target_06 { 117 | get { 118 | object obj = ResourceManager.GetObject("target_06", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Byte[]. 125 | /// 126 | internal static byte[] target_07 { 127 | get { 128 | object obj = ResourceManager.GetObject("target_07", resourceCulture); 129 | return ((byte[])(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Byte[]. 135 | /// 136 | internal static byte[] target_08 { 137 | get { 138 | object obj = ResourceManager.GetObject("target_08", resourceCulture); 139 | return ((byte[])(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Byte[]. 145 | /// 146 | internal static byte[] target_09 { 147 | get { 148 | object obj = ResourceManager.GetObject("target_09", resourceCulture); 149 | return ((byte[])(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized resource of type System.Byte[]. 155 | /// 156 | internal static byte[] target_10 { 157 | get { 158 | object obj = ResourceManager.GetObject("target_10", resourceCulture); 159 | return ((byte[])(obj)); 160 | } 161 | } 162 | 163 | /// 164 | /// Looks up a localized resource of type System.Byte[]. 165 | /// 166 | internal static byte[] target_11 { 167 | get { 168 | object obj = ResourceManager.GetObject("target_11", resourceCulture); 169 | return ((byte[])(obj)); 170 | } 171 | } 172 | 173 | /// 174 | /// Looks up a localized resource of type System.Byte[]. 175 | /// 176 | internal static byte[] target_12 { 177 | get { 178 | object obj = ResourceManager.GetObject("target_12", resourceCulture); 179 | return ((byte[])(obj)); 180 | } 181 | } 182 | 183 | /// 184 | /// Looks up a localized resource of type System.Byte[]. 185 | /// 186 | internal static byte[] viewfinder { 187 | get { 188 | object obj = ResourceManager.GetObject("viewfinder", resourceCulture); 189 | return ((byte[])(obj)); 190 | } 191 | } 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\TARGETS\target-01.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\TARGETS\target-02.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\TARGETS\target-03.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 129 | 130 | 131 | ..\TARGETS\target-04.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\TARGETS\target-05.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\TARGETS\target-06.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | 140 | ..\TARGETS\target-07.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\TARGETS\target-08.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 144 | 145 | 146 | ..\TARGETS\target-09.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 147 | 148 | 149 | ..\TARGETS\target-10.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 150 | 151 | 152 | ..\TARGETS\target-11.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 153 | 154 | 155 | ..\TARGETS\target-12.bin;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 156 | 157 | 158 | ..\viewfinder.bak;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 159 | 160 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/RTWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * RTWrapper.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using System; 26 | using System.Reflection; 27 | using UnityEngine; 28 | using Object = System.Object; 29 | 30 | namespace TarsierSpaceTech 31 | { 32 | /// 33 | /// The Wrapper class to access Remote Tech 34 | /// 35 | public class RTWrapper 36 | { 37 | protected static Type RTAPIType; 38 | protected static Object actualRTAPI; 39 | 40 | /// 41 | /// This is the Remote Tech API object 42 | /// 43 | /// SET AFTER INIT 44 | /// 45 | public static RTAPI RTactualAPI; 46 | 47 | /// 48 | /// Whether we found the Remote Tech API assembly in the loadedassemblies. 49 | /// 50 | /// SET AFTER INIT 51 | /// 52 | public static Boolean AssemblyExists { get { return (RTAPIType != null); } } 53 | 54 | /// 55 | /// Whether we managed to hook the running Instance from the assembly. 56 | /// 57 | /// SET AFTER INIT 58 | /// 59 | public static Boolean InstanceExists { get { return (actualRTAPI != null); } } 60 | 61 | /// 62 | /// Whether we managed to wrap all the methods/functions from the instance. 63 | /// 64 | /// SET AFTER INIT 65 | /// 66 | private static Boolean _RTWrapped; 67 | 68 | /// 69 | /// Whether the object has been wrapped 70 | /// 71 | public static Boolean APIReady { get { return _RTWrapped; } } 72 | 73 | /// 74 | /// This method will set up the Remote Tech object and wrap all the methods/functions 75 | /// 76 | /// bool success of method call 77 | public static Boolean InitTRWrapper() 78 | { 79 | //reset the internal objects 80 | _RTWrapped = false; 81 | actualRTAPI = null; 82 | LogFormatted_DebugOnly("Attempting to Grab Remote Tech Types..."); 83 | 84 | //find the base type 85 | RTAPIType = getType("RemoteTech.API.API"); 86 | 87 | if (RTAPIType == null) 88 | { 89 | return false; 90 | } 91 | 92 | LogFormatted("Remote Tech Version:{0}", RTAPIType.Assembly.GetName().Version.ToString()); 93 | 94 | //now grab the running instance 95 | LogFormatted_DebugOnly("Got Assembly Types, grabbing Instances"); 96 | try 97 | { 98 | actualRTAPI = RTAPIType.GetMember("HasLocalControl", BindingFlags.Public | BindingFlags.Static); 99 | } 100 | catch (Exception) 101 | { 102 | LogFormatted("No RemoteTech isInitialised found"); 103 | //throw; 104 | } 105 | 106 | if (actualRTAPI == null) 107 | { 108 | LogFormatted("Failed grabbing RemoteTech Instance"); 109 | return false; 110 | } 111 | 112 | //If we get this far we can set up the local object and its methods/functions 113 | LogFormatted_DebugOnly("Got Instance, Creating Wrapper Objects"); 114 | RTactualAPI = new RTAPI(actualRTAPI); 115 | 116 | _RTWrapped = true; 117 | return true; 118 | } 119 | 120 | internal static Type getType(string name) 121 | { 122 | Type type = null; 123 | AssemblyLoader.loadedAssemblies.TypeOperation(t => 124 | 125 | { 126 | if (t.FullName == name) 127 | type = t; 128 | } 129 | ); 130 | 131 | if (type != null) 132 | { 133 | return type; 134 | } 135 | return null; 136 | } 137 | 138 | /// 139 | /// The Type that is an analogue of the real Remote Tech. This lets you access all the API-able properties and Methods of Remote Tech 140 | /// 141 | public class RTAPI 142 | { 143 | internal RTAPI(Object actualRT) 144 | { 145 | //store the actual object 146 | APIactualRT = actualRT; 147 | 148 | //these sections get and store the reflection info and actual objects where required. Later in the properties we then read the values from the actual objects 149 | //for events we also add a handler 150 | 151 | //WORK OUT THE STUFF WE NEED TO HOOK FOR PEOPLE HERE 152 | //Methods 153 | LogFormatted_DebugOnly("Getting IsRemoteTechEnabled Method"); 154 | IsRemoteTechEnabledMethod = RTAPIType.GetMethod("IsRemoteTechEnabled", BindingFlags.Public | BindingFlags.Static); 155 | LogFormatted_DebugOnly("Success: " + (IsRemoteTechEnabledMethod != null)); 156 | 157 | LogFormatted_DebugOnly("Getting HasLocalControl Method"); 158 | HasLocalControlMethod = RTAPIType.GetMethod("HasLocalControl", BindingFlags.Public | BindingFlags.Static); 159 | LogFormatted_DebugOnly("Success: " + (HasLocalControlMethod != null)); 160 | 161 | LogFormatted_DebugOnly("Getting HasAnyConnection Method"); 162 | HasAnyConnectionMethod = RTAPIType.GetMethod("HasAnyConnection", BindingFlags.Public | BindingFlags.Static); 163 | LogFormatted_DebugOnly("Success: " + (HasAnyConnectionMethod != null)); 164 | 165 | LogFormatted_DebugOnly("Getting GetShortestSignalDelay Method"); 166 | GetShortestSignalDelayMethod = RTAPIType.GetMethod("GetShortestSignalDelay", BindingFlags.Public | BindingFlags.Static); 167 | LogFormatted_DebugOnly("Success: " + (GetShortestSignalDelayMethod != null)); 168 | } 169 | 170 | private Object APIactualRT; 171 | 172 | #region Methods 173 | private MethodInfo IsRemoteTechEnabledMethod; 174 | 175 | /// 176 | /// Whether Remote Tech is Enabled or not. 177 | /// 178 | /// True or False 179 | internal bool IsRemoteTechEnabled 180 | { 181 | get 182 | { 183 | try 184 | { 185 | return (bool)IsRemoteTechEnabledMethod.Invoke(APIactualRT, null); 186 | } 187 | catch (Exception ex) 188 | { 189 | LogFormatted("Unable to invoke Remote Tech IsRemoteTechEnabled Method"); 190 | LogFormatted("Exception: {0}", ex); 191 | return false; 192 | //throw; 193 | } 194 | } 195 | } 196 | 197 | private MethodInfo HasLocalControlMethod; 198 | 199 | /// 200 | /// Whether the current vessel HasLocalControl 201 | /// 202 | /// The vessel id reference 203 | /// Success of call 204 | internal bool HasLocalControl(Guid id) 205 | { 206 | try 207 | { 208 | return (bool)HasLocalControlMethod.Invoke(APIactualRT, new Object[] { id }); 209 | } 210 | catch (Exception ex) 211 | { 212 | LogFormatted("Unable to invoke Remote Tech HasLocalControl Method"); 213 | LogFormatted("Exception: {0}", ex); 214 | return false; 215 | //throw; 216 | } 217 | } 218 | 219 | private MethodInfo HasAnyConnectionMethod; 220 | 221 | /// 222 | /// Whether the current vessel HasAnyConnection 223 | /// 224 | /// The vessel id reference 225 | /// Success of call 226 | internal bool HasAnyConnection(Guid id) 227 | { 228 | try 229 | { 230 | return (bool)HasAnyConnectionMethod.Invoke(APIactualRT, new Object[] { id }); 231 | } 232 | catch (Exception ex) 233 | { 234 | LogFormatted("Unable to invoke Remote Tech HasAnyConnection Method"); 235 | LogFormatted("Exception: {0}", ex); 236 | return false; 237 | //throw; 238 | } 239 | } 240 | 241 | private MethodInfo GetShortestSignalDelayMethod; 242 | 243 | /// 244 | /// Gets the signal delay 245 | /// 246 | /// The vessel id reference 247 | /// A double indicating the signaldelay time 248 | internal double GetShortestSignalDelay(Guid id) 249 | { 250 | try 251 | { 252 | return (double)GetShortestSignalDelayMethod.Invoke(APIactualRT, new Object[] { id }); 253 | } 254 | catch (Exception ex) 255 | { 256 | LogFormatted("Unable to invoke Remote Tech GetShortestSignalDelay Method"); 257 | LogFormatted("Exception: {0}", ex); 258 | return 0; 259 | //throw; 260 | } 261 | } 262 | 263 | #endregion Methods 264 | } 265 | 266 | #region Logging Stuff 267 | 268 | /// 269 | /// Some Structured logging to the debug file - ONLY RUNS WHEN TST Debug mode is on 270 | /// 271 | /// Text to be printed - can be formatted as per String.format 272 | /// Objects to feed into a String.format 273 | internal static void LogFormatted_DebugOnly(String Message, params Object[] strParams) 274 | { 275 | TSTSettings TSTsettings = TSTMstStgs.Instance.TSTsettings; 276 | if (TSTsettings.debugging) 277 | LogFormatted(Message, strParams); 278 | } 279 | 280 | /// 281 | /// Some Structured logging to the debug file 282 | /// 283 | /// Text to be printed - can be formatted as per String.format 284 | /// Objects to feed into a String.format 285 | internal static void LogFormatted(String Message, params Object[] strParams) 286 | { 287 | Message = String.Format(Message, strParams); 288 | String strMessageLine = String.Format("{0},{2}-{3},{1}", 289 | DateTime.Now, Message, Assembly.GetExecutingAssembly().GetName().Name, 290 | MethodBase.GetCurrentMethod().DeclaringType.Name); 291 | Debug.Log(strMessageLine); 292 | } 293 | 294 | #endregion Logging Stuff 295 | } 296 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/SettingsParams.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using UnityEngine; 3 | using KSP.Localization; 4 | 5 | namespace TarsierSpaceTech 6 | { 7 | public class TST_SettingsParms : GameParameters.CustomParameterNode 8 | 9 | { 10 | public override string Title { get { return Localizer.Format("#autoLOC_TST_0010"); } } //#autoLOC_TST_0010 = Tarsier Space Tech Options 11 | public override GameParameters.GameMode GameMode { get { return GameParameters.GameMode.ANY; } } 12 | public override bool HasPresets { get { return true; } } 13 | public override string Section { get { return "Tarsier Space Technologies"; } } 14 | public override string DisplaySection { get { return Localizer.Format("#autoLOC_TST_0009"); //#autoLOC_TST_0009 = Tarsier Space Technologies 15 | } 16 | } 17 | public override int SectionOrder { get { return 1; } } 18 | 19 | [GameParameters.CustomIntParameterUI("#autoLOC_TST_0011", minValue = 256, maxValue = 1024, stepSize = 10, autoPersistance = true, toolTip = "#autoLOC_TST_0012")] //#autoLOC_TST_0011 = Small ChemCam Window (pixels) #autoLOC_TST_0012 = Small Size setting of ChemCam Window in pixels 20 | public int ChemwinSml = 250; 21 | 22 | [GameParameters.CustomIntParameterUI("#autoLOC_TST_0013", minValue = 256, maxValue = 1024, stepSize = 10, autoPersistance = true, toolTip = "#autoLOC_TST_0014")] //#autoLOC_TST_0013 = Large ChemCam Window (pixels) #autoLOC_TST_0014 = Large Size setting of ChemCam Window in pixels 23 | public int ChemwinLge = 500; 24 | 25 | [GameParameters.CustomIntParameterUI("#autoLOC_TST_0015", minValue = 256, maxValue = 1024, stepSize = 10, autoPersistance = true, toolTip = "#autoLOC_TST_0016")] //#autoLOC_TST_0015 = Small Telescope Window (pixels) #autoLOC_TST_0016 = Small Size setting of Telescope Window in pixels 26 | public int TelewinSml = 300; 27 | 28 | [GameParameters.CustomIntParameterUI("#autoLOC_TST_0017", minValue = 256, maxValue = 1024, stepSize = 10, autoPersistance = true, toolTip = "#autoLOC_TST_0018")] //#autoLOC_TST_0017 = Large Telescope Window (pixels) #autoLOC_TST_0018 = Large Size setting of Telescope Window in pixels 29 | public int TelewinLge = 600; 30 | 31 | [GameParameters.CustomIntParameterUI("#autoLOC_TST_0019", minValue = 1, maxValue = 20, stepSize = 1, autoPersistance = true, toolTip = "#autoLOC_TST_0020", gameMode = GameParameters.GameMode.CAREER)] //#autoLOC_TST_0019 = Maximum ChemCam Contracts #autoLOC_TST_0020 = The maximum number of ChemCam Contracts\nthat can be offered at one time capped at 20 32 | public int maxChemCamContracts = 3; 33 | 34 | [GameParameters.CustomParameterUI("#autoLOC_TST_0021", autoPersistance = true, toolTip = "#autoLOC_TST_0022", gameMode = GameParameters.GameMode.CAREER)] //#autoLOC_TST_0021 = ChemCam contracts restricted #autoLOC_TST_0022 = ChemCam Contracts are only offered for bodies that have already been photographed 35 | public bool photoOnlyChemCamContracts = true; 36 | 37 | [GameParameters.CustomParameterUI("#autoLOC_TST_0023", toolTip = "#autoLOC_TST_0024")] //#autoLOC_TST_0023 = Zoom the Star Field #autoLOC_TST_0024 = If on, the Star Field (skybox) will zoom with the telescope lens,\nif off the Star Field (skybox) will not zoom. 38 | public bool ZoomSkyBox = true; 39 | 40 | [GameParameters.CustomParameterUI("#autoLOC_TST_0025", toolTip = "#autoLOC_TST_0026")] //#autoLOC_TST_0025 = Use Stock App Launcher Icon #autoLOC_TST_0026 = If on, the Stock Application launcher will be used,\nif off will use Blizzy Toolbar if installed. 41 | public bool UseAppLauncher = true; 42 | 43 | [GameParameters.CustomParameterUI("#autoLOC_TST_0027", autoPersistance = true, toolTip = "#autoLOC_TST_0028")] //#autoLOC_TST_0027 = ToolTips On #autoLOC_TST_0028 = Turn the Tooltips on and off. 44 | public bool ToolTips = true; 45 | 46 | [GameParameters.CustomParameterUI("#autoLOC_TST_0029", toolTip = "#autoLOC_TST_0030")] //#autoLOC_TST_0029 = Extra Debug Logging #autoLOC_TST_0030 = Turn this On to capture lots of extra information\ninto the KSP log for reporting a problem. 47 | public bool debugging = false; 48 | 49 | public override void SetDifficultyPreset(GameParameters.Preset preset) 50 | { 51 | Debug.Log("Setting difficulty preset"); 52 | switch (preset) 53 | { 54 | case GameParameters.Preset.Easy: 55 | 56 | break; 57 | case GameParameters.Preset.Normal: 58 | 59 | break; 60 | case GameParameters.Preset.Moderate: 61 | 62 | break; 63 | case GameParameters.Preset.Hard: 64 | 65 | break; 66 | case GameParameters.Preset.Custom: 67 | break; 68 | } 69 | } 70 | 71 | public override bool Enabled(MemberInfo member, GameParameters parameters) 72 | { 73 | if (HighLogic.fetch != null) 74 | { 75 | if (HighLogic.LoadedSceneIsFlight) 76 | { 77 | if (member.Name != "UseAppLauncher" && member.Name != "debugging") 78 | return false; 79 | } 80 | } 81 | 82 | return true; 83 | } 84 | 85 | public override bool Interactible(MemberInfo member, GameParameters parameters) 86 | { 87 | if (HighLogic.fetch != null) 88 | { 89 | if (HighLogic.LoadedSceneIsFlight) 90 | { 91 | if (member.Name != "UseAppLauncher" && member.Name != "debugging") 92 | return false; 93 | } 94 | } 95 | 96 | if (member.Name == "UseAppLauncher") 97 | { 98 | if (RSTUtils.ToolbarManager.ToolbarAvailable) 99 | return true; 100 | else 101 | return false; 102 | } 103 | 104 | return true; 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/Targets.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/Targets.ai -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-01.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-01.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-02.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-02.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-03.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-03.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-04.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-04.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-05.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-05.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-06.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-06.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-07.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-07.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-08.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-08.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-09.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-09.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-10.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-10.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-11.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-12.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/TARGETS/target-12.bin -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTChemCamContract.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTChemCamContract.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using System; 26 | using System.Collections.Generic; 27 | using UniLinq; 28 | using Contracts; 29 | using Contracts.Agents; 30 | using RSTUtils; 31 | using KSP.Localization; 32 | 33 | namespace TarsierSpaceTech 34 | { 35 | internal class TSTChemCamContract : Contract 36 | { 37 | public override bool CanBeCancelled() 38 | { 39 | return true; 40 | } 41 | 42 | public override bool CanBeDeclined() 43 | { 44 | return true; 45 | } 46 | 47 | protected override string GetHashString() 48 | { 49 | return "TST_chemcam_" + target.name + biome; 50 | } 51 | 52 | protected override string GetDescription() 53 | { 54 | return TextGen.GenerateBackStories(Localizer.Format("#autoLOC_TST_0052"), agent.Name, Localizer.Format("#autoLOC_TST_0053") , target.name, MissionSeed, true, true, true); //#autoLOC_TST_0052 = Exploration # autoLOC_TST_0053 = ChemCam 55 | } 56 | 57 | protected override string GetTitle() 58 | { 59 | return Localizer.Format("#autoLOC_TST_0054", target.displayName); //#autoLOC_TST_0054 = Analyse the surface composition of <<1>> 60 | } 61 | 62 | protected override string MessageCompleted() 63 | { 64 | return Localizer.Format("#autoLOC_TST_0055"); //#autoLOC_TST_0055 = The data has been collected, please send it back for analysis 65 | } 66 | 67 | public override bool MeetRequirements() 68 | { 69 | AvailablePart ap1 = PartLoader.getPartInfoByName("tarsierChemCam"); 70 | if (ap1 != null) 71 | { 72 | return ResearchAndDevelopment.PartTechAvailable(ap1); 73 | } 74 | Utilities.Log("It appears the TST ChemCam part is missing. Cannot check Contract Requirements"); 75 | return false; 76 | } 77 | 78 | protected override string GetSynopsys() 79 | { 80 | if (biome != "") 81 | { 82 | string biomedisplayName = ScienceUtil.GetBiomedisplayName(target, biome); 83 | return Localizer.Format("#autoLOC_TST_0056", biomedisplayName, target.displayName); //#autoLOC_TST_0056 = Use the ChemCam to analyse the surface composition of the <<1>> on <<2>> 84 | } 85 | return Localizer.Format("#autoLOC_TST_0057", target.displayName); //#autoLOC_TST_0057 = Use the ChemCam to analyse the surface of <<1>> 86 | } 87 | 88 | protected override void OnCompleted() 89 | { 90 | string targetname = target.name; 91 | if (biome != "") 92 | targetname += "," + biome; 93 | 94 | TSTProgressTracker.setChemCamContractComplete(targetname); 95 | } 96 | 97 | private CelestialBody target; 98 | 99 | private string biome = ""; 100 | 101 | protected override void OnSave(ConfigNode node) 102 | { 103 | node.AddValue("target", target.name); 104 | node.AddValue("biome", biome); 105 | } 106 | 107 | protected override void OnLoad(ConfigNode node) 108 | { 109 | string targetName = node.GetValue("target"); 110 | target = FlightGlobals.Bodies.Find(b => b.name == targetName); 111 | biome = node.GetValue("biome"); 112 | } 113 | private int offers = 0; 114 | private int active = 0; 115 | private TSTChemCamContract countActivecontracts; 116 | 117 | protected override bool Generate() 118 | { 119 | TSTChemCamContract[] TSTChemCamContracts = ContractSystem.Instance.GetCurrentContracts(); 120 | offers = 0; 121 | active = 0; 122 | for (int i = 0; i < TSTChemCamContracts.Length; i++) 123 | { 124 | countActivecontracts = TSTChemCamContracts[i]; 125 | if (countActivecontracts.ContractState == State.Offered) 126 | offers++; 127 | else if (countActivecontracts.ContractState == State.Active) 128 | active++; 129 | } 130 | Utilities.Log_Debug("ChemCam Contracts check offers={0}, active={1}" , offers.ToString(), active.ToString()); 131 | if (offers >= TSTMstStgs.Instance.TSTsettings.maxChemCamContracts) 132 | return false; 133 | if (active >= TSTMstStgs.Instance.TSTsettings.maxChemCamContracts) 134 | return false; 135 | 136 | Utilities.Log_Debug("Generating ChemCam Contract"); 137 | agent = AgentList.Instance.GetAgent("Tarsier Space Technology"); 138 | expiryType = DeadlineType.None; 139 | deadlineType = DeadlineType.None; 140 | Random r = new Random(MissionSeed); 141 | 142 | //If we only want Bodies that have already been PhotoGraphed by a Telescope 143 | if (TSTMstStgs.Instance.TSTsettings.photoOnlyChemCamContracts) 144 | { 145 | TSTTelescopeContract[] TSTTelescopeContractsCompleted = ContractSystem.Instance.GetCompletedContracts(); 146 | List availTelescopeBodies = new List(); 147 | for (int i = 0; i < TSTTelescopeContractsCompleted.Length; i++) 148 | { 149 | if (TSTTelescopeContractsCompleted[i].target.type == typeof(CelestialBody)) //We only want Bodies, not Galaxies 150 | { 151 | CelestialBody contractBody = (CelestialBody)TSTTelescopeContractsCompleted[i].target.BaseObject; 152 | availTelescopeBodies.Add(contractBody); 153 | } 154 | } 155 | IEnumerable availableBodies = availTelescopeBodies.ToArray() 156 | //.Where(b => !TSTMstStgs.Instance.TSTgasplanets.TarsierPlanetOrder.Contains(b.name) && b.Radius > 100 && b.pqsController != null); //Exclude the GasPlanets 157 | .Where(b => b.Radius > 100 && b.pqsController != null); //Exclude the GasPlanets & Sigma Binaries 158 | if (!availableBodies.Any()) 159 | { 160 | Utilities.Log_Debug("There are no Bodies that have been photographed, cannot generate ChemCam Contract at this time"); 161 | return false; 162 | } 163 | target = availableBodies.ElementAt(r.Next(availableBodies.Count() - 1)); 164 | } 165 | else //We can use any Bodies 166 | { 167 | IEnumerable availableBodies = FlightGlobals.Bodies 168 | //.Where(b => !TSTMstStgs.Instance.TSTgasplanets.TarsierPlanetOrder.Contains(b.name) && b.Radius > 100 && b.pqsController != null); //Exclude the GasPlanets 169 | .Where(b => b.Radius > 100 && b.pqsController != null && b.hasSolidSurface); //Exclude the GasPlanets & Sigma Binaries 170 | if (!availableBodies.Any()) 171 | { 172 | Utilities.Log_Debug("There are no Bodies that have been photographed, cannot generate ChemCam Contract at this time"); 173 | return false; 174 | } 175 | target = availableBodies.ElementAt(r.Next(availableBodies.Count() - 1)); 176 | } 177 | 178 | // if ResearchBodies is installed we need to check if the target body has been found. If it has not, then we set the target to default so a contract is not generated at this time. 179 | if (TSTMstStgs.Instance.isRBactive && RBWrapper.RBactualAPI.enabled) 180 | { 181 | try 182 | { 183 | if (RBWrapper.APIRBReady) 184 | { 185 | List> trackbodyentry = TSTMstStgs.Instance.RBCelestialBodies.Where(e => e.Key.name == target.name).ToList(); 186 | if (trackbodyentry.Count != 1) 187 | { 188 | Utilities.Log("ChemCam Contract cannot find target in ResearchBodies TrackedBodies {0}" , target.name); 189 | return false; 190 | } 191 | if (trackbodyentry[0].Value.isResearched == false) 192 | { 193 | Utilities.Log("ChemCam Contract target in ResearchBodies TrackedBodies is still not tracked {0}" , target.name); 194 | return false; 195 | } 196 | } 197 | else 198 | { 199 | Utilities.Log("ResearchBodies is not Ready, cannot test ChemCam target for contract generation at this time"); 200 | return false; 201 | } 202 | } 203 | catch (Exception ex) 204 | { 205 | Utilities.Log("Checking ResearchBodies status for target {0} Failed unexpectedly. Ex: {1}" , target.name , ex.Message); 206 | } 207 | } 208 | 209 | Utilities.Log_Debug("Target: {0}" , target.name); 210 | Utilities.Log_Debug("Creating Science Param"); 211 | TSTScienceParam param2 = new TSTScienceParam(); 212 | param2.matchFields.Add("TarsierSpaceTech.ChemCam"); 213 | param2.matchFields.Add(target.name); 214 | biome = ""; 215 | List biomes = ResearchAndDevelopment.GetBiomeTags(target, true); 216 | if (biomes.Count > 1) 217 | { 218 | do 219 | { 220 | biome = biomes[r.Next(biomes.Count - 1)]; 221 | } while (biome.Contains("Water")); 222 | param2.matchFields.Add(biome); 223 | } 224 | AddParameter(param2); 225 | ContractPrestige p = TSTProgressTracker.getChemCamPrestige(target); //Get the target prestige level 226 | if (p != prestige) //If the prestige is not the required level don't generate. 227 | return false; 228 | string targetname = target.name; 229 | if (biome != "") 230 | targetname += "," + biome; 231 | if (TSTProgressTracker.HasChemCamCompleted(targetname)) 232 | { 233 | SetFunds(TSTMstStgs.Instance.TSTsettings.fundsdiscoveredChem * 0.75f, TSTMstStgs.Instance.TSTsettings.fundsdiscoveredChem, target); 234 | SetReputation(TSTMstStgs.Instance.TSTsettings.repDiscoveredChem, target); 235 | SetScience(TSTMstStgs.Instance.TSTsettings.scienceDiscoveredChem, target); 236 | } 237 | else 238 | { 239 | SetFunds(TSTMstStgs.Instance.TSTsettings.fundsUndiscoveredChem * 0.75f, TSTMstStgs.Instance.TSTsettings.fundsUndiscoveredChem, target); 240 | SetReputation(TSTMstStgs.Instance.TSTsettings.repUndiscoveredChem, target); 241 | SetScience(TSTMstStgs.Instance.TSTsettings.scienceUndiscoveredChem, target); 242 | } 243 | if (new Random(MissionSeed).Next(10) > 3) 244 | { 245 | Utilities.Log_Debug("Random Seed False, not generating contract"); 246 | return false; 247 | } 248 | Utilities.Log_Debug("Random Seed True, generating contract"); 249 | return true; 250 | } 251 | } 252 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTDOE.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * http://creativecommons.org/licenses/by/4.0/ 3 | * 4 | * This work, is a derivative of "CactEye 2," which is a derivative of "CactEye Orbital Telescope" by Rubber-Ducky, used under CC BY 4.0. "CactEye 2" is licensed under CC BY 4.0 by Raven. 5 | */ 6 | /* 7 | * TSTDOE.cs 8 | * (C) Copyright 2015, Jamie Leighton 9 | * Tarsier Space Technologies 10 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 11 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 12 | * As such this code continues to be covered by MIT license. 13 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 14 | * project is in no way associated with nor endorsed by Squad. 15 | * 16 | * This file is part of TarsierSpaceTech. 17 | * 18 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 19 | * it under the terms of the MIT License 20 | * 21 | * TarsierSpaceTech is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | * 25 | * You should have received a copy of the MIT License 26 | * along with TarsierSpaceTech. If not, see . 27 | * 28 | */ 29 | 30 | 31 | using System; 32 | using System.Collections.Generic; 33 | using System.Reflection; 34 | using UnityEngine; 35 | using Object = System.Object; 36 | 37 | namespace TarsierSpaceTech 38 | { 39 | [KSPAddon(KSPAddon.Startup.Flight, false)] 40 | public class TSTDOE : MonoBehaviour 41 | { 42 | private List TSTCam = new List(); 43 | private static bool DOEPresent; 44 | 45 | private void Start() 46 | { 47 | 48 | if (TSTCam == null) 49 | { 50 | Debug.Log("TST: DOEWrapper: Uh-oh, we have a problem. If you see this error, then you're gonna have a bad day."); 51 | } 52 | 53 | else 54 | { 55 | foreach (Part p in FlightGlobals.ActiveVessel.Parts) 56 | { 57 | TSTCameraModule tstCam = p.GetComponent(); 58 | if (tstCam != null) 59 | { 60 | if (!TSTCam.Contains(tstCam)) 61 | { 62 | TSTCam.Add(tstCam); 63 | 64 | } 65 | } 66 | } 67 | } 68 | 69 | DOEPresent = DOEWrapper.InitDOEWrapper(); 70 | // DOEPresent = AssemblyLoader.loadedAssemblies.Any(a => a.assembly.GetName().Name == "DistantObject"); 71 | TimingManager.UpdateAdd(TimingManager.TimingStage.Early, OnUpdate); 72 | } 73 | 74 | private void OnUpdate() 75 | { 76 | 77 | bool ExternalControl = false; 78 | TSTCameraModule ActiveOptics = null; 79 | foreach (Part p in FlightGlobals.ActiveVessel.Parts) 80 | { 81 | TSTSpaceTelescope tstSpcTel = p.GetComponent(); 82 | if (tstSpcTel != null) 83 | { 84 | TSTCameraModule tstCam = tstSpcTel._camera; 85 | if (tstCam != null) 86 | { 87 | if (!TSTCam.Contains(tstCam)) 88 | { 89 | TSTCam.Add(tstCam); 90 | 91 | } 92 | } 93 | } 94 | 95 | } 96 | 97 | foreach (TSTCameraModule tstCam in TSTCam) 98 | { 99 | //Check for when optics is null, this avoids an unknown exception 100 | if (tstCam != null && tstCam.Enabled) 101 | { 102 | ExternalControl = true; 103 | ActiveOptics = tstCam; 104 | } 105 | } 106 | 107 | if (DOEPresent) 108 | try 109 | { 110 | //SetDOEFOV(ExternalControl, ActiveOptics); 111 | 112 | if (DOEWrapper.APIReady) 113 | { 114 | DOEWrapper.DOEapi.SetExternalFOVControl(ExternalControl); 115 | if (ExternalControl) 116 | { 117 | DOEWrapper.DOEapi.SetFOV(ActiveOptics.fov); 118 | } 119 | } 120 | } 121 | catch 122 | { 123 | Debug.Log("TST: Wrong DOE library version - disabled."); 124 | DOEPresent = false; 125 | } 126 | 127 | 128 | 129 | } 130 | 131 | private void OnDestroy() 132 | { 133 | TimingManager.UpdateRemove(TimingManager.TimingStage.Early, OnUpdate); 134 | } 135 | } 136 | 137 | /// 138 | /// The Wrapper class to access DOE 139 | /// 140 | public class DOEWrapper 141 | { 142 | protected static Type DOEType; 143 | protected static Type DOEFlareDrawType; 144 | 145 | protected static Object actualDOEFlareDraw; 146 | 147 | /// 148 | /// This is the DOE API object 149 | /// 150 | /// SET AFTER INIT 151 | /// 152 | public static DOEAPI DOEapi; 153 | 154 | /// 155 | /// Whether we found the DOE assembly in the loadedassemblies. 156 | /// 157 | /// SET AFTER INIT 158 | /// 159 | public static Boolean AssemblyExists { get { return (DOEType != null); } } 160 | 161 | /// 162 | /// Whether we managed to hook the running Instance from the assembly. 163 | /// 164 | /// SET AFTER INIT 165 | /// 166 | public static Boolean InstanceExists { get { return (DOEapi != null); } } 167 | 168 | /// 169 | /// Whether we managed to wrap all the methods/functions from the instance. 170 | /// 171 | /// SET AFTER INIT 172 | /// 173 | private static Boolean _DOEWrapped; 174 | 175 | /// 176 | /// Whether the object has been wrapped 177 | /// 178 | public static Boolean APIReady { get { return _DOEWrapped; } } 179 | 180 | /// 181 | /// This method will set up the DOE object and wrap all the methods/functions 182 | /// 183 | /// bool success of method call 184 | public static Boolean InitDOEWrapper() 185 | { 186 | //reset the internal objects 187 | _DOEWrapped = false; 188 | actualDOEFlareDraw = null; 189 | DOEapi = null; 190 | LogFormatted_DebugOnly("Attempting to Grab DOE Types..."); 191 | 192 | //find the base type 193 | DOEType = getType("DistantObject.FlareDraw"); 194 | 195 | if (DOEType == null) 196 | { 197 | LogFormatted("Failed grabbing DOE FlareDraw Instance"); 198 | return false; 199 | } 200 | 201 | LogFormatted("DistantObject Version:{0}", DOEType.Assembly.GetName().Version.ToString()); 202 | 203 | //find the FlareDraw class type 204 | DOEFlareDrawType = getType("DistantObject.FlareDraw"); 205 | 206 | if (DOEFlareDrawType == null) 207 | { 208 | LogFormatted("Failed grabbing DOE FlareDraw Instance"); 209 | return false; 210 | } 211 | 212 | //now grab the running instance 213 | LogFormatted_DebugOnly("Got Assembly Types, grabbing Instances"); 214 | 215 | try 216 | { 217 | actualDOEFlareDraw = DOEFlareDrawType.GetMethod("SetExternalFOVControl", BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance); 218 | } 219 | catch (Exception) 220 | { 221 | LogFormatted("No DOE FlareDraw Instance found"); 222 | //throw; 223 | } 224 | if (actualDOEFlareDraw == null) 225 | { 226 | LogFormatted("Failed grabbing DOE Instance"); 227 | return false; 228 | } 229 | 230 | //If we get this far we can set up the local object and its methods/functions 231 | LogFormatted_DebugOnly("Got Instance, Creating Wrapper Objects"); 232 | DOEapi = new DOEAPI(actualDOEFlareDraw); 233 | 234 | _DOEWrapped = true; 235 | return true; 236 | } 237 | 238 | internal static Type getType(string name) 239 | { 240 | Type type = null; 241 | AssemblyLoader.loadedAssemblies.TypeOperation(t => 242 | 243 | { 244 | if (t.FullName == name) 245 | type = t; 246 | } 247 | ); 248 | 249 | if (type != null) 250 | { 251 | return type; 252 | } 253 | return null; 254 | } 255 | 256 | /// 257 | /// The Type that is an analogue of the real DOE. This lets you access all the API-able properties and Methods of DOE 258 | /// 259 | public class DOEAPI 260 | { 261 | internal DOEAPI(Object actualDOEFlareDraw) 262 | { 263 | //store the actual object 264 | APIactualDOEFlareDraw = actualDOEFlareDraw; 265 | 266 | //these sections get and store the reflection info and actual objects where required. Later in the properties we then read the values from the actual objects 267 | //for events we also add a handler 268 | //LogFormatted("Getting APIReady Object"); 269 | //APIReadyField = TRType.GetField("APIReady", BindingFlags.Public | BindingFlags.Static); 270 | //LogFormatted("Success: " + (APIReadyField != null).ToString()); 271 | 272 | //WORK OUT THE STUFF WE NEED TO HOOK FOR PEOPLE HERE 273 | //Methods 274 | LogFormatted_DebugOnly("Getting Methods"); 275 | SetExternalFOVControlMethod = DOEFlareDrawType.GetMethod("SetExternalFOVControl", BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance); 276 | SetFOVMethod = DOEFlareDrawType.GetMethod("SetFOV", BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance); 277 | LogFormatted_DebugOnly("Success: " + (SetExternalFOVControlMethod != null)); 278 | } 279 | 280 | private Object APIactualDOEFlareDraw; 281 | 282 | #region Methods 283 | 284 | private MethodInfo SetExternalFOVControlMethod; 285 | 286 | /// 287 | /// Set DOE ExternalFOVControl bool 288 | /// 289 | /// True or False 290 | /// Success of call 291 | internal bool SetExternalFOVControl(bool setting) 292 | { 293 | try 294 | { 295 | SetExternalFOVControlMethod.Invoke(APIactualDOEFlareDraw, new Object[] { setting }); 296 | return true; 297 | } 298 | catch (Exception ex) 299 | { 300 | LogFormatted("Unable to invoke DOE SetExternalFOVControl Method"); 301 | LogFormatted("Exception: {0}", ex); 302 | return false; 303 | //throw; 304 | } 305 | } 306 | 307 | private MethodInfo SetFOVMethod; 308 | 309 | /// 310 | /// Set the FOV for Flare Draw 311 | /// 312 | /// Float value of the FOV to set 313 | /// Success of call 314 | internal bool SetFOV(float setting) 315 | { 316 | try 317 | { 318 | SetFOVMethod.Invoke(APIactualDOEFlareDraw, new Object[] { setting }); 319 | return true; 320 | } 321 | catch (Exception ex) 322 | { 323 | LogFormatted("Unable to invoke DOE SetFOV Method"); 324 | LogFormatted("Exception: {0}", ex); 325 | return false; 326 | //throw; 327 | } 328 | } 329 | 330 | #endregion Methods 331 | } 332 | 333 | #region Logging Stuff 334 | 335 | /// 336 | /// Some Structured logging to the debug file - ONLY RUNS WHEN TST debug mode is on 337 | /// 338 | /// Text to be printed - can be formatted as per String.format 339 | /// Objects to feed into a String.format 340 | internal static void LogFormatted_DebugOnly(String Message, params Object[] strParams) 341 | { 342 | TSTSettings TSTsettings = TSTMstStgs.Instance.TSTsettings; 343 | if (TSTsettings.debugging) 344 | LogFormatted(Message, strParams); 345 | } 346 | 347 | /// 348 | /// Some Structured logging to the debug file 349 | /// 350 | /// Text to be printed - can be formatted as per String.format 351 | /// Objects to feed into a String.format 352 | internal static void LogFormatted(String Message, params Object[] strParams) 353 | { 354 | Message = String.Format(Message, strParams); 355 | String strMessageLine = String.Format("{0},{2}-{3},{1}", 356 | DateTime.Now, Message, Assembly.GetExecutingAssembly().GetName().Name, 357 | MethodBase.GetCurrentMethod().DeclaringType.Name); 358 | Debug.Log(strMessageLine); 359 | } 360 | 361 | #endregion Logging Stuff 362 | } 363 | } 364 | 365 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTGalaxies.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTGalaxies.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using System.Collections.Generic; 26 | using RSTUtils; 27 | using UnityEngine; 28 | 29 | namespace TarsierSpaceTech 30 | { 31 | [KSPAddon(KSPAddon.Startup.MainMenu, true)] 32 | public class TSTGalaxies : MonoBehaviour 33 | { 34 | public static TSTGalaxies Instance; 35 | 36 | internal GameObject baseTransform; 37 | private List _galaxies = new List(); 38 | private List _CBgalaxies = new List(); 39 | 40 | public static List Galaxies 41 | { 42 | get 43 | { 44 | return Instance._galaxies; 45 | } 46 | } 47 | 48 | public static List CBGalaxies 49 | { 50 | get 51 | { 52 | return Instance._CBgalaxies; 53 | } 54 | } 55 | 56 | public void Awake() 57 | { 58 | Debug.Log("TSTGalaxies Galaxies Awake"); 59 | if (Instance != null) 60 | Destroy(this); 61 | else 62 | Instance = this; 63 | DontDestroyOnLoad(this); 64 | 65 | Debug.Log("TSTGalaxies Starting Galaxies"); 66 | 67 | baseTransform = new GameObject(); 68 | baseTransform.transform.localPosition = Vector3.zero; 69 | baseTransform.transform.localRotation = Quaternion.identity; 70 | 71 | if (ScaledSun.Instance != null) 72 | { 73 | baseTransform.transform.parent = ScaledSun.Instance.transform; 74 | Debug.Log("TSTGalaxies BaseTransform set to the ScaledSun.Instance"); 75 | } 76 | else 77 | { 78 | baseTransform.SetActive(false); 79 | Debug.Log("TSTGalaxies BaseTransform setactive = false, ScaledSun does not exist"); 80 | } 81 | if (Utilities.IsKopInstalled) 82 | { 83 | baseTransform.transform.parent = FlightGlobals.Bodies[1].transform; 84 | Debug.Log("TSTGalaxies - Detected Kopernicus - BaseTransform set to Home Planet"); 85 | } 86 | 87 | UrlDir.UrlConfig[] galaxyCfgs = GameDatabase.Instance.GetConfigs("GALAXY"); 88 | foreach (UrlDir.UrlConfig cfg in galaxyCfgs) 89 | { 90 | GameObject go = new GameObject(name, typeof(MeshFilter), typeof(MeshRenderer), typeof(TSTGalaxy)); 91 | go.transform.parent = baseTransform.transform; 92 | TSTGalaxy galaxy = go.GetComponent(); 93 | galaxy.Load(cfg.config); 94 | Debug.Log("TSTGalaxies Adding Galaxy " + galaxy.name); 95 | Galaxies.Add(galaxy); 96 | 97 | GameObject goCB = new GameObject(name, typeof(CelestialBody)); 98 | goCB.transform.parent = go.transform; 99 | CelestialBody celestialBody = goCB.GetComponent(); 100 | celestialBody.bodyName = galaxy.name; 101 | celestialBody.bodyDisplayName = galaxy.displayName; 102 | celestialBody.transform.position = galaxy.position; 103 | celestialBody.atmosphere = false; 104 | celestialBody.ocean = false; 105 | celestialBody.timeWarpAltitudeLimits = new float[0]; 106 | celestialBody.Radius = 500; 107 | celestialBody.orbitDriver = null; 108 | celestialBody.progressTree = null; 109 | CBGalaxies.Add(celestialBody); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTGalaxy.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTGalaxy.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using RSTUtils; 26 | using UnityEngine; 27 | using UnityEngine.Rendering; 28 | using KSP.Localization; 29 | 30 | namespace TarsierSpaceTech 31 | { 32 | public class TSTGalaxy : MonoBehaviour, ITargetable 33 | { 34 | 35 | private Orbit _galaxy_orbit = null; 36 | private OrbitDriver _galaxy_orbitdriver = null; 37 | private VesselTargetModes _galaxy_targetmodes = VesselTargetModes.Direction; 38 | private static Mesh mesh; 39 | private Material mat; 40 | public string displayName; 41 | private ConfigNode config; 42 | private string textureURL; 43 | 44 | private float _size = 1e3f; 45 | public float size 46 | { 47 | get { return _size * ScaledSpace.ScaleFactor; } 48 | set { 49 | _size = value / ScaledSpace.ScaleFactor; 50 | transform.localScale = _size * Vector3.one; 51 | } 52 | } 53 | 54 | public void Start() 55 | { 56 | if (mat == null) 57 | { 58 | mat = new Material(Shader.Find("Unlit/Transparent")); 59 | } 60 | if (mesh == null) 61 | { 62 | Utilities.Log_Debug("Generating GalaxyMesh"); 63 | mesh = new Mesh(); 64 | mesh.vertices = new[]{ 65 | new Vector3(-1,0.75f,0), 66 | new Vector3(-1,-0.75f,0), 67 | new Vector3(1,0.75f,0), 68 | new Vector3(1,-0.75f,0) 69 | }; 70 | mesh.uv = new[]{ 71 | new Vector2(0, 1), 72 | new Vector2(0, 0), 73 | new Vector2(1, 1), 74 | new Vector2(1, 0) 75 | }; 76 | 77 | mesh.triangles = new[]{ 78 | 0,1,2, 79 | 3,2,1 80 | }; 81 | mesh.RecalculateNormals(); 82 | 83 | } 84 | gameObject.GetComponent().mesh = mesh; 85 | gameObject.GetComponent().material = mat; 86 | gameObject.layer = 10; 87 | gameObject.GetComponent().shadowCastingMode = ShadowCastingMode.Off; 88 | gameObject.GetComponent().receiveShadows = false; 89 | gameObject.GetComponent().enabled = true; 90 | } 91 | 92 | public void Update() 93 | { 94 | transform.LookAt(transform.parent.position); 95 | } 96 | 97 | public void Load(ConfigNode config) 98 | { 99 | mat = new Material(Shader.Find("Unlit/Transparent")); 100 | this.config = config; 101 | string name = config.GetValue("name"); 102 | string displayName = config.GetValue("displayName"); 103 | Vector3 pos = ConfigNode.ParseVector3(config.GetValue("location")); 104 | textureURL = config.GetValue("textureURL"); 105 | float size = float.Parse(config.GetValue("size")); 106 | Utilities.Log_Debug("Creating Galaxy: {0} : {1} : {2}" , name , pos.ToString() , textureURL); 107 | Utilities.Log_Debug("Setting Name"); 108 | this.name = name; 109 | this.displayName = Localizer.Format(displayName); 110 | this.size = 1e3f * size * ScaledSpace.ScaleFactor; 111 | scaledPosition = -130e6f * pos.normalized; 112 | Utilities.Log_Debug("Setting Scaled Position= {0}" , scaledPosition.ToString()); 113 | Utilities.Log_Debug("Position= {0}" , position.ToString()); 114 | setTexture(GameDatabase.Instance.GetTexture(textureURL, false)); 115 | Utilities.Log_Debug("Tex= {0}" , mat.mainTexture.name); 116 | Utilities.Log_Debug("Finished creating galaxy"); 117 | } 118 | 119 | public void attach(GameObject parent) 120 | { 121 | transform.parent = parent.transform; 122 | } 123 | 124 | public void setTexture(Texture texture) 125 | { 126 | mat.mainTexture = texture; 127 | } 128 | 129 | public Vector3 scaledPosition{ 130 | get 131 | { 132 | return transform.localPosition; 133 | } 134 | set 135 | { 136 | transform.localPosition = value; 137 | } 138 | 139 | } 140 | 141 | public Vector3 position 142 | { 143 | get 144 | { 145 | return ScaledSpace.ScaledToLocalSpace(transform.position); 146 | } 147 | set{ 148 | transform.position = ScaledSpace.LocalToScaledSpace(value); 149 | } 150 | } 151 | // ITargetable 152 | public Vector3 GetFwdVector() 153 | { 154 | return Vector3.zero; 155 | } 156 | 157 | public string GetName() 158 | { 159 | return name; 160 | } 161 | 162 | public string GetDisplayName() 163 | { 164 | return displayName; 165 | } 166 | 167 | public Vector3 GetObtVelocity() 168 | { 169 | return Vector3.zero; 170 | } 171 | public Orbit GetOrbit() 172 | { 173 | return _galaxy_orbit; 174 | } 175 | 176 | public OrbitDriver GetOrbitDriver() 177 | { 178 | return _galaxy_orbitdriver; 179 | } 180 | 181 | public Vector3 GetSrfVelocity() 182 | { 183 | return Vector3.zero; 184 | } 185 | 186 | public VesselTargetModes GetTargetingMode() 187 | { 188 | return _galaxy_targetmodes; 189 | } 190 | 191 | public Transform GetTransform() 192 | { 193 | return transform; 194 | } 195 | 196 | public Vessel GetVessel() 197 | { 198 | return null; 199 | } 200 | 201 | public bool GetActiveTargetable() 202 | { 203 | return false; 204 | } 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTGyroReactionWheel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTGyroReactionWheel.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * The maths function used in this module was adapted from CactEye2 Mod for KSP licensed under (CC BY 4.0). 16 | * 17 | * TarsierSpaceTech is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20 | * 21 | * You should have received a copy of the MIT License 22 | * along with TarsierSpaceTech. If not, see . 23 | * 24 | */ 25 | 26 | namespace TarsierSpaceTech 27 | { 28 | [System.Obsolete("TSTGyroReactionWheel is deprecated.")] 29 | class TSTGyroReactionWheel: ModuleReactionWheel 30 | { 31 | [KSPField(isPersistant = true)] 32 | float _basePitchTorque; 33 | [KSPField(isPersistant = true)] 34 | float _baseYawTorque; 35 | [KSPField(isPersistant = true)] 36 | float _baseRollTorque; 37 | [KSPField(isPersistant = false)] 38 | public float powerscale = 0.1f; 39 | [KSPField(isPersistant = false)] 40 | public float sensitivity = 1f; 41 | 42 | 43 | 44 | public override void OnStart(StartState state) 45 | { 46 | base.OnStart(state); 47 | _basePitchTorque = PitchTorque; 48 | _baseYawTorque = YawTorque; 49 | _baseRollTorque = RollTorque; 50 | } 51 | 52 | public override void OnUpdate() 53 | { 54 | base.OnUpdate(); 55 | PitchTorque = _basePitchTorque * (powerscale + ((1 - powerscale) * sensitivity)); 56 | RollTorque = _baseRollTorque * (powerscale + ((1 - powerscale) * sensitivity)); 57 | YawTorque = _baseYawTorque * (powerscale + ((1 - powerscale) * sensitivity)); 58 | //base.OnUpdate(); 59 | } 60 | } 61 | 62 | 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTScienceParam.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTScienceParam.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using System.Collections.Generic; 26 | using Contracts; 27 | using RSTUtils; 28 | using KSP.Localization; 29 | 30 | namespace TarsierSpaceTech 31 | { 32 | class TSTScienceParam : ContractParameter 33 | { 34 | protected override string GetTitle() 35 | { 36 | return Localizer.Format("#autoLOC_TST_0080"); //#autoLOC_TST_0080 = Transmit or Recover the science data 37 | } 38 | 39 | protected override string GetNotes() 40 | { 41 | if (Root != null) 42 | { 43 | return Root.Synopsys; 44 | } 45 | 46 | return ""; 47 | } 48 | 49 | protected override void OnRegister() 50 | { 51 | Utilities.Log_Debug("Adding Callback for science data received on contract"); 52 | GameEvents.OnScienceRecieved.Add(OnScienceData); 53 | //GameEvents.OnScienceRecieved.Add(OnScienceData); 54 | 55 | } 56 | 57 | protected override void OnUnregister() 58 | { 59 | Utilities.Log_Debug("Removing Callback for science data received on contract"); 60 | GameEvents.OnScienceRecieved.Remove(OnScienceData); 61 | } 62 | 63 | protected override string GetHashString() 64 | { 65 | return "TSTParam.Science"; 66 | } 67 | 68 | protected override void OnLoad(ConfigNode node) 69 | { 70 | if (node.HasValue("FIELD")) 71 | { 72 | matchFields.AddRange(node.GetValues("FIELD")); 73 | } 74 | } 75 | 76 | protected override void OnSave(ConfigNode node) 77 | { 78 | foreach (string field in matchFields) 79 | { 80 | node.AddValue("FIELD", field); 81 | } 82 | } 83 | 84 | public List matchFields = new List(); 85 | 86 | private void OnScienceData(float amount, ScienceSubject subject, ProtoVessel vessel, bool notsure) 87 | { 88 | Utilities.Log_Debug("Received Science Data from " + vessel != null ? vessel.vesselName : "Unknown Vessel" + " subject=" + subject.id + " amount=" + amount.ToString("000.00") + " bool=" + notsure); 89 | bool match=true; 90 | foreach (string f in matchFields) 91 | { 92 | Utilities.Log_Debug("matchFields=" + f); 93 | match &= subject.HasPartialIDstring(f); 94 | } 95 | Utilities.Log_Debug("Match result?=" + match); 96 | if (match) 97 | { 98 | SetComplete(); 99 | } 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTScienceProgressionBlocker.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTScienceProgressionBlocker.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * The code in this file is based off code originally supplied by the KSP forum user xEvilReeperx - Thanks to him for supplying it. 12 | * http://forum.kerbalspaceprogram.com/index.php?/topic/7542-the-official-unoffical-quothelp-a-fellow-plugin-developerquot-thread/&do=findComment&comment=2594258 13 | * 14 | * This file is part of TarsierSpaceTech. 15 | * This code will re-proxy the stored GameEvents.OnScienceReceived for the ProgressTracker (KSP World First Events) Science progress on celestialbodies 16 | * where the science subject contains the string : "TarsierSpaceTech.SpaceTelescope". This stops world first progress registering a unmanned science/visited event 17 | * for celestial bodies that we take pictures of with a TST space telescope. The reason for doing is, is so that the stock contract generator will still generate 18 | * "go visit planet x" or "explore planet x" contracts for celestial bodies that have had their picture taken. 19 | * 20 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 21 | * it under the terms of the MIT License 22 | * 23 | * TarsierSpaceTech is distributed in the hope that it will be useful, 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 26 | * 27 | * You should have received a copy of the MIT License 28 | * along with TarsierSpaceTech. If not, see . 29 | * 30 | */ 31 | using System; 32 | using System.Collections; 33 | using UnityEngine; 34 | 35 | namespace TarsierSpaceTech 36 | { 37 | [KSPAddon(KSPAddon.Startup.Instantly, true)] 38 | class TSTScienceProgressionBlocker : MonoBehaviour 39 | { 40 | //Proxy OnScienceReceived event 41 | public static readonly EventData ProxyOnScienceReceived = 42 | new EventData("Proxy.OnScienceReceived"); 43 | 44 | private static TSTScienceProgressionBlocker Instance { get; set; } 45 | //private static bool _block = false; 46 | 47 | //If set to true will only bock a single event, otherwise will not in OnScienceReceived. 48 | //public static void BlockSingleEvent() 49 | //{ 50 | // _block = true; 51 | //} 52 | 53 | 54 | private void Awake() 55 | { 56 | if (Instance != null) 57 | { 58 | Destroy(gameObject); 59 | return; 60 | } 61 | 62 | Instance = this; 63 | DontDestroyOnLoad(this); // GameEvents throws an exception on static methods, so we need a reference ;\ 64 | 65 | // We want this event to be the very first one, if possible. That will ensure it runs last 66 | GameEvents.OnScienceRecieved.Add(OnScienceReceived); 67 | } 68 | 69 | //Our override OnScienceReceived event. 70 | //We block all OnScienceReceived from triggering the ProgressTracker where the subject contains: "TarsierSpaceTech.SpaceTelescope" 71 | private void OnScienceReceived(float amount, ScienceSubject subject, ProtoVessel vessel, bool data3) 72 | { 73 | //if (!_block) 74 | if (!subject.id.Contains("TarsierSpaceTech.SpaceTelescope")) 75 | ProxyOnScienceReceived.Fire(amount, subject, vessel, data3); 76 | 77 | //_block = false; 78 | } 79 | } 80 | 81 | 82 | [KSPScenario(ScenarioCreationOptions.AddToAllGames, GameScenes.FLIGHT, GameScenes.TRACKSTATION, GameScenes.SPACECENTER)] 83 | public class TSTProgressTracker_Trap : ScenarioModule 84 | { 85 | private IEnumerator Start() 86 | { 87 | yield return new WaitForEndOfFrame(); // ProgressTracker might not have started, wait and make sure 88 | 89 | if (ProgressTracking.Instance == null) 90 | { 91 | Debug.LogError("ProgressTracking instance not found!"); //This is not good. 92 | yield break; 93 | } 94 | 95 | foreach (var cb in FlightGlobals.Bodies) 96 | { 97 | // get the scienceAchievement node 98 | var tree = ProgressTracking.Instance.GetBodyTree(cb); 99 | var scienceAchievement = tree.science; 100 | 101 | // remove science callbacks to onScienceReceived and onScienceDataTransmitted 102 | scienceAchievement.OnStow(); 103 | 104 | // wrap the add/remove callbacks inside another little method that tricks them into 105 | // registering with the proxy GameEvents 106 | var originalStow = scienceAchievement.OnStow; 107 | var originalDeploy = scienceAchievement.OnDeploy; 108 | 109 | scienceAchievement.OnStow = () => 110 | { 111 | SwapInProxyEvents(originalStow); 112 | }; 113 | 114 | scienceAchievement.OnDeploy = () => 115 | { 116 | SwapInProxyEvents(originalDeploy); 117 | }; 118 | 119 | // restore science callbacks (although now they'll register with TSTScienceProgressionBlocker instead of the real ones) 120 | scienceAchievement.OnDeploy(); 121 | } 122 | } 123 | 124 | 125 | private static void SwapInProxyEvents(Callback call) 126 | { 127 | var original = GameEvents.OnScienceRecieved; 128 | 129 | try 130 | { 131 | GameEvents.OnScienceRecieved = TSTScienceProgressionBlocker.ProxyOnScienceReceived; 132 | call(); 133 | } 134 | finally 135 | { 136 | GameEvents.OnScienceRecieved = original; 137 | } 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTTelescopeContract.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTTelescopeContract.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using Contracts; 26 | using Contracts.Agents; 27 | using RSTUtils; 28 | using KSP.Localization; 29 | 30 | namespace TarsierSpaceTech 31 | { 32 | class TSTTelescopeContract : Contract 33 | { 34 | public override bool CanBeCancelled() 35 | { 36 | return false; 37 | } 38 | 39 | public override bool CanBeDeclined() 40 | { 41 | return false; 42 | } 43 | 44 | protected override string GetHashString() 45 | { 46 | return "TST_telescope_"+target; 47 | } 48 | 49 | protected override string GetDescription() 50 | { 51 | return TextGen.GenerateBackStories(Localizer.Format("#autoLOC_TST_0052"), agent.Name, Localizer.Format("#autoLOC_TST_0058"), target.name, MissionSeed, true, true, true); //#autoLOC_TST_0052 = Exploration #autoLOC_TST_0058 = Space Telescope 52 | } 53 | 54 | protected override string GetTitle() 55 | { 56 | return Localizer.Format("#autoLOC_TST_0059",target.displayName); //#autoLOC_TST_0059 = Take a picture of <<1>> 57 | } 58 | 59 | protected override string MessageCompleted() 60 | { 61 | return Localizer.Format("#autoLOC_TST_0060"); //#autoLOC_TST_0060 = Great picture 62 | } 63 | 64 | public override bool MeetRequirements() 65 | { 66 | AvailablePart ap1 = PartLoader.getPartInfoByName("tarsierSpaceTelescope"); 67 | AvailablePart ap2 = PartLoader.getPartInfoByName("tarsierAdvSpaceTelescope"); 68 | if (ap1 != null && ap2 != null) 69 | { 70 | return ResearchAndDevelopment.PartTechAvailable(ap1) || ResearchAndDevelopment.PartTechAvailable(ap2); 71 | } 72 | if (ap1 != null && ap2 == null) 73 | { 74 | return ResearchAndDevelopment.PartTechAvailable(ap1); 75 | } 76 | if (ap1 == null && ap2 != null) 77 | { 78 | return ResearchAndDevelopment.PartTechAvailable(ap2); 79 | } 80 | Utilities.Log("It appears the TST telescope parts are missing. Cannot check Contract Requirements"); 81 | return false; 82 | } 83 | 84 | protected override string GetSynopsys() 85 | { 86 | 87 | return Localizer.Format("#autoLOC_TST_0061", target.displayName); //#autoLOC_TST_0061 = Use a space telescope to take a picture of <<1>> 88 | } 89 | 90 | public TSTSpaceTelescope.TargetableObject target 91 | { 92 | get 93 | { 94 | return GetParameter().target; 95 | } 96 | 97 | set 98 | { 99 | GetParameter().target = value; 100 | } 101 | } 102 | 103 | protected override void OnCompleted() 104 | { 105 | TSTProgressTracker.setTelescopeContractComplete(target); 106 | } 107 | 108 | protected override bool Generate() 109 | { 110 | TSTTelescopeContract[] TSTTelescopeContracts = ContractSystem.Instance.GetCurrentContracts(); 111 | int offers = 0; 112 | int active = 0; 113 | 114 | for (int i = 0; i < TSTTelescopeContracts.Length; i++) 115 | { 116 | TSTTelescopeContract m = TSTTelescopeContracts[i]; 117 | if (m.ContractState == State.Offered) 118 | offers++; 119 | else if (m.ContractState == State.Active) 120 | active++; 121 | } 122 | Utilities.Log_Debug("Telescope Contracts check offers= {0} active= {1}" , offers.ToString(), active.ToString()); 123 | if (offers >= 1) 124 | return false; 125 | if (active >= 1) 126 | return false; 127 | Utilities.Log_Debug("Generating Telescope Contract"); 128 | 129 | agent = AgentList.Instance.GetAgent("Tarsier Space Technology"); 130 | SetExpiry(); 131 | expiryType = DeadlineType.None; 132 | deadlineType = DeadlineType.None; 133 | 134 | Utilities.Log_Debug("Creating Parameter"); 135 | TSTTelescopeContractParam param = new TSTTelescopeContractParam(); 136 | AddParameter(param); 137 | string target_name = TSTProgressTracker.GetNextTelescopeTarget(); 138 | if (target_name == default(string)) 139 | { 140 | Utilities.Log_Debug("target body is default (not set), cannot generate"); 141 | return false; 142 | } 143 | Utilities.Log_Debug("Target: {0}" , target_name); 144 | AvailablePart ap2 = PartLoader.getPartInfoByName("tarsierAdvSpaceTelescope"); 145 | if (!ResearchAndDevelopment.PartTechAvailable(ap2) && !ResearchAndDevelopment.PartModelPurchased(ap2) && target_name == "Galaxy1") 146 | { 147 | Utilities.Log_Debug("Contracts for Planets completed and Galaxy contracts require advanced space telescope"); 148 | return false; 149 | } 150 | Utilities.Log_Debug("Checking Celestial Bodies"); 151 | target = FlightGlobals.Bodies.Find(b => b.name == target_name); 152 | if (target == null) 153 | { 154 | Utilities.Log_Debug("Checking Galaxies"); 155 | target = TSTGalaxies.Galaxies.Find(g => g.name == target_name); 156 | } 157 | Utilities.Log_Debug("Using target: {0}" , target.ToString()); 158 | param.target = target; 159 | Utilities.Log_Debug("Creating Science Param"); 160 | TSTScienceParam param2 = new TSTScienceParam(); 161 | param2.matchFields.Add("TarsierSpaceTech.SpaceTelescope"); 162 | param2.matchFields.Add("LookingAt" + target.name); 163 | AddParameter(param2); 164 | Utilities.Log_Debug("Created Science Param"); 165 | prestige = TSTProgressTracker.getTelescopePrestige(target); 166 | if (TSTProgressTracker.HasTelescopeCompleted(target)) 167 | { 168 | SetScience(TSTMstStgs.Instance.TSTsettings.scienceDiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 169 | SetFunds(TSTMstStgs.Instance.TSTsettings.fundsdiscoveredScope * 0.75f, TSTMstStgs.Instance.TSTsettings.fundsdiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 170 | SetReputation(TSTMstStgs.Instance.TSTsettings.repDiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 171 | } 172 | else 173 | { 174 | SetScience(TSTMstStgs.Instance.TSTsettings.scienceUndiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 175 | SetFunds(TSTMstStgs.Instance.TSTsettings.fundsUndiscoveredScope * 0.75f, TSTMstStgs.Instance.TSTsettings.fundsUndiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 176 | SetReputation(TSTMstStgs.Instance.TSTsettings.repUndiscoveredScope, target.type == typeof(TSTGalaxy) ? null : (CelestialBody)target.BaseObject); 177 | } 178 | return true; 179 | } 180 | 181 | //We would activate this if we only want to block the ProgressTracker for a Contract event only. See the TSTScienceProgressionblocker.cs file. 182 | //protected override void AwardCompletion() 183 | //{ 184 | // TSTScienceProgressionBlocker.BlockSingleEvent(); 185 | // base.AwardCompletion(); 186 | //} 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/TSTTelescopeContractParam.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * TSTTelescopeContractParm.cs 3 | * (C) Copyright 2015, Jamie Leighton 4 | * Tarsier Space Technologies 5 | * The original code and concept of TarsierSpaceTech rights go to Tobyb121 on the Kerbal Space Program Forums, which was covered by the MIT license. 6 | * Original License is here: https://github.com/JPLRepo/TarsierSpaceTechnology/blob/master/LICENSE 7 | * As such this code continues to be covered by MIT license. 8 | * Kerbal Space Program is Copyright (C) 2013 Squad. See http://kerbalspaceprogram.com/. This 9 | * project is in no way associated with nor endorsed by Squad. 10 | * 11 | * This file is part of TarsierSpaceTech. 12 | * 13 | * TarsierSpaceTech is free software: you can redistribute it and/or modify 14 | * it under the terms of the MIT License 15 | * 16 | * TarsierSpaceTech is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | * 20 | * You should have received a copy of the MIT License 21 | * along with TarsierSpaceTech. If not, see . 22 | * 23 | */ 24 | 25 | using Contracts; 26 | using RSTUtils; 27 | using KSP.Localization; 28 | 29 | namespace TarsierSpaceTech 30 | { 31 | class TSTTelescopeContractParam:ContractParameter 32 | { 33 | protected override string GetTitle() 34 | { 35 | return Localizer.Format("#autoLOC_TST_0062", target.displayName); //#autoLOC_TST_0062 = Take a picture of <<1>> using a Space Telescope 36 | } 37 | 38 | protected override string GetNotes() 39 | { 40 | if (Root != null) 41 | { 42 | return Root.Synopsys; 43 | } 44 | return ""; 45 | } 46 | 47 | protected override void OnRegister() 48 | { 49 | TSTProgressTracker.AddTelescopeListener(OnTelescopeScience); 50 | } 51 | 52 | protected override void OnUnregister() 53 | { 54 | TSTProgressTracker.RemoveTelescopeListener(OnTelescopeScience); 55 | } 56 | 57 | protected override void OnLoad(ConfigNode node) 58 | { 59 | if (node.HasValue("target")) 60 | { 61 | string t = node.GetValue("target"); 62 | target = FlightGlobals.Bodies.Find(b => b.name == t); 63 | if (target == null) 64 | { 65 | Utilities.Log_Debug("Checking Galaxies"); 66 | target = TSTGalaxies.Galaxies.Find(g => g.name == t); 67 | } 68 | } 69 | } 70 | 71 | protected override void OnSave(ConfigNode node) 72 | { 73 | node.AddValue("target", target.name); 74 | } 75 | 76 | protected override string GetHashString() 77 | { 78 | return "TSTParam.Telescope."+target.name; 79 | } 80 | 81 | public TSTSpaceTelescope.TargetableObject target; 82 | 83 | private void OnTelescopeScience(TSTSpaceTelescope.TargetableObject lookingAt) 84 | { 85 | if (target.name == lookingAt.name) 86 | { 87 | SetComplete(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/Textures.cs: -------------------------------------------------------------------------------- 1 | // The following Class is derived from Kerbal Alarm Clock mod. Which is licensed under: 2 | // The MIT License(MIT) Copyright(c) 2014, David Tregoning 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal 4 | // in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | // copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 8 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 9 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 10 | // THE SOFTWARE. 11 | 12 | using System; 13 | using System.IO; 14 | using RSTUtils; 15 | using UnityEngine; 16 | 17 | namespace TarsierSpaceTech 18 | { 19 | [KSPAddon(KSPAddon.Startup.MainMenu, false)] 20 | public class LoadGlobals : MonoBehaviour 21 | { 22 | public static LoadGlobals Instance; 23 | //Awake Event - when the DLL is loaded 24 | public void Awake() 25 | { 26 | if (Instance != null) 27 | return; 28 | Instance = this; 29 | Textures.LoadIconAssets(); 30 | DontDestroyOnLoad(this); 31 | Utilities.Log("TST LoadGlobals Awake Complete"); 32 | } 33 | 34 | public void Start() 35 | { 36 | //GameEvents.onGameSceneSwitchRequested.Add(onGameSceneSwitchRequested); 37 | } 38 | 39 | public void OnDestroy() 40 | { 41 | //GameEvents.onGameSceneSwitchRequested.Remove(onGameSceneSwitchRequested); 42 | } 43 | } 44 | 45 | internal static class Textures 46 | { 47 | 48 | internal static Texture2D TooltipBox = new Texture2D(10, 10, TextureFormat.ARGB32, false); 49 | internal static Texture2D BtnRedCross = new Texture2D(16, 16, TextureFormat.ARGB32, false); 50 | internal static Texture2D BtnResize = new Texture2D(16, 16, TextureFormat.ARGB32, false); 51 | 52 | internal static String PathIconsPath = Path.Combine(TSTMstStgs._AssemblyFolder.Substring(0, TSTMstStgs._AssemblyFolder.IndexOf("/TarsierSpaceTech/") + 18), "Icons").Replace("\\", "/"); 53 | internal static String PathToolbarIconsPath = PathIconsPath.Substring(PathIconsPath.ToLower().IndexOf("/gamedata/") + 10); 54 | 55 | 56 | internal static void LoadIconAssets() 57 | { 58 | try 59 | { 60 | LoadImageFromFile(ref TooltipBox, "TSTToolTipBox.png", PathIconsPath); 61 | LoadImageFromFile(ref BtnRedCross, "TSTbtnRedCross.png", PathIconsPath); 62 | LoadImageFromFile(ref BtnResize, "TSTbtnResize.png", PathIconsPath); 63 | } 64 | catch (Exception) 65 | { 66 | Utilities.Log("TST Failed to Load Textures - are you missing a file?"); 67 | } 68 | } 69 | 70 | public static Boolean LoadImageFromFile(ref Texture2D tex, String fileName, String folderPath = "") 71 | { 72 | Boolean blnReturn = false; 73 | try 74 | { 75 | if (folderPath == "") folderPath = PathIconsPath; 76 | 77 | //File Exists check 78 | if (File.Exists(String.Format("{0}/{1}", folderPath, fileName))) 79 | { 80 | try 81 | { 82 | tex.LoadImage(File.ReadAllBytes(String.Format("{0}/{1}", folderPath, fileName))); 83 | blnReturn = true; 84 | } 85 | catch (Exception ex) 86 | { 87 | Utilities.Log("TST Failed to load the texture:" + folderPath + "(" + fileName + ")"); 88 | Utilities.Log(ex.Message); 89 | } 90 | } 91 | else 92 | { 93 | Utilities.Log("TST Cannot find texture to load:" + folderPath + "(" + fileName + ")"); 94 | } 95 | 96 | 97 | } 98 | catch (Exception ex) 99 | { 100 | Utilities.Log("TST Failed to load (are you missing a file):" + folderPath + "(" + fileName + ")"); 101 | Utilities.Log(ex.Message); 102 | } 103 | return blnReturn; 104 | } 105 | 106 | internal static GUIStyle ResizeStyle, ClosebtnStyle; 107 | 108 | internal static bool StylesSet; 109 | 110 | internal static void SetupStyles() 111 | { 112 | GUI.skin = HighLogic.Skin; 113 | 114 | //Init styles 115 | 116 | Utilities._TooltipStyle = new GUIStyle(GUI.skin.label) 117 | { 118 | fontSize = 12, 119 | fontStyle = FontStyle.Normal, 120 | stretchHeight = true, 121 | wordWrap = true, 122 | border = new RectOffset(3, 3, 3, 3), 123 | padding = new RectOffset(4, 4, 6, 4), 124 | alignment = TextAnchor.MiddleCenter 125 | }; 126 | Utilities._TooltipStyle.normal.background = TooltipBox; 127 | Utilities._TooltipStyle.normal.textColor = new Color32(207, 207, 207, 255); 128 | Utilities._TooltipStyle.hover.textColor = Color.blue; 129 | 130 | ClosebtnStyle = new GUIStyle(GUI.skin.button) 131 | { 132 | alignment = TextAnchor.MiddleCenter, 133 | fixedWidth = 20, 134 | fixedHeight = 20, 135 | fontSize = 14, 136 | fontStyle = FontStyle.Normal 137 | }; 138 | ClosebtnStyle.active.background = GUI.skin.toggle.onNormal.background; 139 | ClosebtnStyle.onActive.background = ClosebtnStyle.active.background; 140 | ClosebtnStyle.padding = Utilities.SetRectOffset(ClosebtnStyle.padding, 3); 141 | 142 | ResizeStyle = new GUIStyle(GUI.skin.button) 143 | { 144 | alignment = TextAnchor.MiddleCenter, 145 | fixedWidth = 20, 146 | fixedHeight = 20, 147 | fontSize = 14, 148 | fontStyle = FontStyle.Normal 149 | }; 150 | ResizeStyle.onActive.background = ClosebtnStyle.active.background; 151 | ResizeStyle.padding = Utilities.SetRectOffset(ClosebtnStyle.padding, 3); 152 | 153 | StylesSet = true; 154 | 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /TarsierSpaceTechnology/TarsierSpaceTech/viewfinder.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPLRepo/TarsierSpaceTechnology/8752b7dec7f1be8c0cb65f2f437ac757b2e83b74/TarsierSpaceTechnology/TarsierSpaceTech/viewfinder.bak --------------------------------------------------------------------------------