Hi,
I’m trying to add table RPG plugins to the Display-O-Tron menu but i have 2 problems :
- I made a simple random dice plugin but when i call the redraw method, it generates a new dice at each drawcall and i can’t figure out how to call it only once at a time.
- Id’like to add buttonshim to quickly go to some parts of the dot menu, but how to do it ?
Here is the dices file (which is added to the plugins folder and called in the menu.py)
#!/usr/bin/env python3
from random import randint as rng
from dot3k.menu import MenuOption
class Dices(MenuOption):def __init__(self, dice): self.which_dice = dice MenuOption.__init__(self) def dice(self): score = rng(1, self.which_dice) return score def redraw(self, menu): menu.write_row(0, " D{} :".format(self.which_dice)) menu.clear_row(1) menu.write_row(2, " {}".format(self.dice()))
Thanks for your help. :)