alexguirre / RAGENativeUI

MIT License
115 stars 38 forks source link

Allow menus with no items #58

Closed alexguirre closed 4 years ago

alexguirre commented 4 years ago

See this example from the vanilla game: menu

Currently it crashes:

[4/11/2020 10:57:26 PM.835] MenuExample: 
[4/11/2020 10:57:26 PM.836] MenuExample: ==============================
[4/11/2020 10:57:26 PM.837] MenuExample: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[4/11/2020 10:57:26 PM.837] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.837] MenuExample: Origin: Game fiber "<UNNAMED THREAD>".
[4/11/2020 10:57:26 PM.838] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.838] MenuExample: Exception type: System.DivideByZeroException
[4/11/2020 10:57:26 PM.838] MenuExample: Exception message: Attempted to divide by zero.
[4/11/2020 10:57:26 PM.839] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.839] MenuExample: Inner exceptions:
[4/11/2020 10:57:26 PM.839] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.840] MenuExample: Stack trace:
[4/11/2020 10:57:26 PM.840] MenuExample: at RAGENativeUI.UIMenu.Draw() in E:\programming\RAGENativeUI\Source\UIMenu.cs:line 541
[4/11/2020 10:57:26 PM.840] at RAGENativeUI.MenuPool.ProcessMenus() in E:\programming\RAGENativeUI\Source\MenuPool.cs:line 164
[4/11/2020 10:57:26 PM.841] at MenuExample.EntryPoint.ProcessLoop() in E:\programming\RAGENativeUIExamples\MenuExampleProject\MenuExample.cs:line 238
[4/11/2020 10:57:26 PM.841] at Rage.GameFiber.Main()
[4/11/2020 10:57:26 PM.841] MenuExample: ==============================
[4/11/2020 10:57:26 PM.841] MenuExample: 
petergeorgas commented 4 years ago

I would like to take a shot at this in a day or two.

I figured I would take this time to reach out to you as well. I am currently building a plugin with RageNativeUI and I would like to figure out a way how to make a text box either within the menu or a pop-up text box for users to input a string but I for the life of me cannot find any resources that would help me achieve this... do you have any suggestions?

pnwparksfan commented 4 years ago

@petergeorgas check out some of the classes I've made for my LiveLights plugin which extend UIMenuItem to create a pop up for string (or other data type) entry: https://github.com/pnwparksfan/rph-live-lights/blob/master/LiveLights/Utils/MenuItems.cs