Skip to content

Commit

Permalink
Slight formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Meorge committed Jun 26, 2023
1 parent f555a78 commit 513f73d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 8 additions & 4 deletions objection_engine/ace_attorney_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,13 @@ def __init__(self, callbacks: dict = None, fps: float = 30):

self.evidence = EvidenceObject(parent=self.textbox_shaker, director=self)

self.judge_verdict = JudgeVerdictTextObject(parent=self.root, name="Judge Verdict")
self.judge_verdict = JudgeVerdictTextObject(
parent=self.root, name="Judge Verdict"
)

self.testimony_indicator = TestimonyIndicatorTextObject(parent=self.root, name="Testimony Indicator")
self.testimony_indicator = TestimonyIndicatorTextObject(
parent=self.root, name="Testimony Indicator"
)

self.scene = Scene(width=256, height=192, root=self.root)

Expand Down Expand Up @@ -846,15 +850,15 @@ def update(self, delta: float):
r = int(action_split[2])
g = int(action_split[3])
b = int(action_split[4])
self.testimony_indicator.set_fill_color((r,g,b))
self.testimony_indicator.set_fill_color((r, g, b))
elif command == "strokecolor":
if len(action_split) == 3 and action_split[2] == "default":
self.testimony_indicator.set_stroke_color(None)
else:
r = int(action_split[2])
g = int(action_split[3])
b = int(action_split[4])
self.testimony_indicator.set_stroke_color((r,g,b))
self.testimony_indicator.set_stroke_color((r, g, b))
elif command == "show":
self.testimony_indicator.make_visible()
elif command == "hide":
Expand Down
11 changes: 4 additions & 7 deletions objection_engine/testimony_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,17 @@ def get_text_bbox(self, text: str):
return (x2 - x1, y2 - y1)

def set_fill_color(self, color: tuple[int, int, int] = None):
self.fill_color = color if color is not None else (255,255,255)
self.fill_color = color if color is not None else (255, 255, 255)
self.render_internal_graphic()

def set_stroke_color(self, color: tuple[int, int, int] = None):
self.stroke_color = color if color is not None else (0, 192, 56)
self.render_internal_graphic()

def set_text(
self,
text: str
):
def set_text(self, text: str):
self._text = text
self.render_internal_graphic()

def render_internal_graphic(self):
if self.font is None:
return
Expand Down Expand Up @@ -105,7 +102,7 @@ def render(self, img: Image.Image, ctx: ImageDraw.ImageDraw):

if not self.can_be_displayed:
return

if not self.text_visible:
return

Expand Down

0 comments on commit 513f73d

Please sign in to comment.