ASPP / pelita

Actor-based Toolkit for Interactive Language Education in Python
https://github.com/ASPP/pelita_template
Other
63 stars 68 forks source link

Overhaul Tk UI and add history viewer #819

Open Debilski opened 3 months ago

Debilski commented 3 months ago

In a first step, the idea would be to make the Tk Canvas stateless, i.e. without any implicit, hidden state.

The Tk render function should take a big dict with all necessary attributes that are needed to describe a particular state and should then automatically redraw all elements from that dict that have changed (and keep elements that have not changed).

This is already almost what we are doing but things like the overlay arrows and pacman rotation are currently not properly encoded in the UI state. In addition, the checks that are applied for when to redraw items are not standardised.

In a second step, we could then store all UI state dicts for a game and have history.

Debilski commented 2 months ago

If we do that, we should probably also decouple font size and canvas size (#820) – or couple it stronger.