Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI remake with Dear IMGUI #1333

Closed
wants to merge 31 commits into from

Conversation

Projects
None yet
7 participants
@only-a-ptr
Copy link
Member

only-a-ptr commented Jun 5, 2017

imgui-preview

I want to drop our current library (MyGUI) and remake everything in Dear IMGUI because:

  • Much less code! MyGUI requires terrible amount of boilerplate code to set up bindings with XML definitions. There's code generator, but you still have to deal with the code afterwards. And even if you create GUI in code, you need a lot of boilerplate for simple things like [X] close button on windows.
  • Automated layout! MyGUI does have a visual editor, but no layout tools - you need to position every single widget by hand. It gets very tiresome. With IMGUI, you just say "show 3 buttons, separator, label and 2 more buttons" and it's nicely laid out for you.
  • Professional looks! The GUI looks like Blender or some other professional-level software - by default! MyGUI's skin system is awful and undocumented - for years, RoR had been stuck with it's default skin, re-painted to (awful!) orange. The current skin by Max98 is orders of magnitude better, but it's still not very clean.
  • The GUI is actually capable! Just look at it's GitHub page's screenshots. All complex editor/diagnostic UIs! Graphs! Plots! MyGUI isn't really capable GUI system - even a multi-column selectable table (multiplayer lobby) was tricky. With RigEditor (unfinished, circa 2014), I ultimately gave up - MyGUI was slowing me down to a complete halt.
  • The GUI is fast and fun to create!

For a demonstration, I remade the top menubar. The old one behaved weird and was bloated. UPDATE: Now it's complete, the vehicles menu was restored.

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 6, 2017

Looks much more professional and clean. 👍

@vido89

This comment has been minimized.

Copy link

vido89 commented Jun 6, 2017

@only-a-ptr

This comment has been minimized.

Copy link
Member Author

only-a-ptr commented Jun 6, 2017

rigsofrods-imgui-mainmenu

Note the font is not final - it's the built-in basic one. The IMGUI-OGRE integration has currently issues with rendering TTF fonts, I'm solving it on the OGRE forums.

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch 3 times, most recently from fb7c890 to 90362da Jun 6, 2017

@tritonas00

This comment has been minimized.

Copy link
Collaborator

tritonas00 commented Jun 7, 2017

Ok compiles fine but i cant see any menu and this error many times:

GLSL compile log: imgui/VP/GL1500:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

@tritonas00

This comment has been minimized.

Copy link
Collaborator

tritonas00 commented Jun 7, 2017

Fixed: MESA_GL_VERSION_OVERRIDE=3.0 MESA_GLSL_VERSION_OVERRIDE=310 /opt/rigsofrods/RoR

wow, really nice and responsive!!

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch 3 times, most recently from f609769 to d4c3192 Jun 8, 2017

@only-a-ptr

This comment has been minimized.

Copy link
Member Author

only-a-ptr commented Jun 8, 2017

new-truckfile-debug-options

I've removed the broken "Debug Options" panel and added the truckfile debug logging options as checkboxes to the top menubar. Extra captions and tooltips included!

This GUI looks freaking awesome 😀

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 8, 2017

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch from 4bc9318 to dab8072 Jun 8, 2017

@RigsOfRods RigsOfRods deleted a comment from tritonas00 Jun 8, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 8, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 15, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 15, 2017

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch from 6038973 to 8c5c0ae Jun 15, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 15, 2017

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch 3 times, most recently from 5bb06e5 to 8f9c866 Jun 15, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 15, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 16, 2017

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch from 08ed8f3 to 09b7a4c Jun 16, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 16, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 17, 2017

@RigsOfRods RigsOfRods deleted a comment from codacy-bot Jun 17, 2017

only-a-ptr added some commits Aug 14, 2017

🔧 Disabled 'imgui.ini' - we don't need it.
File 'imgui.ini' persists window positions and other settings, which we don't need.
🔧 IMGUI: lowered min OpenGL ver. from 3.2 to 3.0
GLSL shaders in OGRE-IMGUI require at least GLSL version 1.30 due to use of "global function texture()".
🔧 Added missing #include-s
Reported by @onox to break build on Linux
🎮 Changed mouse cursor display method
Previously, cursor was drawn by MyGUI and had custom graphical look (gray triangle). Problem: it was drawn under DearIMGUI elements.
Now, it's drawn by DearIMGUI and looks like plain old white arrow mouse pointer. The old looks can be restored if there's interest.
🔧 Improved OGRE-IMGUI integration
Improvements to OGRE-IMGUI:
* ImguiManager is no longer an "render queue listener" - no need to check for duplicate invocations (removed respective member variables). Also there's no need for '[Start|Stop]Rendering()' methods - removed, updated usage instructions.
* Simplified rendering - using short-lived instance of Ogre::Renderable instead of having a pool.
* Added proper scissor testing of window contents - Adopted from https://bitbucket.org/ChaosCreator/imgui-ogre2.1-binding Commentary on OGRE forums: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=89081#p531059
🎮 Remade multiplayer serverlist (demo)
Not functional yet - only showing dummy test data.
🎮 Multiplayer serverlist functional
Refreshing online serverlist & joining game works.

Problem: Clicking [join] will freeze UI with open serverlist until connection is estabilished or failed.
📐 Removed dead code
Classes `DynamicRenderable` and `DynamicLines` were completely unused/unreferenced and also obsolete -OGRE implements the same functionality via `Ogre::ManualObject`.
🎮 Remade 'MessageBox' using DearIMGUI
removed unused functions of GuiManager:
* UpdateMessageBox()
* getMessageBoxResult()
* destroy() - just a leftover declaration.
🔧 Clarified and unified GVar usage.
The meaning of GVar values was unified and described in GVar doxy comment.

Added function GVar::ResetPending()

Fixed bugs: formatting of ACTIVE and PENDING values in log; bad formatting strings in LogApplyPending()

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch 3 times, most recently from 682f7d8 to 38cc5a4 Oct 10, 2017

only-a-ptr added some commits Oct 9, 2017

💥 Removed broken 'change map' feature.
The "change map" button in pause menu was a broken concept - it switched user back to main menu loop without disconnecting multiplayer and immediately started map selector. Problems:
* Ugly, confusing code - it was a pseudo-AppState.
* If the user closed map selector, he was in menu, connected to MP, without an option to disconnect.
* It relied on the program-flow-hijacking behavior of old "MainSelector UI", which will be refactored to work with GVars.

Minor cleanup of AppState loop in 'main.cpp'
🎮 Freeze-less connecting to multiplayer
Connecting to MP server is now done on background, so the application remains responsive and renders a status box with a spinner animation :)
🔧 New GVar 'diag_extra_resource_dir'
Represents comand line argument "-includepath" and RoR.conf entry "resourceIncludePath".

Cleanup: the resource init logic was duplicate - refactored.

@only-a-ptr only-a-ptr force-pushed the only-a-ptr:dear-imgui branch from 38cc5a4 to 839fe09 Oct 11, 2017

only-a-ptr added some commits Oct 10, 2017

🎮 Improved multiplayer token handling
Old handling: User would save his token to RoR.cfg as "User Token" (possibly via RoRConfig). Upon startup, RoR would pick it and hash it to "User Token Hash", which would then be used to authenticate on MP portal.

New handling: User enters his token to "MP setup" GUI window which hashes it and saves the hash to GVar "mp_player_token_hash" (= "User Token Hash" in RoR.cfg). The "User Token" entry is retired.

NOTE: The token hashing logic also removed from "conf_file.cpp" in RoRConfig project - historical cruft introduced when copy-pasting the Settings class from RoR (originally it was shared, which was even messier).
🔧 Refactor of RoR.cfg save/load code.
Also corrected one RoR.cfg entry name: "Multiplayer portal URL"
🔧 3 new gfx GVars
TYPE | NAME | CONFNAME:
 <bool>            gfx_speedo_digital      (  "DigitalSpeedo")
 <bool>            gfx_speedo_imperial     ("gfx_speedo_imperial", converted from <string> "SpeedUnit")
 <bool>            gfx_motion_blur         ("Motion blur")
@only-a-ptr

This comment has been minimized.

Copy link
Member Author

only-a-ptr commented Nov 26, 2017

Closing this in favor of #1414 - other changes will be added in future PRs.

@only-a-ptr only-a-ptr closed this Nov 26, 2017

@only-a-ptr only-a-ptr changed the title New GUI library: Dear IMGUI UI remake with Dear IMGUI Nov 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.