mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Update view.py
This commit is contained in:
@ -23,7 +23,20 @@ ROOT = None
|
||||
|
||||
class View(object):
|
||||
def __init__(self, config, impl, state=None):
|
||||
global ROOT
|
||||
global ROOT, BLACK, WHITE
|
||||
|
||||
self.invert = 0
|
||||
self._black = 0xFF
|
||||
self._white = 0x00
|
||||
if 'invert' in config['ui'] and config['ui']['invert'] == 1 or True:
|
||||
self.invert = 1
|
||||
BLACK = 0x00
|
||||
WHITE - 0xFF
|
||||
self._black = 0x00
|
||||
self._white = 0xFF
|
||||
|
||||
|
||||
|
||||
|
||||
# setup faces from the configuration in case the user customized them
|
||||
faces.load_from_config(config['ui']['faces'])
|
||||
@ -98,6 +111,11 @@ class View(object):
|
||||
self._state.has_element(key)
|
||||
|
||||
def add_element(self, key, elem):
|
||||
if self.invert is 1 and elem.color:
|
||||
if elem.color == 0xff:
|
||||
elem.color = 0x00
|
||||
elif elem.color == 0x00:
|
||||
elem.color = 0xff
|
||||
self._state.add_element(key, elem)
|
||||
|
||||
def remove_element(self, key):
|
||||
|
Reference in New Issue
Block a user