-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from Meorge/feat/testimony-indicator
"Testimony" flashing label
- Loading branch information
Showing
5 changed files
with
461 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Using the Testimony Indicator Effect | ||
To indicate that a specific type of dialogue is playing out, you can place | ||
a flashing text label in the top-left corner of the screen. In the original | ||
games, this label would read "Testimony" during a witness's testimony in | ||
court. With *Objection*, you can set this label to anything you want, as well | ||
as change its colors as you please. | ||
|
||
![Testimony indicator effect in action](img/testimony-indicator.gif) | ||
|
||
See `example_testimony_indicator.py` for example usage. | ||
|
||
## Setting up the effect | ||
Only a few commands are necessary to set up the label effect: | ||
```py | ||
[ | ||
# Set the text for the label | ||
DialogueAction("testimony set 'Testimony'", 0), | ||
|
||
# (Optional) Set the fill color of the text. | ||
# The arguments following "fillcolor" are RGB values in the range 0-255. | ||
DialogueAction("testimony fillcolor 230 255 230", 0), | ||
|
||
# (Optional) Set the stroke color of the text. | ||
# The arguments following "strokecolor" are RGB values in the range 0-255. | ||
DialogueAction("testimony strokecolor 20 150 80", 0), | ||
|
||
# Start flashing the label | ||
DialogueAction("testimony show", 0) | ||
] | ||
``` | ||
Just add those commands to your list of `BaseDialogueItem` objects and you'll | ||
have your label! | ||
|
||
### Resetting the colors | ||
If you don't set the fill or stroke colors, they'll default to `(255, 255, 255)` | ||
(white) and `(0, 192, 56)` (the green color used in the original games' | ||
"Testimony" label), respectively. | ||
|
||
If you'd like to return the colors to their defaults, you can pass a single | ||
parameter, `default`, to `testimony fillcolor` and `testimony strokecolor`, | ||
like so: | ||
```py | ||
[ | ||
# Reset the fill color of the label to white | ||
DialogueAction("testimony fillcolor default", 0), | ||
|
||
# Reset the stroke color of the label to the green color used in the | ||
# original games | ||
DialogueAction("testimony strokecolor default", 0) | ||
] | ||
``` | ||
|
||
### Turning off the label | ||
Disabling the label is as easy as issuing a single command: | ||
```py | ||
[ | ||
DialogueAction("testimony hide", 0) | ||
] | ||
``` | ||
That's it! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,252 @@ | ||
from objection_engine.ace_attorney_scene import AceAttorneyDirector | ||
from objection_engine.parse_tags import ( | ||
DialoguePage, | ||
DialogueAction, | ||
DialogueTextChunk, | ||
DialogueTextLineBreak, | ||
) | ||
|
||
pages = [ | ||
DialoguePage( | ||
[ | ||
DialogueAction("music start pwr/cross-moderato", 0), | ||
DialogueAction( | ||
"testimony set 'Discussion'", 0 | ||
), # Set testimony indicator text with default colors | ||
DialogueAction("testimony show", 0), # Show testimony indicator | ||
] | ||
), | ||
DialoguePage( | ||
[ | ||
DialogueAction("wait 0.03", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-normal-idle.gif", 0 | ||
), | ||
DialogueAction("cut left", 0), | ||
DialogueAction('nametag "Phoenix"', 0), | ||
DialogueAction("showbox", 0), | ||
DialogueAction("evidence clear", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-normal-talk.gif", 0 | ||
), | ||
DialogueTextChunk("Hello", []), | ||
DialogueTextChunk(".", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueTextChunk(" ", []), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-normal-idle.gif", 0 | ||
), | ||
DialogueAction("wait 0.6", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-talk.gif", | ||
0, | ||
), | ||
DialogueTextChunk("My", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("name", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("is", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("Phoenix", []), | ||
DialogueTextChunk(".", []), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction("showarrow", 0), | ||
DialogueAction("wait 2", 0), | ||
DialogueAction("hidearrow", 0), | ||
DialogueAction("sound pichoop", 0), | ||
DialogueAction("wait 0.3", 0), | ||
] | ||
), | ||
DialoguePage( | ||
[ | ||
DialogueAction("wait 0.03", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction("cut left", 0), | ||
DialogueAction('nametag "Phoenix"', 0), | ||
DialogueAction("showbox", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-talk.gif", | ||
0, | ||
), | ||
DialogueTextChunk("I", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("am", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("a", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("defense", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("attorney", []), | ||
DialogueTextChunk(".", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueTextChunk(" ", []), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction("showarrow", 0), | ||
DialogueAction("wait 2", 0), | ||
DialogueAction("hidearrow", 0), | ||
DialogueAction("sound pichoop", 0), | ||
DialogueAction("wait 0.3", 0), | ||
] | ||
), | ||
DialoguePage( | ||
[ | ||
DialogueAction("wait 0.03", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction("cut left", 0), | ||
DialogueAction('nametag "Phoenix"', 0), | ||
DialogueAction("showbox", 0), | ||
DialogueAction("evidence clear", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-talk.gif", | ||
0, | ||
), | ||
DialogueTextChunk("Here", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("is", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("another", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("line", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("of", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("dialogue", []), | ||
DialogueTextChunk(".", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueTextChunk(" ", []), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction( | ||
"sprite left assets/characters/phoenix/phoenix-handsondesk-idle.gif", | ||
0, | ||
), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction("showarrow", 0), | ||
DialogueAction("wait 2", 0), | ||
DialogueAction("hidearrow", 0), | ||
DialogueAction("sound pichoop", 0), | ||
DialogueAction("wait 0.3", 0), | ||
] | ||
), | ||
DialoguePage( | ||
[ | ||
DialogueAction("wait 0.03", 0), | ||
DialogueAction("hidebox", 0), | ||
DialogueAction("testimony hide", 0), # Hide testimony indicator | ||
DialogueAction( | ||
"testimony set 'Counterargument'", 0 | ||
), # Set a new testimony indicator | ||
DialogueAction("testimony fillcolor 56 200 200", 0), # Set the fill color | ||
DialogueAction("testimony strokecolor 128 0 56", 0), # Set the stroke color | ||
DialogueAction("wait 0.5", 0), | ||
DialogueAction("pan right", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-idle.gif", | ||
0, | ||
), | ||
DialogueAction("wait 1.0", 0), | ||
DialogueAction('nametag "Edgeworth"', 0), | ||
DialogueAction("showbox", 0), | ||
DialogueAction("testimony show", 0), # Start showing new indicator | ||
DialogueAction("evidence clear", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-talk.gif", | ||
0, | ||
), | ||
DialogueTextChunk("I", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("am", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("Edgeworth", []), | ||
DialogueTextChunk(",", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-idle.gif", | ||
0, | ||
), | ||
DialogueAction("wait 0.3", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-talk.gif", | ||
0, | ||
), | ||
DialogueAction("testimony fillcolor default", 0), # Reset the fill color | ||
DialogueAction( | ||
"testimony strokecolor default", 0 | ||
), # Reset the stroke color | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("because", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("I", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("have", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextLineBreak(), | ||
DialogueTextChunk("the", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("second", []), | ||
DialogueTextChunk("-", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-idle.gif", | ||
0, | ||
), | ||
DialogueAction("wait 0.3", 0), | ||
DialogueAction("startblip male", 0), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-talk.gif", | ||
0, | ||
), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("most", []), | ||
DialogueTextChunk(" ", []), | ||
DialogueTextChunk("lines", []), | ||
DialogueTextChunk(".", []), | ||
DialogueAction("stopblip", 0), | ||
DialogueTextChunk(" ", []), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-idle.gif", | ||
0, | ||
), | ||
DialogueAction( | ||
"sprite right assets/characters/edgeworth/edgeworth-document-idle.gif", | ||
0, | ||
), | ||
DialogueAction("stopblip", 0), | ||
DialogueAction("showarrow", 0), | ||
DialogueAction("wait 2", 0), | ||
DialogueAction("hidearrow", 0), | ||
DialogueAction("sound pichoop", 0), | ||
DialogueAction("wait 0.3", 0), | ||
] | ||
), | ||
] | ||
|
||
director = AceAttorneyDirector() | ||
director.set_current_pages(pages) | ||
director.render_movie() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.