Jump to content

Xyphos

Members
  • Posts

    1,083
  • Joined

  • Last visited

Everything posted by Xyphos

  1. Well, I've tried it, and that's not the case. var inputDeltaV = new DialogGUITextInput( "", "0 m/s", false, 8, s => { var i = 0; if (int.TryParse(s, out i)) MinimumDv = i; else deltavInput.text = MinimumDv.ToString(); return MinimumDv.ToString(); }, 32f ); the result of testing: if seems the callback was given a code signature of Func<string, string> perhaps it's a typo on the dev's part? maybe it should be just Func<string> providing a returned value doesn't seem to do anything. return "French Fries" // does nothing return "" // does nothing return null; does nothing
  2. so... the callback is for relaying the text input to whatever routine, and the return value is unnecessary for the routine to work, but still requires it. seems pointless to have a return value. why not just a void?
  3. okay, but what's the callback for, and why does it require a returned value?
  4. What's the placeholder field for? how do I use it properly? What's the set callback for? how do I use it properly?
  5. That worked! thanks. but now I have a new problem: the scroll window defaults to the middle, I want it to default to the top...
  6. I'm currently in the process of converting Gary Court's KORC web app to an in-game version with automatic part detection. so far, the inner workings are working, but it's the UI part that I'm struggling with, and I don't know how to fix it. below is a picture of the problem; the scroll list is supposed to scroll, and there's more engine options not shown because it's not scrolling properly. anyone know how to fix this?
  7. I need to determine if the player has unlocked a part, but don't know how to check.
  8. That actually helps a lot - knowing where to "draw" the sections and being able to visualize them. I'll try it.
  9. sadly, I may need to, as my UI will require the use of scrolling panes, comboboxes, etc. DMagic supposedly wrote a tutorial but I'm having trouble following it.
  10. Dialog, from what I understand, we're not supposed to use GUILayout anymore? and thanks for your example, I'll try that.
  11. no really, I need a good tutorial for UI programming, I don't seem to be getting anywhere by trial-and-error
  12. The old GUILayout is great for complex UI's with it's robust set of features. the new DialogUI system is good for simple UI's like popup messages, but a complete pain in the cheeks to develop. if I were you, I'd combine the two and dread the day when the old GUILayout is no more
  13. I can't find the dialog code to create a ComboBox (aka DropDownMenu) please don't tell me we have to create our own from scratch?
  14. I need a UI window for options and information output, the options and output displays have to be scrollable as they do not have a finite size, any number of elements may exist within them. is there any UI tools that emulate the behaviour of visual studio's form editor or am I stuck using Unity?
  15. Thanks for the clarification, @Starwaster - it's appreciated. Lerp performs Linear Interpolation. I checked.
  16. great ideas. I'll try to incorporate them, but I'm still working out the details. edit: with some math work, it could be possible to simulate the atmosphere pressure at each stage.... but first, I am gonna make the all-or-nothing as the basis for the mod, then further develop it to full feature
  17. but my next question will be GUI related; all those part options surely will need a scrolling window pane. while I'm confidant in my C# skills, I've very little experience in developing KSP plugins, and KSP's API is huge and fairly cryptic.
  18. I'm attempting to convert Gary Court's optimal rocket calculator to an in-game version. Gary's json/javascript code has all the data embedded, but only for stock parts. I wanna go beyond that and have every part, stock and mod included without needing external configs. also, I forgot KER had a part simulator, so now I have to scrap my current test version and start over using parts of KER code.
  19. I got an engine part via PartLoader.LoadedPartsList now I know how to get the thrust and ISP info, but I want to know how do I compute the atmospheric ISP and atmospheric thrust. I assume I use the atmCurve node and use the key that has an index of 1, then use the second number as a multiplier? what's the third and fourth numbers for?
  20. four for four! you're on a roll, bro! I didn't even know PartLoader existed. this will save me a TON of ConfigNode code. THANKS!
  21. I've encountered a weird problem. when I try to read a part config node, I can get the name and other values just fine but for some reason, "cost" isn't available - it's gone, as if KSP is masking this value for some reason. does anyone know a reliable way to get the cost of a part?
×
×
  • Create New...