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 checks to prevent crash when style not present #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

julienvillegas
Copy link

Added checks to prevent crash when style not present (Image,
TextButton..)

Added checks to prevent crash when style not present (Image,
TextButton..)
@Tom-Ski
Copy link
Member

Tom-Ski commented Jan 13, 2017

I'm guessing you didn't mean to commit all this?

@julienvillegas
Copy link
Author

I did.
The majority of the files are from 2 skins I have added.
I have copied two skins from https://github.com/czyzby/gdx-skins to see whether new skins could be added, but they initially could not. I noticed that for those skins there isn't always a 'default' style for a given Skin. For example for the TextButton there is no TextButtonStyle element defined.

This caused the previewer to crash. Therefore, before the previewer shows an element, it checks whether that element exists in the Skin with a 'default' style.

Now it works (i.e.: it does not crash and simply show a message). That said, it can be improved further because with those 2 skins the TextButtons are using a ninepatch which is not shown very nicely with the previewer. That might require further modification.

@Tom-Ski
Copy link
Member

Tom-Ski commented Jan 13, 2017

You just need to supply the skin folder with assets and an info.json, you dont need to build then commit these the resulting war.

see https://github.com/libgdx/libgdx-skins#submitting-your-skin

@julienvillegas
Copy link
Author

ok, I removed the raw files. Let me know.

@Tom-Ski
Copy link
Member

Tom-Ski commented Jan 13, 2017

The raw files as in the link i posted are the only files you need, see the current skins if you want to see the layout. You have pushed the working files from the war directory which shouldn't be included.

@Tom-Ski
Copy link
Member

Tom-Ski commented Jan 13, 2017

Looks great, Thanks!. If you can just run the LibGDX code formatter over only the lines of code you have changed, then it's good for merging.

Copy link
Member

@Tom-Ski Tom-Ski left a comment

Choose a reason for hiding this comment

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

.idea folder should not be commited, nor should anything other than the java files and the raw assets.

Please only apply the formatter to lines you write, doing so on whole classes makes the PR hard to review as there are many irrelevant and unneeded changes when you do so.

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.

2 participants