Complete engine config select UI revamp#355
Complete engine config select UI revamp#355jackwrichards wants to merge 12 commits intoKSP-RO:masterfrom
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 |

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