Commit Graph

8 Commits

Author SHA1 Message Date
FantasyPvP 7ae2308a83 several fixes and changes 2023-11-29 23:45:40 +00:00
FantasyPvP c194109487 holy (crab) that was a lot of work
it works.

the input function is working now, passing it a reference to your root gui widget and a reference to it's own widget and a function to check if it should exit works now

gg
2023-11-28 00:12:59 +00:00
FantasyPvP f48eb133b3 we frikin did it bois
gui library works frrr

implementation:
- containers now store a Widget type.

- every widget has a unique id

- there is a data store that maps the id to the internally stored gui component.

- the compoenents can be fetched from the datastore using their Widget type
- the datastore uses a hashmap so fetching shouldnt have any real performance penalty.

- widgets can be fetched, inserted, updated and rendered from the datastore

- the render method can be called directly from the Widget type without having to know the underlying type that it references
2023-11-27 19:02:32 +00:00
FantasyPvP 417833fc41 fixed stuff
no progress 💀
2023-11-27 00:21:34 +00:00
FantasyPvP 140ac0ab32 updates
updated grapher to use new widtgets system (not working yet but close)

made a basic app using the widgets system

implemented CgTextEdit for CgLineEdit (now fully working, but there may be bugs so i'll address them tomorrow)
2023-11-24 00:40:27 +00:00
FantasyPvP 467a42a5fa continued to work on new UI library
- implemented CgStatusBar widget which is a specific version of the CgIndicatorBar widget with predefined fields

- std::io::Screen is now an enum that makes switching between display modes more intuitive

- created a basic CgLineEdit implementation that allows for a user to type in a character and have it re-render that widget

- other more minor changes like fixes for existing apps to work with new features
2023-11-23 20:29:51 +00:00
FantasyPvP 461c9d9c6a - got text boxes fully working
- this includes text wrapping not cutting words in half (can be disabled using a method on the text box)
- refactored frame.rs, cg_core.rs and cg_widgets.rs to avoid code reuse and duplication
- created a simplified unified interface for rendering frames to the screen using the Frame struct provided by frame.rs instead of Element, FrameGen, etc.
- moved all widgets from cg_core.rs to cg_widgets.rs
- the label widget now works
- also added CgIndicatorBar and CgIndicatorWidget widgets to eventually make a working status bar
- refactored all applications in the system to use the new api to render to the screen
2023-11-23 00:29:04 +00:00
FantasyPvP 84aaa90e66 new gui module text box implementation
starting to work on the new UI library, got labels and text boxes working as well as containers for widgets.

planning a big refactor
2023-11-22 21:07:00 +00:00