Search the Community

Showing results for tags 'gui'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • The Daily Kerbal
  • General KSP
    • KSP Discussion
    • Suggestions & Development Discussion
    • Challenges & Mission ideas
    • The Spacecraft Exchange
    • KSP Fan Works
  • Gameplay and Technical Support
    • Gameplay Questions and Tutorials
    • Technical Support (PC, unmodded installs)
    • Technical Support (PC, modded installs)
    • Technical Support (PlayStation 4, XBox One)
  • Add-ons
    • Add-on Discussions
    • Add-on Releases
    • Add-on Development
  • Community
    • Welcome Aboard
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
  • International
    • International
  • KerbalEDU Forums
    • KerbalEDU
    • KerbalEDU Website
  • KSP Pre-release
    • 1.2.9 Pre-release Branch
    • 1.2.9 Pre-release Modding Discussions
    • 1.2.9 Pre-release Bug Tracker

Categories

  • Developer Articles

Found 19 results

  1. Contracts Window + v7.3 Download from SpaceDock Download from CurseForge Alternate Download: GitHub -------------------- Consider donating if you like what you see here. * Money will not go directly to development or upkeep of this addon -------------------- Source is available at GitHub A new contract monitoring window designed to give more information and be more flexible than the stock window. This window gives players a number of options for displaying contracts. Grouping and ordering of contracts can be modified and contracts can be placed into custom mission lists. All contract and parameter reward and penalty values are displayed, along with the amount due to any strategy modifiers. The contract reward modification section of this addon has been removed. Its functionality has been moved to a new, separate add-on that can be found here. Known Issues: When Contracts Window + is opened in the VAB or SPH the numbers on the total Funds display in the bottom-left corner will become invisible; this goes away by turning off the window. The top bar has several buttons that are used to adjust contract ordering and display options. The top-left icon opens a new window with options for changing sort order based on several criteria. The next icon toggles between ascending and descending order for the selected sorting type. The eyeball icon on the right toggles between the active and hidden contract list. Each mission list has its own active and hidden contract lists. The top-right icon opens a new window displaying all of the existing contract missions. Selecting a mission will switch the primary display to those contracts. The primary mission is always at the top of the list and contains all contracts. The bottom bar has several buttons that control various window options. The version number is displayed on the left. Tooltips for most buttons can be toggled on and off with the next icon. The spinning arrows icon is used to reset the window and primary contract list. A confirmation box will open upon pushing this button. This should generally not be needed, but if there are errors in the contract window (no contracts displayed, no "MasterMission" contract list, the window is too small, etc...) this can be used. All window size, font size, and position options will be reset; the internal list of contracts will be updated with all active contracts and the "MasterMission" will be reset with this internal list. All other mission lists should be unaffected, these can be manually deleted if there are any other problems. The aA icon controls font size for most of the window's labels. Each font is increased by one unit. The next icon toggles the overall window and texture element size. It also increases the font size by two units. Between the font and window size options there are four available font sizes and two window element size options. The arrow icon in the lower-right is a re-size handle; it can be dragged to increase or decrease the window size in either dimension. Each contract has a title bar above it with information and options for the contract. The contract difficulty, or prestige, is displayed on the left with one to three stars. The time remaining for the contract is shown next. It updates every five seconds (at high time-warp several days can go by during this period) and switches to days and hours, and turns yellow, when the counter gets low. The year/day time is dependent on your selection of Earth/Kerbin days in the KSP settings menu. The A icon can be used to display the flag and name of the contract's agency. The eyeball icon can be used to move the contract into the hidden or active contract list. The pin icon can be used to pin the icon to the top of the list, regardless of sort type or order; a contract's pinned state is persistent. The checkbox icon can be used to move the contract into a different contract mission list or create a new one. The blue icon at the end can be used to display contract notes if they exist; these are different from individual parameter notes. The primary contract and parameter display shows the same information as the stock window. In orange is the contract title. It is a button that can be pushed to collapse or expand the contract's parameters. When completed the contract text will turn green; when failed it will turn red. The contract parameters are shown in white. When completed these will turn green. Contract parameter notes can be displayed using the blue icon. Sub-parameters are offset slightly and are shown in a darker color. When all sub-parameters are completed they will be collapsed into their parent parameter and no longer displayed. The rewards for each contract and their parameters are displayed on the right side of the window. Funds, Rep, and Science rewards are displayed depending on how wide the window is. Rewards are in green, penalties are in red. The amount of any reward/penalty due to strategies, if any, is displayed in parenthesis. When the green checkbox icon is selected the mission list will appear. The current contract mission lists are displayed in this window. A green checkmark indicator on the left indicates that the currently selected contract is already in that mission. The green number to the right is the amount of contracts in that list. The red x box on the right can be used to remove a contract from any mission that it is present in. Selecting any existing mission will add the contract to it. Selecting the "Create New Mission" option will open the mission creator window. New missions can be created after giving them a name. Missions must have a name, can't use the same name, and must be under 20 characters. All progress nodes, their rewards, and in some cases, information about when they were completed is shown in this window. There are four types of Progress Nodes. Interval Nodes: These are nodes with multiple levels of progression, such as the altitude or speed records. Standard Nodes: These are nodes not specific to any one Celestial Body. Point of Interest Nodes: These are nodes completed by visiting anomalies. Celestial Body-Specific Nodes: These are nodes which are given separately for each Celestial Body Interval progress nodes. Standard progress nodes. The mission title bar is shown at the top of the window. The Title Bar is a button that can be used to switch to Progress Node mode. The edit mission window is opened with the pencil icon in the mission title bar for all but the Master Mission. Change the name of any mission. Delete any mission; this won't affect the contracts, and all contracts are still available in the Master Mission list. ChangeLog: This add-on uses TriggerAu's KSP Plugin Framework code Released under the MIT License.
  2. Upgrades GUI This plugin is a collections of interface tweaks aimed at making the part/module upgrades feature introduced in 1.2 more user-friendly. Note that the plugin doesn't add any upgrades. If you want to have them in your game you need to download other mods that implement the upgrade feature. VAB/SPH part tooltips show upgraded stats The part stats are now updated according to unlocked upgrades. The part cost is now updated according to unlocked upgrades. All module widgets now show the updated stats according to unlocked upgrades. The part upgrade module widget show the detail of part stats/cost modifiers. If "showUpgradesInModuleInfo" (stock field) is set to true the upgrade config, the module widget now show the details of every upgrade currently unlocked for this module Some QOL tweaks to the tooltip stats : dry mass, mention of multi-mode engines, better formatting of engines thrust/ISP (bonus feature) Non-stock modules using cost/mass modifiers should have their modifiers taken into account too. Upgrades selection This allow to customize which upgrades are applied to placed parts in all modes (Career, Science and Sandbox) Parts with upgrades now have a clickable "upgrade widget" in the tooltip widget list Clicking on the widget show a list of upgrade widgets that can be toggled to enable/disable upgrades for this part Upgrades exclusivity/overrides rules and R&D unlock status can't be bypassed Vessels with customized upgrades will work perfectly if the plugin is removed, all this is done within the stock upgrade implementation. R&D tech tree feature In the nodes part list, upgrades have a pale green background to better differentiate them from parts. Download & source Soon to be available on CKAN ! LATEST RELEASE and source from github. Disclaimer I'm far from a skilled programmer, so the code for this may be ugly. As far as I know, it does the job and doesn't break the game. However, keep in mind that I don't really know what I'm doing. If anybody has the time to review and comment my code, I'm open to suggestions and pull requests KSP-AVC disclaimer This mod doesn't include mini-AVC, but it has a version file that allow version checking trough the KSP-AVC Plugin. Licensing This masterful work of art is released under the unlicense. So public domain, feel free to do anything, especially updating this plugin if I'm not around. Changelog and bugs Known bugs and glitches None at the moment v1.5 for KSP 1.2.2 - 19/04/2017 (Issue #5 fix) : NRE when PartStats{} node is absent from PartStatsUpgradeModule bug (Issue #4 fix) : ModuleDataTransmitter (and others) doesn't revert to base stats bug (Issue #3 fix) : Incorrect state of upgrades at init bug v1.4 for KSP 1.2.2 - 18/04/2017 New feature : upgrade selection system Refactored a lot of things Re-fixed nullref on creating the upgraded parts prefab (thanks @Oort for the perfect bug report) Removed mini-AVC dll, KSP-AVC is still supported Changed plugin name to "UpgradesGUI" v1.3 for KSP 1.2.2 - 28/03/2017 Fixed an issue causing an exception within the GameDatabase, this resolve the issue with toolbar icons disappearance (Thanks @Rodger) The module widget list in the part tooltip is now sorted alphabetically (this reproduce the stock behaviour) v1.2 for KSP 1.2.2 - 24/03/2017 The "custom prefabs" parts now try to call OnLoad() on their modules, with the HighLogic.LoadedScene set to LOADING, in an effort to better replicate what happens with the real part prefabs. This fix the issue with Kerbalism custom modules, and may prevent the same kind of error from surfacing in other plugins. Thanks @ShotgunNinja for guidance on what was happening. Added some error-checking so if things go wrong, the plugin should fail a bit more gracefully. v1.1 for KSP 1.2.2 - 23/03/2017 Added KSP-AVC support for version checking v1.0 for KSP 1.2.2 - 22/03/2017 Initial release
  3. So I started a thread over in the Add-On Discussion forum and I am realizing that it might have been better to ask here if I want some responses from actual plugin developers, so here is the short version: Idea: A mod that creates a UI window with the tech tree in it similar to how it appears in the R&D building, but you are able to move parts around between different nodes, you can then save the layout and it will generate a MM patch file that will change the techRequired for the parts to the nodes you put them in, or just a log file that you could use to make a MM patch. For a more detailed description and reason why i think this is such a good idea please check out the thread linked above. The Question: Just how feasible is this? Would this be something that would be fairly easy to get working or would this be quite difficult? I have zero C# experience and my C++ experience is limited to two classes in high school almost 9 years ago, so while I have a high level conceptual idea of how it would work I don't actually know how to go about doing it. If someone thinks this is just a swell idea and wants to try writing it themselves then by all means please do!!
  4. Hi fellow KSP players, I'm trying to find a way to assign keys on the my keyboard to control the SAS, for exemple, i'd like to assign a key to select the PROGRADE, and an other one for RETROGRADE, so i dont need to use my mouse to click on the GUI button on the left of the navball. Is there a mod out there that does that ?? Is there a third party software that can link an area of my screen with a hotkey ??? Did anybody did that before ? any suggestion ?? Thanks a lot in advance Chris
  5. I was wondering which SI prefixes KSP uses in game, and are there any that are skipped? I ask because I know it skips km on your altimeter... (I'm so wrong! i guess I must typically timewarp from LKO to any other body and never noticed Km before! LOL ). It just goes from counting hundreds of thousands of meters and then rolls over into, if I recall correctly, Megameters. After that, I know I've seen Gigameter measurements before in the map views. Does KSP skip any other units than km, or is it just that one unit that gets skipped? I think I recall seeing km used in map view for distance to target, and in standard view to show distance to other objects. I just don't know if km is used for any orbital data... Altitude, Apoapsis, Periapsis, etc. I'm currently in the process of building a digital orbital data readout to fit into a larger scale custom controller for the game. I'd like to keep the units displayed on the controller matching the units displayed on screen. It'd be disorienting to have my readout show 100 km, and the altimeter on screen say 100000 m. I know they are the same, but it's not consistent. I'm occupying myself with continuing my controller build, since my motherboard unfortunately died. It's hard to run KSP to check for units of measure when your computer ain't even functioning. Who knows... Maybe I can get some progress in before the motherboard is repaired/replaced. Adittionally, I also wonder how high do the SI prefixes go? I want my readouts to go as high as they need to go to cover whatever KSP can throw at it... m, km, Mm, Gm, Tm, Pm, Em, Zm, Ym... What's the largest SI prefix KSP actually supports? Are there any other prefixes that KSP tosses out due to the number of digits the altimeter displays? Does the map view use km for any orbital characteristics? I got some nice 14 segment alphanumeric displays that are smaller than my main numeric displays. They are at the end of each relevant numerical display, and will show the correct SI units. I can make the displays support all units (as well as "m.S" and "ΔV"), but it will require more work to add the extra characters. Don't ask me why, but I'm doing a diode matrix ROM for them. It'll be kinda retro, but extra work to have extra characters supported. So... yeah... Just curious if I should plan on supporting them? Thanks in advance. *UPDATE* So, apparently, I am just blind. I never noticed the use of Km as an altimeter measurement, likely cause it occurs in a range that I rarely orbit at (or stay at for long). I can salvage this post though, as now I need to catalog the transition points. Where does KSP switch from m to Km, Km to Mm, Mm to Gm and so on. When I get my motherboard back from being serviced, I'll fire up KSP and check it out, recording the transition points here (unless someone beats me to it).
  6. Problem 1 I use a DialogGUIButton and an image (weird target sight) to create an image button (code). However, the resulting button is not quite what I desire. The default state of the button is missing the button texture while the highlighted state is missing the image. It acts as if the button texture is changed instead of overlaying multiple textures. Can anyone figure out why it does this? Problem 2 This image is explicitly set to 32 in both width and height (code) but the resulting image is stubbornly more than 32 in width as shown in the above picture (the green borders are drawn by DebugStuff). I do not understand why this particular image is stretched despite its width is locked to 32. The interface engine has a free reign to how to draw bunch of GUI components. So I edited the DialogGUILabel object next to the DialogGUIImage to be excessive in its width so that it "steals" all the free space, leaving the image no space to expand in width.
  7. KSP Alternate Resource Panel - Icon Overhaul I saw that KSP Alternate Resource Panel hasn't updated their icons in a long time, while other mods add new resources to the game. So I thought to completely overhaul the icons for those mods that add new resources. If a mod has their own icons, I'll maybe change them, if not, I'll make some new ones. Then I'll write MM configs to add the icon to its respective RESOURCE_DEFENITION. If the modders want to add the icons to their mods, I encourage them to do so. Also I would greatly appreciate it if I then get recognized for that. Supported mods: Alcubierre Warp Drive Community Resource Pack Deadly Reentry Extraplanetary Launchpads Firespitter Ioncross Crew Support KSP Interstellar Extended 'Project Orion' Nuclear Pulse Engine Snacks USI Life Support Mods that integrated my icons: BioMass DeepFreeze Continued L-Tech Scientific Industries Dependencies: KSP Alternate Resource Panel ModuleManager Downloads: Dropbox GitHub SpaceDock Credits: TriggerAu - For the KSP Alternate Resource Panel and icons. Olympic1 - For the icon packs. License: This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. See http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode for full details. Changelog: 0.10.3 - 2016.11.06 * Fixed issue not showing some icons 0.10.2 - 2016.11.05 * Added Construction * Added LqdFluorine * Added LqdNitrogen15 * Added LqdOxygen18 * Added Soil * New ModuleManager * Updated KSPI config * Removed DangIt and MissionController2 configs 0.10.1 - 2016.10.13 * Added Borate * Added ColonySupplies * Added Deuterium * Added HeavyWater * Added Helium4 * Added Hexaborane * Added LqdArgon * Added LqdWater * Added ParticleAcceleratorData * Added RefinedExotics * Added SaltWater * Added Silicates * Added Silicon * Added SolarWind * New ModuleManager 0.10.0 - 2016.07.24 * Added Carbon * Added Helium3 * Added Light * Added Lithium6 * Added Monazite * New ModuleManager 0.9.0 - 2016.05.18 * Added FSCoolant * New ModuleManager 0.8.0 - 2016.02.11 * Added Gypsum * Added IntakeLqd * Added Lead * Added ReplacementParts * Added UF4 * Fixed icons not showing when only CRP is installed * New ModuleManager 0.7.2 - 2015.1.19 * Fixed version file * Support for USI Nuclear Rockets * New ModuleManager 0.7.1 - 2015.10.25 * Made Fluorine a bit darker * Gave the NPU icons the correct size (32x16) 0.7.0 - 2015.10.25 * Added AblativeOil * Added Dirt * Added MaterialKits * Added NPU-250 * Added NPU-500 * Added NPU-1000 * Added NPU-2500 0.6.0 - 2015.08.20 * Merged all the icon packs into one big pack * Moved the icons into 1 folder * Merged the version files into 1 file * Merged the changelog files into 1 file * Moved the MM configs in their own folder * Added a :NEEDS check for the icons * Added a :FOR check * Updated ATM config * New ModuleManager * Renamed license files * Added mod to CKAN * Added a new flag * Added a README.txt * Moved the license into the readme 0.5.3 - 2015.07.04 * Added Fertilizer * Added SpecializedParts * New ModuleManager * Removed 'MAX' from .version file 0.5.2 - 2015.05.21 * Added LqdCO 0.5.1 - 2015.05.05 * Updated .version file * New ModuleManager * Changed LeadBallast 0.5.0 - 2015.05.02 * Updated to KSP 1.0 * New ModuleManager * Renamed Ammonia to LqdAmmonia * Renamed LiquidHydrogen to LqdHydrogen * Renamed Metal to Metals * Added Boron * Added DepletedFuel * Added Fluorine * Added KryptonGas * Added LqdCO2 * Added LqdDeuterium * Added LqdHe3 * Added LqdNitrogen * Added LqdTritium * Added MetallicOre * Added Mulch * Added NeonGas * Added Organics * Added Supplies * Added ThF4 * Added UraniumNitride * Removed BioMass * Removed Compost * Removed Deuterium * Removed ElectronicParts * Removed H2Peroxide * Removed Helium-3 * Removed LqdMethane * Removed MechanicalParts * Removed Polytetrafluoroethylene * Removed PunchCards * Removed Science * Removed StructuralParts * Removed Tritium 0.4.4 - 2015.04.29 * Changed Ore to MetalOre * Removed repairParts 0.4.3 - 2015.01.07 * Changed BioMass icon - I made and integrated new icons for the BioMass mod. * Updated license 0.4.2 - 2015.01.02 * Added ATM support * Updated version file 0.4.1 - 2014.12.22 * Added 36 icons from KSP Alternate Resource panel into the pack. * Removed LEGACY folder because MKS/OKS doesn't support it anymore. 0.4.0 - 2014.12.17 * Added Hydrates * Added Hydrogen * Added Machinery * Added SpareParts * Added StructuralParts * Added Uraninite * The three Machinery types are being collapsed into one type - Machinery. * The three repair resources are being collapsed into one resource - SpareParts. * The six manufactured goods are being collapsed into three goods - StructuralParts (new), ElectronicParts, MechanicalParts. * CommonRock, EnrichedRock, FrozenRock, MoltenRock, and RockDust are moved to the LEGACY folder. * The six MEP resources are moved to the LEGACY folder. 0.3.0 - 2014.09.17 * Added Karborundum * EnrichedSoil and ScoopedAir are moved to a LEGACY folder. This will prevent saves from breaking and new users can easily delete the LEGACY folder. 0.2.0 - 2014.08.06 * Added CommonRock * Added EnrichedRock * Added FrozenRock * Added MoltenRock * Added Rock * Added RockDust 0.1.2 - 2014.08.03 * Added ScoopedAir * Changed BioMass * Changed Compost * Changed EnrichedSoil * Changed Substrate 0.1.1 - 2014.08.02 * Added License * Changed Computers * Changed Karbonite * Changed MechanicalParts * Changed PlasticParts * Changed Polymers 0.1.0 - 2014.08.01 * Initial Release
  8. As far as I can tell, it seems to be impossible to make two different instances of the same PartModule class end up having two different min/max ranges for the same UI slider on the right-click context menu. It's acting for all the world as if all instances of the PartModule must share the same min/max values and whichever instance happens to have altered them most recently, those values get used from then on by all the other instances too. (in other words, it's behaving exactly like static member fields on a class would). Here's an example of how I'm trying to dynamically change the min/max range values at runtime per-instance: It does this by reading the values from the part.cfg file (so instances of this PartModule for different parts can have different settings for the range allowed on the slider), and applying the value to the slider, like so: BaseField field; DebugMsg("LaserDist is trying to config GUI panel fields from settings:"); DebugMsg(String.Format("Part name = {0}, MaxBendX = {1}, MaxBendY = {2}", part.name, MaxBendX, MaxBendY)); field = Fields["BendX"]; ((UI_FloatRange)field.uiControlEditor).minValue = -MaxBendX; ((UI_FloatRange)field.uiControlEditor).maxValue = MaxBendX; if( MaxBendX == 0f ) { field.guiActive = false; field.guiActiveEditor = false; } else { field.guiActive = true; field.guiActiveEditor = true; } I verified that it is indeed seeing a different value for MaxBendX for two different parts, and is indeed running the code above two different times once for each part, and that it is indeed storing two different values for the *other* properties of the field "BendX" just fine - i.e. the guiActive and guiActiveEditor boolean flags *are* indeed behaving differently for the two different instances. If I set one of them to have a MaxBendX of 0 and the other to have a MaxBendX of 15, then it *does* hide the one with a value of 0 just like the above code shows it trying to do. But when I try to make them both have a nonzero value for MaxBendX, but a different nonzero value from each other, I just can't seem to force them to have different settings for max and min. If I set one partA's MaxBendX to 15 in the part.cfg file, and set partB's MaxBendX to 20 in its part.cfg file, then either *both* end up having ranges from -15 to +15 on their sliders, or *both* end up having ranges from -20 to +20 on their sliders. Which one I end up with seems to depend on which part KSP loads last. I proved this by changing the names of the parts to make them get sorted differently, and thus get KSP to load them in the opposite order. If partA loads last, then both partA and partB have a range of -15 to +15. If partB loads last, then both partA and PartB have a range of -20 to +20. I can't get partA to go from -15 to +15 and make partB go from -20 to +20. Is there a way for me to break out of this static-like behavior of the minValue and MaxValue so I can make them differ or am I just stuck?
  9. I'm aware it's very basic so I'm sorry if it's been answered before. I have looked. This about the third time I've tried to get into modding ksp and each time I end up drowning in data I either don't need or that's out dated. I'm a descent programmer and have plenty of time to fiddle with things to figure them out, but I at least need a jumping off point. What I need is an in flight app button that opens a "hello world" GUI page. From there I'm sure I can solve most of my questions myself. Thanks much.
  10. Sorry if someone has asked this. I tried several searches and was not able to come up with an answer. I have recently reinstalled KSP since the release of 1.1.2. My UI buttons are now laid out vertically down the right side of the screen. Is there a way to change this so they are listed Hoizontally starting from the top right as they used to be?
  11. Hello, I'm relatively new to Unity still and I am having two issues that are GUI related. First, I am trying to set a .png image as the background for a GUI.button(rect, image). I just can not get the image to display as the background of the button. My second problem is that I am trying to use the same button to open another config UI for my mod so that players can enable and disable certain mod features. However, when I click the button (button appears even if the background image doesn't), my debug statement prints but the second UI doesn't draw to the screen. For the past several hours, I have searched forums, Github code (mainly Stage Recovery as it's code is commented and not a mess) and Unity 5.3 tutorials/examples/manual entries trying to figure out what I am doing wrong. Nothing has helped thus far. Hopefully someone here can spot my mistake. I greatly appreciate the help. public void OnDraw(int windowID) { draw_Icon_GUI(windowID); // GUILayout.Window(windowID, control_window_Rect, draw_Control_GUI, "Control", HighLogic.Skin.window); } void draw_Icon_GUI(int windowID) { Rect _Icon_Rect = new Rect(Screen.width - 40, 220, 40, 40); // Texture image = (Texture)Resources.Load("C:/Program Files (x86)/Steam/SteamApps/common/Kerbal Space Program/Resources/_symbol.png") as Texture; // <------- First attempt at displaying an image as the button background // GUI.skin.button.active.background = image; // <------- First attempt at displaying an image as the button background GUIContent image = new GUIContent("Click me", (Texture)Resources.Load("C:/Program Files (x86)/Steam/SteamApps/common/Kerbal Space Program/Resources/_symbol")); // <------- Third attempt at displaying an image as the button background if (image != null) { // Draw the background. // GUI.DrawTexture(wind_Icon_Rect, image); // <------- Second attempt at displaying an image as the button background } else Debug.Log("Bad texture: " + image); if (GUI.Button(wind_Icon_Rect, image)) { Debug.Log("[MOD : Gui Draw] Button was clicked."); // Prints when the button is clicked control_window_Rect = GUILayout.Window(windowID, control_window_Rect, draw_Control_GUI, "Control", HighLogic.Skin.window); // Doesn't execute ever. Worked before I started trying to make a button execute it. } } void draw_Control_GUI(int windowID) // Worked before I started trying to make a button execute it. { GUILayout.BeginVertical(); // toggle setup GUILayout.Label("Toggle", HighLogic.Skin.label); wind_toggle = GUILayout.Toggle(wind_toggle, "Toggle", HighLogic.Skin.toggle); // Slider setup hSliderValue = GUILayout.HorizontalSlider(Mathf.Round(hSliderValue), 0f, 10f); GUILayout.Label("Scaling = " + Mathf.Round(hSliderValue), HighLogic.Skin.box); // End the Groups and Area GUILayout.EndVertical(); GUI.DragWindow(); // GUI window is also having issues with not being draggable even when this section of code worked } Above is the code that handles my GUI drawing. OnGUI() is in another class but all id does is call OnDraw(int windowID). I put // <---- comments where I believe my code is having the issues. I greatly appreciate any help I can get. Thank you.
  12. Hello, I am in the process of creating a new mod and I find myself stuck on correctly creating two separate GUI's. The first is very simple as it has a toggle, a horizontal slider and 2 labels all inside of a window and all automatically positioned by using GUILayout.*. The second GUI is actually a compass that I want to display in the game window. I know how to do the rotations for the needle but I don't have much of a clue as to how to begin. I've read through forums, Unity how-to's etc and while they helped somewhat with the first GUI, they offered no help on the second. Here is all of my GUI code: Main Class: GUI_Code.GUI_Draw gdraw = new GUI_Code.GUI_Draw(); private void OnGUI() { gdraw.OnGUI(1); } My GUI Class using UnityEngine; namespace GUI_Code { public class GUI_Draw : MonoBehaviour { public bool toggle = true; public float hSliderValue = 0.0F; public Texture2D icon; private Rect windowRect = new Rect(10, 30, 100, 90); // Texture2D compass; // compass image // Texture2D needle; // needle image // Rect compass_rect = new Rect(10, 10, 200, 200); // create a new rectangle at position (x = 1, y = 10) with size (x = 200, y == 200) // float angle; // angle to rotate the needle // Quaternion rot; // Vector3 axis; // but an axis variable must be provided as well public void OnGUI(int windowID) { // Make a background box GUI.Box(new Rect(10, 10, 150, 90), "1st GUI Menu"); // GUI.DrawTexture(compass_rect, compass); // Vector2 compass_widget_center = new Vector2(compass_rect.x + compass_rect.width / 2,compass_rect.y + compass_rect.height / 2); // find the compass center coordinates // Matrix4x4 svMat = GUI.matrix; // save gui matrix // GUIUtility.RotateAroundPivot(angle, compass_widget_center); // prepare matrix to rotate // GUI.DrawTexture(compass_rect,needle); // draw the needle rotated by angle // GUI.matrix = svMat; // restore gui matrix // Draw all of the buttons inside of the window windowRect = GUI.Window(windowID, windowRect, WindowFunction, "My Window", HighLogic.Skin.window); } public void WindowFunction(int windowID) { // Begin the singular Horizontal Group GUILayout.BeginHorizontal(); // Toggle setup wind_toggle = GUILayout.Toggle(toggle, "Toggle", HighLogic.Skin.toggle); GUILayout.Label("Toggle", HighLogic.Skin.label); // GUILayout.BeginVertical(); // Slider setup hSliderValue = GUILayout.HorizontalSlider(1f, 0f, 10f); GUILayout.Box("Wind Scaling = " + Mathf.Round(hSliderValue), HighLogic.Skin.box); // Compass setup // GUILayout.Label("Direction"); // End the Groups and Area // GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); // This last thing checks whether the right mouse button or middle mouse button are clicked on the window. If they are, we ignore it, otherwise we GUI.DragWindow() // Calling that allows the window to be moved by clicking it (anywhere empty on the window) with the left mouse button and dragging it to wherever you want. if (!Input.GetMouseButtonDown(1) && !Input.GetMouseButtonDown(2)) GUI.DragWindow(); } } } The first GUI is the uncommented lines in OnGUI(int window ID). It has 2 major problems that I don't know how to correct. First, the window isn't draggable even though I make it draggable in the last line of OnGUI(int window). Second, in the Debug.Log, I am getting "[Exception]: InvalidOperationException: Operation is not valid due to the current state of the object" The second GUI is the commented out lines. I am trying to make a simple 2D compass similar to: How do I even go about setting this up and what's wrong with my first GUI? I'll keep looking through forums and Github code but so far, it's been dead ends. Thank you in advance. Also, if you know how to do it, I'd like both the 1st GUI and the compass to be attached to an icon at the right side of the screen. I am assuming that would be a 3rd GUI with just a toggle that did 1st_GUI.show() and compass.show() or 1st_GUI.hide() and compass.hide() (I know the syntax is wrong but you get the idea). Is this the correct way to do this?
  13. It's all great that now we can adjust how many portraits are there, except for one thing - the maximum count. It seems to be dependent on the screen width and on my 1280p it refuses to show more than two, even if there's enough space for the third at default UI scale (and it doesn't change even if the UI scale is set to minimum). So, with the additional UI scale settings announced, can the portrait count be addressed too? Maybe make the limit dependent on the actual space right of the navball and the actual scale of the portraits. Another thought: what about the option to add second row of the portraits?
  14. Hi all, This is a (re)request for a mod to move the staging icons to the top of the screen, and the stock toolbar to be returned to its original orientation. My ideal location would be between the timer and the altimeter. The purpose is to have all information for flight at the top and bottom of the screen including any text, ideally within a 180px range on a 1080 height screen. This would keeping the centre of the screen free for 720px cinematic recording. The navball is also too large but other mods deal with this (unless this mod creator wanted to look into this as well!) I have requested this before, but it was suggested that you wonderful modders would want to wait till 1.1 dropped with the changes in Unity 5. Is this even possible! Thanks in advance! Peace.
  15. Hey everyone, like most of you I've been playing around with KSP 1.1 and naturally my mod list is starting to bulk in size. Something I noticed was that my Career save had a significantly better frame rate than a Sandbox save, even when the Career save have multiple ships and the Sandbox save was fresh. (Both stock and modded) I decided to try test this out and find out if a particular mod was responsible for this, alas I couldn't find any evidence. I did however come across this and couldn't come up with any real reason as to why this is a thing: With HUD: http://imgur.com/E0ARY9g Without HUD (F2): http://imgur.com/1MuzwkF Toggling between (F2): http://imgur.com/9VvWOr4 Video showing the FPS drop: https://youtu.be/NFWCOitSov0 I've tried taking away the bulkier mods, but as far as I can tell this happens regardless of how many you have installed and only gets worse the more you install. What's interesting is my peak frame rate (the rate with no HUD) never dips to an unacceptable level, only when I turn the HUD back on does the frame rate take a crap. This problem appear to be cumulative and even happens in stock, hence my posting here. As I include more and more mods to the game the frame rate gets progressively lower unless I disable the HUD and then my FPS goes back to normal. If any mod creators or even a developer could answer this question I would be grateful as I'm at a loss. PS: Does anyone know of a mod that is compatible with 1.1 that give me a seperate HUD on my second screen? I'd happily gain more frames if it means tilting my head a little, thanks. Specs: WIndows 10 I7 2600k 8Gb DDR3 RAM Inno3D GTX 780 KSP: Steam
  16. I know that it is a hard work to stay on this project but.. the load/save system could be better if you devs can add some filters like date/time sorting in the load/save GUI.. Imagine that i always have to open the save folder to remember which is the latest saved game.. It could be good to have an auto-saving system too, where we can set periodically autosaving files! By the way, good job and keep working!
  17. Hello community. I had a cool little GUI idea that could make your KSP save your KSP save. Basically, my idea was you could customize the colors of each orbit and even add more options to the craft type selection menu. As in you could make your 'GPS' Satellites orange, your scanners green, etc. How cool would that be! I thought maybe you could even customize planet and moon orbit colors. You could customize your map view and even make all of your craft more organized. I know this could be a mod, but for the soon releasing XBONE, WiiU, and PS4 versions it adds a whole new level of organization, customization, and creativity. Another idea of mine was to have the ability to edit orbits with maneuvers from map view at the KSC for interjection burns, stabilization burns, and panic edits for satellites. My final idea was to be able to change the name and craft type from map view. To change a satellite or craft name, I have to go to the craft and find the command pod, I believe this should be more streamlined. -aperture science employee
  18. As per this thread http://forum.kerbalspaceprogram.com/index.php?/topic/130796-admin-building-to-control-contract-types/#comment-2381009 I'd like some guidance on what it would take to make this. What I would need: A Gui with sliders A way to change inputs of the sliders based on a building level A way to manipulate contract type spawning percentages In the Contracts.cfg I see entries like this: Recovery // Rescue and Recovery Contracts that appear to be the categories I can manipulate. Preferably I'd be able to make this happen with addons like MM but I doubt this will happen- any advice, or pointing to some examples that use similar code would be great. I am not the greatest coder on the planet but I'd like to see this as an addon- if it doesn't require too much brain power I'll give it a shot
  19. I'm not sure if this is a bug or a "feature", but thought I should share the fact that when you try and save your progress and get to type in a filename, simply pressing ENTER at this point doesn't actually save anything, although it does close the dialog box. I found out the hard way when my lander arrived in orbit around the Mun with 3 full radial fuel tanks that I forgot to connect! I quit back to the main menu but couldn't find my saves. An equally foolish, yet successful rescue mission ensued so Jeb was saved. Would it be possible to have ENTER commit the file AND close the dialog? TLDR; Pressing ENTER when saving a file doesn't save a file.