mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
ui: make equipment scrollable
This commit is contained in:
+5
-10
@@ -111,21 +111,16 @@ class EquipmentView(CustomLineBox):
|
||||
self.value_texts = {
|
||||
equipment_type: urwid.Text("") for equipment_type in EquipmentType
|
||||
}
|
||||
self.list_box = CustomListBox(
|
||||
[
|
||||
urwid.Columns(
|
||||
[
|
||||
data_table = DataTable(columns=[("weight", 1), ("weight", 3)])
|
||||
for equipment_type in EquipmentType:
|
||||
data_table.add_row(
|
||||
urwid.Text(equipment_type.value),
|
||||
("weight", 3, self.value_texts[equipment_type]),
|
||||
]
|
||||
)
|
||||
for equipment_type in EquipmentType
|
||||
]
|
||||
self.value_texts[equipment_type],
|
||||
)
|
||||
|
||||
self.player.equipment.connect("change", self.sync_equipment_change)
|
||||
|
||||
super().__init__(self.list_box, title="Equipment")
|
||||
super().__init__(ScrollBar(Scrollable(data_table)), title="Equipment")
|
||||
self.sync()
|
||||
|
||||
def sync(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user