Limit-Theory-Redux / ltheory

Limit Theory Redux is a fork of the discontinued open-world space simulation game Limit Theory. We have made it our mission to continue the development of the ambitious Limit Theory project as an open source initiative.
Apache License 2.0
62 stars 8 forks source link

Collection of small enhancements #304

Closed Flatfingers closed 4 months ago

Flatfingers commented 4 months ago
  1. Updated the margins for text strings in NewGame and Settings so that they once again line up (more or less) with their UI components.

  2. Restored dynamic lights ("L" to toggle). Added a visible "L" to the HUD when dynamic lights are active.

  3. At some point, the name of the key command used to toggle the in-game overlay panel system got changed from Back to Backslash, but that reference in /docs/GameControlKeys.txt wasn't updated. It is now.

  4. Added a new ProgressBar component. Added several small helper commands in StarSystem.lua and Universe.lua to track and increment the count of objects added to the game universe, which ProgressBar will (eventually) use.

  5. Commented out color settings in Josh's old /UI Lua files to make the Debug overlay panel stop crashing. It looks like removing the set() function from those UI files, and changing applyColor() to getColor() in /UI/Widget.lua, broke how colored components work in the overlay panels and we didn't notice for a while. So now the Debug panel works again, but it looks like ass because the proper colors are no longer being set.

dgavedissian commented 4 months ago

Commented out color settings in Josh's old /UI Lua files to make the Debug overlay panel stop crashing

Draw.Color is utilising some extremely old OpenGL features which I'm trying to remove so we can move to modern graphics APIs. That's why I removed Color:set as well. Sorry for the breakage, as I'm hoping to remove all uses of it. That's why I was asking on discord if anything is using the UI files.

I changed applyColor (which applied the right colour to Draw.Color) to getColor, which instead returns the color to be passed to the shader. I also added a utility function UI.DrawEx.SimpleRect as a replacement for Draw.Rect which correctly sets up the shaders that are replacing the fixed function pipeline

To fix this, you'd need to replace:

    self:applyColor(focus, active, Config.ui.color.border)
    ....
    Draw.Rect(x, y, sx, sy)

with

    UI.DrawEx.SimpleRect(x, y, sx, sy, self:getColor(focus, active, Config.ui.color.border))

As per https://github.com/Limit-Theory-Redux/ltheory/pull/303/files#diff-223ff06f386e89d549a21966be754fc69366d1dc49404db9b583fdd02be20d6b

dgavedissian commented 4 months ago

I've done this in https://github.com/Limit-Theory-Redux/ltheory/pull/306

Flatfingers commented 4 months ago

Got it, and thanks for the detail info; this makes a lot more sense to me now. This should be temporary if we can convert these UI calls to our new HmGui-derived UI system.