You've already forked HeurAMS-legacy
fix: 若干改进
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
from textual.app import ComposeResult
|
||||
from textual.widgets import Header, Footer, Label, Static, Button
|
||||
from textual.containers import Center
|
||||
from textual.containers import Center, Container
|
||||
from textual.screen import Screen
|
||||
from textual.reactive import reactive
|
||||
from enum import Enum, auto
|
||||
@@ -34,12 +34,18 @@ class MemScreen(Screen):
|
||||
#print(self.phaser.state)
|
||||
self.procession: Procession = self.phaser.current_procession() # type: ignore
|
||||
#print(self.phaser.state)
|
||||
self.procession.forward(1)
|
||||
self.rating = reactive(0)
|
||||
|
||||
def on_mount(self):
|
||||
self.load_puzzle()
|
||||
pass
|
||||
|
||||
def puzzle_widget(self):
|
||||
try:
|
||||
print(self.phaser.state)
|
||||
self.fission = Fission(self.procession.current_atom, self.phaser.state)
|
||||
#print(1)
|
||||
puzzle_info = next(self.fission.generate())
|
||||
print(puzzle_info)
|
||||
return shim.puzzle2widget[puzzle_info["puzzle"]](atom = self.procession.current_atom, alia = puzzle_info["alia"])
|
||||
@@ -58,8 +64,8 @@ class MemScreen(Screen):
|
||||
yield Footer()
|
||||
|
||||
def load_puzzle(self):
|
||||
container = self.query_one("puzzle-container")
|
||||
for i in puz_container.children:
|
||||
container = self.query_one("#puzzle-container")
|
||||
for i in container.children:
|
||||
i.remove()
|
||||
container.mount(self.puzzle_widget())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user