Discord 1.1 Release

Today I am launching Version 1.1 of Dicecord. The most visible change people will see is the addition of Vampire: The Requiem as a supported game. In addition, there are a lot of back end changes that make the code a bit more generic, allowing for the addition of extra splats far more easily.

If you have Dicecord installed already, you can update by pressing the “Check For Updates” button on the splash screen, otherwise visit the Dicecord page to download the latest version. You can view the code on github.

UI Changes

Like Mage, a Vampire has a two page sheet. The first page shows their stats and other general vampire information.

To make this, I had to craft some new objects, detailed in the previous project updates. Update 1, Update 2.

For the second page, the main work when into the Biographical details of the character. The big effort here was creating a resizable text entry box; I wanted the box to start small but get bigger as you add new content. You can find the code I used for this widget below:

class TextEditResizing(QTextEdit):
    '''
    Custom Text Edit Widget
    Starts small and resizes when new content added
    '''
    def __init__(self, initText):
        super().__init__()
        # run size change when contents are changed
        self.document().contentsChanged.connect(self.sizeChange)

        # set default height
        self.heightMax = 20

        # this is used to initialise the height of the window
        self.setText(initText)
        self.show()
        self.sizeChange()

    def sizeChange(self):
        docHeight = self.document().size().height()

        # check if height has gone past the current max
        if docHeight > self.heightMax:
            # increases height to be slightly bigger than height needed to display document
            self.setMaximumHeight(docHeight+5)

Not only was this quite useful for the history and description entries, but it was a far superior way for me to do the Nimbus section of the Mage sheet, so now that has been updated to a resizing text box too. Overall, I really liked having the biographical details in the sheet and I will add it as a tab to Mage in a future deployment.

Code changes

In order to allow for easier addition of stats I made a lot of the back end code more generic. I have already mentioned how I changed the merits widget to a general object, but on top of that I turned most of the stats into python dictionaries. The reading and writing code has been rewritten to have standard XML tags for these sorts of objects, allowing an unlimited amount of elements with unique attributes be written and read by the same loop. Not only has this cut down on the lines of code for mage, but it will allow very easy addition of new stats as I add extra character types. Finally, the read code is currently backwards compatible, so mage sheets made for v1.03 can be read and will be saved as v1.1 files.

Future Plans

I have a vacation coming up so I won’t be doing much work on Dicecord for a while. I have some general features I want to add that I will work on during downtime before I look at a new splat.

  • Mage Spell Caster -> A UI to help with calculating dicepools for spell casting and paradox.
  • Mage Character Biography -> A new tab for Mage that allows users to add their history, description, age, etc
This entry was posted in Changelog, Dicecord, Python and tagged , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.