Rolisteam / RCharacterSheet

submodule for Rolisteam and Rcse about CharacterSheet, sharing code.
6 stars 5 forks source link

Character sheet show blank page (Rolisteam 1.9) #4

Open sioc-de-narf opened 4 years ago

sioc-de-narf commented 4 years ago

Your configuration:

Rolisteam version: Operating System and version : Windows 10

Rolisteam Setting (remove irrelevant):

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

What did you expect to see ?

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

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 ?

obiwankennedy commented 4 years ago

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

sioc-de-narf commented 4 years ago

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 commented 4 years ago

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.

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

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

sioc-de-narf commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Ok, so i tried :

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 commented 4 years ago

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 commented 4 years ago

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

obiwankennedy commented 4 years ago

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.