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

Character sheet show blank page (Rolisteam 1.9) #4

Open
sioc-de-narf opened this issue Oct 11, 2019 · 9 comments
Open

Character sheet show blank page (Rolisteam 1.9) #4

sioc-de-narf opened this issue Oct 11, 2019 · 9 comments

Comments

@sioc-de-narf
Copy link

#Your configuration:
Rolisteam version:
Operating System and version : Windows 10

Rolisteam Setting (remove irrelevant):

  • GM and Server (localhost)
  • Client

#What did you do ? (Explain each step from starting rolisteam to the issue)

  • Loaded a previously saved .rcs file
  • shared a sheet with my client

#What did you expect to see ?

  • The characters sheets as they are displayed in 1.8.2

#What did you get instead ? (Describe in details the issue)

  • A blank page on both GM and Server AND and on client only

I tried on many files even some I shared on GitHub, same result
And if I regenerate the code from RCSE, i lost background images...

Is there something to do to upgrade character sheet from 1.8.2 to 1.9 ?

@sioc-de-narf sioc-de-narf changed the title Character sheet show blank page Character sheet show blank page (Rolisteam 1.9) Oct 11, 2019
@obiwankennedy
Copy link
Member

yes Compatibility breaks between both version. I plan to make a webpage to convert old sheet to new standard.

@sioc-de-narf
Copy link
Author

sioc-de-narf commented Oct 13, 2019

It took me hours to make those sheets...
Please do that very fast, releasing without retrocompatibility or upgrade ability is just a non-sense. And that should be said in the release notes !
I won't use anymore that release before we can use the previous version sheets, i use them too much now, and i won't redo them.

@obiwankennedy
Copy link
Member

Please read the whole answer. I describe many things to answer the issue.

It always like this:
1.6 is not retrocompatible with 1.7
1.7 is not retrocompatible with 1.8
1.8 is not retrocompatible with 1.9.

this is why all previous version of rolisteam can still be downloaded.
One day I will bring retrocompatibility, but one day.
Before it wasn't an issue because, but it becomes one when user can invest time to produce data/documents.

As global answer to ticket, I will list here all kinds of modification required to update charactersheet.

Minimal update

If you want your charactersheet to be displayed exactly as it was on Rolisteam v1.8. The minimal change is for you.

## Minimal update: First change - import

in qml code, replace import "qrc:/resources/qml/" with "import Rolisteam 1.0"

It could be enough to make the sheet ready to use. But I recommand few other steps.

Minimal update: Second change - Sheet file

You may find useful to add those fields inside sheet at the first level in the json file.

  • "additionnalBottomCode"
  • "additionnalHeadCode"
  • "additionnalImport"

Values can be empty string. For the two next key, values are required:

  • uuid (value must be the first part of image key).
  • pageCount (value must be the number of page of this sheet)

With those changes, RCSE will be able to open this sheet and display the qml.
Be careful, don't regerate the sheet or it may changed the visual aspect.

Complete Update:

To change the sheet to use rolisteam v1.9 sdk, it is easy. The visual aspect could be diffirent. The checkbox for example have been improved.

In order to update to SDK 1.9, you must do all change from minimal update and few others.

Complete Update: First change - import

in qml code, replace import "qrc:/resources/qml/" with "import Rolisteam 1.1"
Pay attention, complete update means 1.1, minimal update the version is 1.0

Don't forget to do the second step of the minimal update.

Complete Update: Second change - fields

Each time, a field has textColor and color properties, those properties must be renamed as follow:

textColor => color
color => backgroundColor


Please find a python script atteched to this message. This script is able to update charactersheet from v1.8 to v1.9 with the complete update method.
The minimal change mode has not been tested yet.

Example:

./convertSheet.py -i Legend_of_five_ring_NPC/L5R_NPC.rcs -o NPC_L5R_fixed.rcs -c

-i input
-o ouput
-c => complete update mode.

I would like to test several sheets with this script to be sure it covers all kinds of sheet.
When it is ready, I will port the code into web language.

convertSheet.zip

@obiwankennedy obiwankennedy transferred this issue from Rolisteam/rolisteam Oct 14, 2019
@sioc-de-narf
Copy link
Author

sioc-de-narf commented Oct 14, 2019

hum...

Are you sure it is color => backgroundColor ?

When i look at the code of a 1.8 sheet i see : bgcolor and no just color

@obiwankennedy
Copy link
Member

It is property from the rolisteam sdk. So those files: https://github.com/Rolisteam/RCharacterSheet/tree/master/qml/Rolisteam. Those with v1 at the end of the name are from Rolisteam v1.8.

Many of them have textColor property to define the color of the text and color to define background color.
In v1.9, I decide to clean up the API, so textColor is not color, and color is not backgroundColor.
As an example, you can compare the code of TextInputFieldv1.qml and TextInputFieldv1.qml.

@sioc-de-narf
Copy link
Author

Ok, so i tried :

  • Minimal update => worked.

  • Complete Update => didn't worked => white page

  • The Script : Ko cf. the errors :

python convertSheet.py -i cno.rcs -o cno-fixed.rcs -c
Error: fail to read the input file
Traceback (most recent call last):
File "convertSheet.py", line 265, in
main(sys.argv[1:])
File "convertSheet.py", line 247, in main
data = completeChange(data)
File "convertSheet.py", line 169, in completeChange
array = updateImage(data)
File "convertSheet.py", line 42, in updateImage
for p in data['background']:
TypeError: 'NoneType' object is not subscriptable

PS: i used python 3.7.4

I attached the sheet file (with characters) :
cno.zip

@obiwankennedy
Copy link
Member

Yes, the first error message say it well: Error: fail to read the input file

I don't know what happened but as the input file was not read. It crashes in background image because it is the first step the script does. I should quit on error when this happen.

@sioc-de-narf
Copy link
Author

the Minimal update that worked was on that file too ...

@obiwankennedy
Copy link
Member

Yes, I can understand that, but perhaps you add some invisible character or something. Have you tried a second time ? on my side, the script worked fine. I did not yet checked the charactersheet but no error message.

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

No branches or pull requests

2 participants