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

Make ingame UI alive #70

Open
apodrugin opened this issue Mar 16, 2021 · 2 comments
Open

Make ingame UI alive #70

apodrugin opened this issue Mar 16, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@apodrugin
Copy link
Contributor

Currently part of the UI is not rendered at all. Corresponding actions are not performed.
Here is an action plan which allows make ingame UI more or less alive:

  • Refactor Widget class and related subclasses
    -- Merge Container class functionality with Widget class to simplify widget hierarchies management.
    -- Add events processing to Widget class. This will allow us properly route events to subwidgets.
    -- Clean up Update methods in all widgets.
    -- Get rid of StaticElement. Use Widget subclass instead.
    -- Make Button widget more generic so it can be used with different background images.
  • Implement game menu (info, revert, etc.) rendering.
  • Implement game menu actions handling (show all necessary dialogs with minimal implementation).
  • Implement buildings selection menu rendering (render all buildings types, no animations).
  • Implement switching between tabs in buildings menu.
@skrax
Copy link
Contributor

skrax commented Mar 16, 2021

Merge Container class functionality with Widget class to simplify widget hierarchies management
I guess you propose making Widgets work with STL containers and <algorithm> ?

Add events processing to Widget class. This will allow us properly route events to subwidgets
I think a templated event callback structure could be useful in general.

@apodrugin
Copy link
Contributor Author

apodrugin commented Mar 17, 2021

I guess you propose making Widgets work with STL containers and ?

Yes. Currently Container class holds vector of Widgets and it is used to create widgets hierarchies. So basically my idea is to move subwidgets management to Widget class and make it available for all subclasses. I want to add reference to parent widget and list of child widgets to Widget class. This will allow us to create traversable widgets trees. Actually this approach is used in UIKit. It simplifies a lot of things (for example, you may create new kind of widgets without creating subclasses, perform subwidgets layout relatively to parent widget, etc).

Container class is also responsible for two kinds of automatic layout (horizontal and vertical). My idea is to move this logic to separate class - StackWidget.

I think a templated event callback structure could be useful in general.

I will try to preserve this approach, but I think that every widget is interested in touch, mouse and keyboard events handling (probably except static text and static images/icons).

@gynt gynt assigned gynt and apodrugin and unassigned gynt Mar 17, 2021
@gynt gynt added the enhancement New feature or request label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants