Complete engine config select UI revamp#355
Conversation
…nality - Updated localization string for current engine configuration to be more concise. - Refactored DrawConfigSelectors method to utilize BuildConfigRows for better structure and clarity in the engine configuration UI. - Enhanced the configuration row definition structure for better data handling and display. - Implemented dynamic column width calculation for the configuration table to improve layout adaptability. - Adjusted GUI styles for the editor panel to enhance visual consistency and usability.
- Implemented GetCurrentFlightData method to retrieve the current flight data for a part. - Implemented GetMaximumData method to retrieve the maximum data value for a part. - Added GetDataPercentage method to calculate the percentage of current data relative to maximum data. - Enhanced reflection logic to safely access TestFlightCore methods.
…ta columns and update visibility logic
… into a dedicated UI folder
…roving tooltip styles
|
Some other issues, which I think are unrelated to the patch bug?
|
The first issue, I will look into, I will probably end up making it so only one may be open at a time. |
…Slider Controls - Set default view to compact mode in EngineConfigGUI. - Introduced slider for burn time with input field and include ignition toggle. - Updated survival probability calculations based on slider time in EngineConfigGUI. - Modified reliability section to display survival probabilities for starting, current, and max data units. - Improved layout and styling for survival probability display in EngineConfigInfoPanel. - Refactored simulation controls to include new slider and checkbox for ignition. - Removed redundant failure rate summary section from EngineConfigInfoPanel.
…ng engine config processing
| /// </summary> | ||
| public static class EngineConfigPropellants | ||
| { | ||
| private static readonly FieldInfo MRCSConsumedResources = typeof(ModuleRCS).GetField("consumedResources", BindingFlags.NonPublic | BindingFlags.Instance); |
There was a problem hiding this comment.
Why reflection when GetConsumedResources() exists?
| public static bool userClosedWindow = false; | ||
|
|
||
| // Track the currently open GUI to ensure only one is visible at a time | ||
| private static ModuleEngineConfigsBase currentlyOpenGUI = null; |
There was a problem hiding this comment.
This should get unassigned on leaving editor scene to prevent a :smol: leak
| string[] headers = { | ||
| "Name", Localizer.GetStringByTag("#RF_EngineRF_Thrust"), "Min%", | ||
| Localizer.GetStringByTag("#RF_Engine_Isp"), Localizer.GetStringByTag("#RF_Engine_Enginemass"), | ||
| Localizer.GetStringByTag("#RF_Engine_TLTInfo_Gimbal"), Localizer.GetStringByTag("#RF_EngineRF_Ignitions"), | ||
| Localizer.GetStringByTag("#RF_Engine_ullage"), Localizer.GetStringByTag("#RF_Engine_pressureFed"), | ||
| "Rated (s)", "Tested (s)", "Ign Reliability", "Burn No Data", "Burn Max Data", | ||
| "Survival @ Time", | ||
| Localizer.GetStringByTag("#RF_Engine_Requires"), "Extra Cost", "" | ||
| }; | ||
| string[] tooltips = { | ||
| "Configuration name", "Rated thrust", "Minimum throttle", | ||
| "Sea level and vacuum Isp", "Engine mass", "Gimbal range", "Ignitions", | ||
| "Ullage requirement", "Pressure-fed", "Rated burn time", | ||
| "Tested burn time (real-world test duration)", | ||
| "Ignition reliability (starting / max data)", | ||
| "Cycle reliability at 0 data", "Cycle reliability at max data", | ||
| "Survival probability at slider time (starting / max data)", | ||
| "Required technology", "Extra cost for this config", "Switch and purchase actions" | ||
| }; |
There was a problem hiding this comment.
Should move all the rest to loc file too. Weird if some are there and others aren't.
| int visibleRows = Mathf.Min(actualRows, ConfigMaxVisibleRows); | ||
| int scrollViewHeight = visibleRows * ConfigRowHeight; | ||
|
|
||
| var scrollStyle = new GUIStyle(GUI.skin.scrollView) { padding = new RectOffset(0, 0, 0, 0) }; |
There was a problem hiding this comment.
Unwise to allocate new styles twice per frame.
| internal string GetTechString(ConfigNode node) | ||
| { | ||
| if (!node.HasValue("techRequired")) | ||
| return "-"; | ||
|
|
||
| string tech = node.GetValue("techRequired"); | ||
| if (ModuleEngineConfigsBase.techNameToTitle.TryGetValue(tech, out string title)) | ||
| tech = title; | ||
|
|
||
| var words = tech.Split(' '); | ||
| if (words.Length <= 1) | ||
| return tech; | ||
|
|
||
| var abbreviated = words[0]; | ||
| for (int i = 1; i < words.Length; i++) | ||
| { | ||
| if (words[i].Length > 4) | ||
| abbreviated += "-" + words[i].Substring(0, 4); | ||
| else | ||
| abbreviated += "-" + words[i]; | ||
| } | ||
| return abbreviated; | ||
| } |
There was a problem hiding this comment.
Never mind about allocating gui styles. This is a lot worse!
I wonder if we could show only the year number here. Or perhaps just make the text smaller? Make it wrap?
|
|
||
| #endregion | ||
|
|
||
| #region RP-1 Credit Integration |
There was a problem hiding this comment.
Should extract such integrations into a separate file.
| string[] failureTypes = { "Shutdown", "Perf. Loss", "Reduced Thrust", "Explode" }; | ||
| int[] failureDu = { 1000, 800, 700, 1000 }; | ||
| float[] failurePercents = { 55.2f, 27.6f, 13.8f, 3.4f }; |
There was a problem hiding this comment.
Probably not the best to hardcode all the TF values. Some of those might be subject to change.
|
The configuration menu sometimes doesn't show up when selecting parts with symmetry. It's a bit weird to reproduce but you should run into it fairly quickly if you try reconfiguring a set of RCS thrusters and a cluster of engines a bunch. I suspect it has something to do with how the |
| if (propNode.TryGetValue("ratio", ref ratioStr2) && float.TryParse(ratioStr2, out float ratio) && totalMassFlow > 0f && totalRatio > 0f) | ||
| { | ||
| float propMassFlow = totalMassFlow * (ratio / totalRatio); |
- Introduced a toggle for switching between percentage and time modes for survival probability calculations. - Updated the EngineConfigGUI to handle new slider inputs for percentage and time, ensuring values persist across engines. - Modified the reliability section to display survival probabilities based on the selected mode, adjusting calculations accordingly. - Enhanced the UI to reflect changes in survival probability display, including dynamic headers and tooltips. - Updated the simulation controls to accommodate the new mode, allowing users to input either a survival percentage or a burn time.
Yes, Siimav told me that the proper way to handle this was to do it through the original PR, but I REALLY didn't want to go through the process of disentangling this. * Added ClickThroughBlocker * Added a Settings option to have the Engine GUI always open when engine is clicked on * Moved the TestFlight failures into an external file so they can easily be updated if TF ever changes them * Fixed the RCS Graphs attempting to open even without TF failures attached to them * Fixed the propellant consumption math * Removed the reflection to get the RCS propellants and used GetConsumedResources() instead * Cached the GUIStyle allocations as static properties to stop the extra calls per frame * Fixed the issue where engines in symmetry were failing to open the window. The previous design was only trying to access the "first" engine that was placed * Removed the tech abbreviations * Moved the remaining items into localization * Extracted the RP-1 credit information into a separate file
* Refactor engine configuration UI for improved readability and functionality - Updated localization string for current engine configuration to be more concise. - Refactored DrawConfigSelectors method to utilize BuildConfigRows for better structure and clarity in the engine configuration UI. - Enhanced the configuration row definition structure for better data handling and display. - Implemented dynamic column width calculation for the configuration table to improve layout adaptability. - Adjusted GUI styles for the editor panel to enhance visual consistency and usability. * Add TestFlight data retrieval methods to TestFlightWrapper - Implemented GetCurrentFlightData method to retrieve the current flight data for a part. - Implemented GetMaximumData method to retrieve the maximum data value for a part. - Added GetDataPercentage method to calculate the percentage of current data relative to maximum data. - Enhanced reflection logic to safely access TestFlightCore methods. * Implement feature X to enhance user experience and optimize performance * Implement feature X to enhance user experience and fix bug Y in module Z * Refactor column management in ModuleEngineConfigs to remove unused data columns and update visibility logic * Refactor code structure * Even more reorganization of the engine config UI code. * Reorganize engine config UI code structure by moving UI-related files into a dedicated UI folder * Enhance engine configuration UI by adding close functionality and improving tooltip styles * MM Patch fix, and other fixes * feat: Enhance Engine Configuration GUI with Survival Probability and Slider Controls - Set default view to compact mode in EngineConfigGUI. - Introduced slider for burn time with input field and include ignition toggle. - Updated survival probability calculations based on slider time in EngineConfigGUI. - Modified reliability section to display survival probabilities for starting, current, and max data units. - Improved layout and styling for survival probability display in EngineConfigInfoPanel. - Refactored simulation controls to include new slider and checkbox for ignition. - Removed redundant failure rate summary section from EngineConfigInfoPanel. * refactor: Simplify TestFlight UI support configuration by consolidating engine config processing * Enhance Engine Configuration GUI with Survival Probability Modes - Introduced a toggle for switching between percentage and time modes for survival probability calculations. - Updated the EngineConfigGUI to handle new slider inputs for percentage and time, ensuring values persist across engines. - Modified the reliability section to display survival probabilities based on the selected mode, adjusting calculations accordingly. - Enhanced the UI to reflect changes in survival probability display, including dynamic headers and tooltips. - Updated the simulation controls to accommodate the new mode, allowing users to input either a survival percentage or a burn time. * Introduce new RealFuels tank configuration window Replaces the legacy TankWindow with a modernized UI overhaul (RealFuelsWindow). This includes a new Life Support planner, quick-fill engine presets with ratio status indicators, resource locking, and a searchable available propellants list. The project target framework is also updated to v4.8 to support the new UI components. * Improve the Layout and Design of the new Tank UI Window * Fix issues from PR #355 Yes, Siimav told me that the proper way to handle this was to do it through the original PR, but I REALLY didn't want to go through the process of disentangling this. * Added ClickThroughBlocker * Added a Settings option to have the Engine GUI always open when engine is clicked on * Moved the TestFlight failures into an external file so they can easily be updated if TF ever changes them * Fixed the RCS Graphs attempting to open even without TF failures attached to them * Fixed the propellant consumption math * Removed the reflection to get the RCS propellants and used GetConsumedResources() instead * Cached the GUIStyle allocations as static properties to stop the extra calls per frame * Fixed the issue where engines in symmetry were failing to open the window. The previous design was only trying to access the "first" engine that was placed * Removed the tech abbreviations * Moved the remaining items into localization * Extracted the RP-1 credit information into a separate file * Final UI Updates * Added MUCH better RCS / Generic Engine UI to help trigger players to upgrade their RCS levels. * Fixed an issue where the Tank UI wouldn't work properly on symmetry items * Fixed the issue where locking a resource did not persist when the UI closed * Allow direct selection of Liters when adding a new resource to a tank * Changed the QUICK FILL section to treat the entire row as a button * Removed the legacy TankWindow.cs and removed the never used RealWindowsPAW code. --------- Co-authored-by: Arodoid <ockidj@gmail.com>
|
#360 supersedes this right? If so, this can probably be closed. |
|
Merged into UIOverhaul branch and released. |



Engine config UI overhaul
This PR is a full revamp of the engine configuration selector.
Previously this was just a flat list of configs where you had to hover around, eyeball differences, and dig through other menus to understand what you were actually picking. A lot of important data either wasn’t visible or wasn’t even accessible from this screen.
What’s new
Table-based config view
Probability and reliability explained
Built-in simulation tools
Clear risk messaging
2026-02-08.23-46-07.mp4