codingteam / Keter

A roguelike game in the SCP setting.
https://codingteam.github.io/Keter/
MIT License
15 stars 5 forks source link

Base UI framework #42

Closed ForNeVeR closed 9 years ago

ForNeVeR commented 9 years ago

Guys, I think it's time to review my MVVM framework implementation for Keter. There's still many things to do but the basis is here.

I've implemented it per #41 because we need some complicated stuff to do inventory menus. Also I've refactoredall of existing game scenes to adopt the new UI model.

The main idea is that the scene is the delegate of the view layer and most of (non-UI and event handling) actions and data storage should be moved to the view model layer. The new UI is composable so we can do multicontrol UI like the one we need for the inventory screen.

Yes, view models are mutable objects but I think that's acceptable for UI and we should not limit us to immutability in view model layer (but all of game objects still have to be immutable).

This PR will close #41, any new views and models will be implemented as we need them.

ForNeVeR commented 9 years ago

cc @rexim, @Akon32, @IngvarJackal

rexim commented 9 years ago

Considering that I know almost nothing about Keter codebase, I'm ok with the changes. But as a mixer I'd suggest to remove everything.

Thanks.

rexim commented 9 years ago

Btw, do you plan to extract your framework from the project and make it a separate library in the future?

ForNeVeR commented 9 years ago

Yes, that is possible.

ForNeVeR commented 9 years ago

I think I'm finished here. I've implemented the same model for GameScene and optimized it a little. Let's make a second review, guys.

rexim commented 9 years ago

You know my opinion.

hagane commented 9 years ago

Unanimously then.