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

Added support for font, color, images #14

Merged
merged 11 commits into from
May 13, 2017

Conversation

nihal111
Copy link
Member

@nihal111 nihal111 commented Apr 12, 2017

The existing UIText that appeared over pages is now replaced with BrowserWidget.
Using BrowserWidget as in Journal allows writing the page contents in a near HTML-like language.
This allows for change of font, color and even addition of images.

Recipes can be added directly (as done in Journals). Will upload an example for the same soon.

Since the pages don't have UIText anymore, editing them opens a new window (PageEditor) where the contents appear unparsed, i.e. undecoded in the HTML-Like language currently.

The single edit button that existed has now been replaced with two, one for each page (left and right).
Saving the page inside the editing window (PageEditor) that pops up only saves the edit temporarily (for viewing purposes). To save it completely (i.e. write to BookComponent.pages) you need to click the save button on the BookScreen.

Recipes can be dynamically added using a "" tag, which consist of a prefab name, that has a BookRecipeComponent.

This would solve #3, #4 and #7

@Waterpicker @Cervator could you review?

Here's a video for the same:
https://www.youtube.com/watch?v=RDK5IN7v4y0

@In
private PrefabManager prefabManager;
private static PrefabManager prefabManager;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the static keywords means that all instances of the BookScreen share the same variable - is this intended for all the fields here?

Copy link
Member Author

@nihal111 nihal111 Apr 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skaldarnar Yes, since only a single BookScreen instance can stay active at any point of time, the usage of static everywhere in this class is intended. It is primarily done so to make some variables and methods (present in this class) accessible to the PageEditor class which is another such screen in this module.

@nihal111
Copy link
Member Author

nihal111 commented May 7, 2017

Note: Updated PR to work with Prefab based recipes. This no longer needs the gson library to be whitelisted.

@Waterpicker Waterpicker merged commit 9919a75 into Terasology:master May 13, 2017
@Waterpicker
Copy link
Contributor

Sorry for the delay. Exams happened recently and just got to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants