Jump to content

Romfarer

Members
  • Posts

    522
  • Joined

  • Last visited

Everything posted by Romfarer

  1. You still get an option to launch anyway.
  2. The AppLauncher or Application Launcher is a gui toolbar we use to display the MessageSystem, Resource system, currency widgets, contracts app etc. It is also used by mods. The note i had about it this week only concerns the mods and won't have any effect on the stock apps i mentioned. The main part of the update was to make it launch correctly wherever the modders choose to launch the game, for testing purposes mainly in order to speed things up a bit. Before it was rigged to the spacecenter and wouldn't display if a modder used the "launch directly to a scene" method. Making the applauncher active like this had a natural side effect (we can make it display in the mainmenu), so i enabled it because modders have requested this functionality in the past. Again, if you are not a modder these changes won't have any effect on your game experience.
  3. Editor Toolbar Modding Guide: The editor toolbar runs of the class PartCategorizer. Each button on the toolbar is handled by the class PartCategorizer.Category and the actual button is a PartCategorizerButton. There are a myriad of ways to customize your custom filters using these classes but for simplicity i have added two static methods to PartCategorizer which simplifies the process of adding custom filters. How to add a simple custom filter: The following code example explains how to add a simple custom filter. //instantiate the icon Icon myIcon = new PartCategorizer.Icon("my icon", iconTexture_normal, iconTexture_selected); //add a custom filter to the toolbar Category myFilter = PartCategorizer.AddCustomFilter("my filter", myIcon, Color.yellow); //add subcategories to the filter you just added PartCategorizer.AddCustomSubcategoryFilter(myFilter, "filter 1", myIcon, p => p.name.Contains("engine")); PartCategorizer.AddCustomSubcategoryFilter(myFilter, "filter 2", myIcon, p => p.name.Contains("fuel")); PartCategorizer.AddCustomSubcategoryFilter(myFilter, "filter 3", myIcon, p => p.name.Contains("wing")); Lets break it down "line by line" Icon myIcon = new PartCategorizer.Icon("my icon", iconTexture_normal, iconTexture_selected); and the signature... /// <summary> /// Constructor for Icon /// </summary> /// <param name="name">The identifier of the icon</param> /// <param name="iconNormal">The "normal" state of the icon</param> /// <param name="iconSelected">The "selected" state of the icon</param> /// <param name="simple">If true you only have to specify the selected state of the icon. A black "normal" state will be generated automatically.</param> public Icon(string name, Texture iconNormal, Texture iconSelected, bool simple = false) Icons are instantiated using the PartCategorizer.Icon class. It's signature is Icon(string name, Texture iconNormal, Texture iconSelected, bool simple = false). "name" is not really important when instantiating the icons via code like this. But if you had loaded the icon by placing it in GameData\Squad\PartList\SimpleIcons or Icons this would be the identifier used to retrieve the icon with PartCategorizer.Instance.GetIcon("myIcon"); That said you can choose wether to instantiate the icon by code (leaving it for your button only) or put it in those folders and make it available for everyone to use on their custom categories. static public Category AddCustomFilter(string filterName, Icon icon, Color colorButton) and the signature... /// <summary> /// Adds a filter to the "right side" toolbar list. /// </summary> /// <param name="filterName">The name of the filter which will appear on the tooltip</param> /// <param name="icon">The icon for the button</param> /// <param name="colorButton">The color of the button</param> /// <returns>A reference to the Category wrapper</returns> static public Category AddCustomFilter(string filterName, Icon icon, Color colorButton) The signature is pretty much self explanatory. PartCategorizer.AddCustomSubcategoryFilter(myFilter, "filter 1", myIcon, p => p.name.Contains("engine")); and the signature... /// <summary> /// Adds a filter subcategory to the given filter which will appear on the right side of the toolbar /// </summary> /// <param name="mainFilter">The filter (Category) you are adding this filter to</param> /// <param name="subFilterName">The name of the filter which will appear on the tooltip</param> /// <param name="icon">The icon for the button</param> /// <param name="exclusionFilter">Lambda expression which specifies which parts to show when this filter is active</param> /// <returns>A reference to the Category wrapper</returns> static public Category AddCustomSubcategoryFilter(Category mainFilter, string subFilterName, Icon icon, Func<AvailablePart, bool> exclusionFilter) This is almost the same as the method to add a main filter. Except the exclusionFilter which is the whole point of the filter. In this simple example i have specified the expression p => p.name.Contains("engine"). All this does is filter out all parts where "engine" appears in the part name. "p" is a reference to AvailablePart and you can use any of it's fields to filter parts. Some additional examples: p => p.moduleInfos.Exists(q => q.moduleName == "Parachute") This will filter out all parts that has a partModule called "Parachute". p => p.resourceInfos.Exists(q => q.resourceName == "Liquid Fuel") This will filter out all parts containing "Liquid Fuel". p => p.manufacturer == "Probodobodyne Inc" This will filter out all parts made by Probodobodyne Inc. When to add custom filters: The editor toolbar is ready to receive custom filters when this GameEvent is fired. GameEvents.onGUIEditorToolbarReady How to add auto generated filters: You may also want to make filters in a more automated way. //instantiate the icon Icon myIcon = new PartCategorizer.Icon("my icon", PartCategorizer.Instance.fallbackIcon.iconNormal, PartCategorizer.Instance.fallbackIcon.iconSelected); //add a custom filter to the toolbar Category myFilter = PartCategorizer.AddCustomFilter("my resource filter", myIcon, Color.yellow); //Get a unique list of available resources List<String> resources = new List<string>(); foreach (AvailablePart ap in PartLoader.LoadedPartsList) foreach (AvailablePart.ResourceInfo apr in ap.resourceInfos) if (!resources.Contains(apr.resourceName)) resources.Add(apr.resourceName); foreach (string str in resources) { string myResourceName = str; //It is imperitive to declare this //add subcategories to the filter you just added PartCategorizer.AddCustomSubcategoryFilter(myFilter, "filter by " + myResourceName, myIcon, p => p.resourceInfos.Exists(q => q.resourceName == myResourceName)); } This is basically the same code we use to generate the stock resource filter and it filters parts by the resource it holds. Keep in mind, when you generate filters like this, it is important to declare the myResourceName string within the for loop.
  4. All plugins updated for 0.90 compatibility enjoy
  5. Ok the issue here is that the Application Launcher hides itself in GameEvents.onGameSceneLoadRequested as well. In 0.25 i'm therefore adding a second level event which will fire just before the Application Launcher is about to become !Ready. The event looks like it will be called GameEvents.onGUIApplicationLauncherUnreadifying and it will send with it the GameScene it is about to enter just like onGameSceneLoadRequested.
  6. Never seen that bug before. How does it affect the lazor gui?
  7. Whatever gui framework we go with, we will always have to extend it with our own implementations for non-standard stuff. Currently there are 3 gui frameworks in action in ksp. The only point atm where EzGUI comes short is in the way it handles text and especially text input. We have overcome the biggest hurdles with text display though. If the Unity GUI overhaul delivers better way of handling text input we will probably start using it as well. That said, just because unity comes out with a new way to handle GUI programming doesn't mean we will re-write the whole GUI code of ksp to match it as it would be an extremely time consuming task.
  8. This would mean that the slider moves with 0 increments and then only snaps to an increment once you release the knob. It's easier to implement though and might actually work better for setups with large increments.
  9. Please send me a persistence or save file with a little description of what exactly you have to do to reproduce this bug.
  10. If you can't see the texture you have to send me your log so i can figure out why it's not loading properly...
  11. Should work fine afaik, been playing around with it a bit myself lately testing some experimental planes. I flew around kerbin in this plane http://i.imgur.com/5Rk0BrP.png
  12. I see your point and it is a fair one. But i can't just revert it back to allowing timewarp at extended loading distances cause in my opinion that creates move havoc. So i guess the only option is to run a check for vessels that would be destroyed by activating timewarp and alerting the player about it.
  13. @montyben101 I'm having problems seeing what exactly causes the bug you are experiencing. From what you have said it involves the robotic arms, grabbing a kerbal on eva and not being able to recover. It's not much to go on.
  14. I'm confused. The extended loading range of my plugin sure adds stress on the engine and it is to be expected, after all there is a good reason why the loading range was set the way it is within the game. It was never the goal of my plugin to destroy any crafts or kerbals automatically, but sure, careless use of it will in some cases bring havoc where you don't expext it.
  15. Ok guys, i have updated the documentation for the application launcher. Let me know if you have any questions. Suggestions are always welcome.
  16. Timewarping within the atmoshere makes extra stress on your own craft as im sure you have noticed. Imagine the stress on vessels far away.
  17. What you should do is this, when starting up: check if ApplicationLauncher.Ready. If it is not ready just subscribe to the event GameEvents.onGUIApplicationLauncherReady. The applauncher starts up when you transition into space center from mainmenu and is destroyed when you exit to mainmenu. And it is Ready when it becomes alive in a scene, it becomes !Ready when you transition into a new scene. But of course, it's probably going to work even it it's not Ready, feel free to experiment and let me know what you discover ;-) More details will follow as i edit this thread.
  18. First of all im going to need you to send me your output_log.txt. A description of what is happening when would also help greatly. Also, have you downloaded and installed version 34 of lazor?
  19. In case you have tried adding your mod to the application launcher, please post your feedback here.
  20. If you want to play with fire, rip "random" parts out of my source code, put it together in a plugin and see what happends In all honesty, i'm not going to "prosecute" you for taking a few lines out of my code and making it into a plugin, people have done this for a long time now. Just be aware that there is a good chanse those few lines require a whole lot of other stuff that is not so easy to see just by looking at the code. It is true that lazor resets the loading distances to default when timewarping and automatically restores your setting once timewarp is disengaged. The reason is quite simple: Say you have 10 vessels landed on the surface somewhere, you have a lazor enabled craft in orbit within the set loading distance from the landed vessels. If you then timewarp at max timewarp you will then rapidly load and unload those vessels every time you make a pass. This will eventually lead to a crash because the engine can't handle loading and unloading that fast.
  21. Ok I made some changes to the plugin loading now and textures should be loading properly. Let me know.
  22. All plugins should now be 0.24 compatible. Enjoy Changelog v34 (July 22): All plugins: 0.24 Compatibility
×
×
  • Create New...