-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crime Assist pda program #464
Crime Assist pda program #464
Conversation
Draft because I still need to figure out how to add icons |
For the record, I made the chart. Though I bless it's usage 👍 I didn't really think about innocent being in there because you wouldn't be sentenced by a warden if you were. But it's a pretty hilarious thought. |
I said I would rather have the sprite just be the base space law book, just to keep it consistent. EDIT: this isn't too big of a deal though. The first sprite on your list is preferable if you really insist on not using the base space law book. |
Seeing a strange error in the 'Build & Test Debug' step; |
… any text referencing a Sophont later on
it’s unrelated. It has to do with mail tests that are a little finicky. Test packaging has also been failing on all PRs so I wouldn’t worry about it either |
I'll do a proper review of this sometime this week probably |
Much appreciated, I'll await it patiently :) |
CrimeAssistUiState.UiStates.HappenInCourt => yesPressed ? CrimeAssistUiState.UiStates.Result_ContemptOfCourt : CrimeAssistUiState.UiStates.DuringActiveInvestigation, | ||
CrimeAssistUiState.UiStates.DuringActiveInvestigation => yesPressed ? CrimeAssistUiState.UiStates.Result_ObstructionOfJustice : CrimeAssistUiState.UiStates.ToCommandStaff, | ||
CrimeAssistUiState.UiStates.ToCommandStaff => yesPressed ? CrimeAssistUiState.UiStates.Result_Sedition : CrimeAssistUiState.UiStates.WasItCommandItself, | ||
CrimeAssistUiState.UiStates.WasItCommandItself => yesPressed ? CrimeAssistUiState.UiStates.Result_AbuseOfPower : CrimeAssistUiState.UiStates.Result_Hooliganism, | ||
_ => CrimeAssistUiState.UiStates.MainMenu | ||
}; | ||
|
||
UpdateUI(newState); | ||
} | ||
|
||
public void UpdateUI(CrimeAssistUiState.UiStates state) | ||
{ | ||
_currentState = state; | ||
bool isResult = state.ToString().StartsWith("Result"); | ||
|
||
StartButton.Visible = state == CrimeAssistUiState.UiStates.MainMenu; | ||
YesButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu && !isResult; | ||
NoButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu && !isResult; | ||
HomeButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu; | ||
Explanation.Visible = state != CrimeAssistUiState.UiStates.MainMenu; | ||
|
||
Subtitle.Visible = isResult; // Crime severity is displayed here | ||
Punishment.Visible = isResult; // Crime punishment is displayed here | ||
|
||
if (!isResult) | ||
{ | ||
string question = $"\n[font size=15]{GetQuestionLocString(state)}[/font]"; | ||
|
||
if (question.ToLower().Contains("sophont")) | ||
{ | ||
string sophontExplanation = Loc.GetString("crime-assist-sophont-explanation"); | ||
question += $"\n[font size=8][color=#999999]{sophontExplanation}[/color][/font]"; | ||
} | ||
|
||
Title.SetMarkup(question); | ||
Subtitle.SetMarkup(string.Empty); | ||
Explanation.SetMarkup(string.Empty); | ||
Punishment.SetMarkup(string.Empty); | ||
} | ||
else | ||
{ | ||
Title.SetMarkup("\n[bold][font size=23][color=#a4885c]" + GetCrimeNameLocString(state) + "[/color][/font][/bold]"); | ||
Subtitle.SetMarkup("\n[font size=19]" + GetCrimeSeverityLocString(state) + "[/font]"); | ||
Explanation.SetMarkup("\n[title]" + GetCrimeExplanationLocString(state) + "[/title]\n"); | ||
Punishment.SetMarkup("[bold][font size=15]" + GetCrimePunishmentLocString(state) + "[/font][/bold]"); | ||
} | ||
} | ||
|
||
private string GetQuestionLocString(CrimeAssistUiState.UiStates state) | ||
{ | ||
return Loc.GetString($"crime-assist-question-{state.ToString().ToLower()}"); | ||
} | ||
|
||
private string GetCrimeExplanationLocString(CrimeAssistUiState.UiStates state) | ||
{ | ||
return Loc.GetString($"crime-assist-crimedetail-{state.ToString().ToLower().Remove(0, 7)}"); | ||
} | ||
|
||
private string GetCrimeNameLocString(CrimeAssistUiState.UiStates state) | ||
{ | ||
return Loc.GetString($"crime-assist-crime-{state.ToString().ToLower().Remove(0, 7)}"); | ||
} | ||
|
||
private string GetCrimePunishmentLocString(CrimeAssistUiState.UiStates state) | ||
{ | ||
return Loc.GetString($"crime-assist-crimepunishment-{state.ToString().ToLower().Remove(0, 7)}"); | ||
} | ||
|
||
private string GetCrimeSeverityLocString(CrimeAssistUiState.UiStates state) | ||
{ | ||
return state switch | ||
{ | ||
CrimeAssistUiState.UiStates.Result_Innocent => "[color=#39a300]" + Loc.GetString("crime-assist-crimetype-innocent") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_AnimalCruelty => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Theft => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Trespass => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Vandalism => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Hooliganism => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Manslaughter => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony"), | ||
CrimeAssistUiState.UiStates.Result_GrandTheft => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_BlackMarketeering => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Sabotage => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Mindbreaking => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Assault => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_AbuseOfPower => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Possession => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Endangerment => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_BreakingAndEntering => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Rioting => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_ContemptOfCourt => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_PerjuryOrFalseReport => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_ObstructionOfJustice => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Murder => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Terrorism => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_GrandSabotage => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Decorporealisation => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Kidnapping => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_Sedition => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
CrimeAssistUiState.UiStates.Result_SexualHarrassment => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]", | ||
_ => "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if this functioned via yaml or something, as if we ever change splaw the only way to update this is by touching code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would need to learn a bit more about yml for that, but it does sound like a big improvement. I should have time to look into this saturday :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done! Learnt a lot about prototypes while doing it, too
todo: actually load and use this yaml
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Tim Falken <[email protected]>
Cant wait to have this added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only glanced over it
* Completely untested first commit * Get basic program flow working * Add Innocent * Add Fancy Rich Text * Icon Thanks, IcedQuinn! * Add Cartridge icons * New image from IcedQuinn * Add explanation on what a Sophont is, to be automatically appended to any text referencing a Sophont later on * Convert tabs to spaces * remove [bold] tags from loc * Make text bold again * Alter formatting, reduce text length for sophont explanation to fit it on the screen * Update Resources/Locale/en-US/deltav/cartridge-loader/cartridges.ftl Co-authored-by: Colin-Tel <[email protected]> Signed-off-by: Tim Falken <[email protected]> * Add program to more PDA's * Add a tip about the app * Recreate flow in yaml todo: actually load and use this yaml * Remove the old state machine, and add configurable yaml prototypes to define pages * Move page to its own file --------- Signed-off-by: Tim Falken <[email protected]> Co-authored-by: Colin-Tel <[email protected]> (cherry picked from commit 11d4a39)
(cherry picked from commit 2246b2e)
# Description During PR DeltaV-Station#464, somehow Moth's got back their ability to move with their wings whenever the gravity gets shut off. Well, I'm here to correct the injustice by also putting it on Harpies. In fact, Harpies have a much bigger claim to it, their wings are absolutely massive compared to Moths. # Changelog :cl: - add: Harpies remembered that just like moths; they also have wings, and can zoom whenever the gravity turns off. Co-authored-by: Danger Revolution! <[email protected]>
* Harpy Peacock Tail (#428) Courtesy of @StillIcarus This adds a new Peacock tail marking to Harpies. I'm also taking this time to update them to the recent DeltaV changes to the birbs.   The backside is semi cursed, but that's something I can't do within the scope of this PR due to sprite system limitations that Death has planned improvements for. Just ignore them. :) Have a birb as consolation.  :cl: VMSolidus - add: Peacock Tails have been added for Harpies --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: Danger Revolution! <[email protected]> * Birbs Have Wings Too (#477) # Description During PR #464, somehow Moth's got back their ability to move with their wings whenever the gravity gets shut off. Well, I'm here to correct the injustice by also putting it on Harpies. In fact, Harpies have a much bigger claim to it, their wings are absolutely massive compared to Moths. # Changelog :cl: - add: Harpies remembered that just like moths; they also have wings, and can zoom whenever the gravity turns off. Co-authored-by: Danger Revolution! <[email protected]> * Harpy Sprite Update 3 (#556) This will be my third sprite update pack for Harpies, with new sprites courtesy of StillxIcarus (Discord). These include owl wings, and forked tails. I've also personally made a new "Large Ear Tufts" variation. Many sprites have been split between Huescale and Whitescale variations, with Huescale offering greater variety of colors, while Whitescale offers better pure whites(A notable weakness of having only huescale options was that white winged harpies ended up a yellow-cream color). Additionally, I have updated all of the Harpy Hardsuit and Softsuit variations to now include **Wing Sleeves**, with some hardsuits even having personalized color schemes for their sleeves, depending on how important the wearer may be. Of course, all of the syndicate hardsuits have received their own unique schemes for each suit, including for the first time a species-specific Elite Syndicate Suit.   Additionally, I am taking this as a convenient time to move a majority of the Harpy files to the core EE Directory, as I am taking direct responsibility for maintaining my creation here, rather than anywhere else. :cl: - add: Harpy Update 3, New markings for Harpies, all new species-specific hardsuit & softsuit variations that feature wing sleeves. * White Dream Harpy Markings (#696) ONIKS was kind enough to provide me with several new Harpy markings, consisting of alternate Bat-wings, Haven Tail, Long Forked Tail, and Swallow Tail. I have also taken the liberty of actually making a basic set of "Bionic Wings", which are just a slightly edited version of the "harpsuit" wing sleeve, including hardsuit lights. Unfortunately due to limitations in the game's code concerning markings, I couldn't make the lights use the unshaded shader. This limitation irritates me. I'll probably fix that in a separate PR. I actually also received a pack of Arachnid and Felinid sprites! But I'm going to add those in a different PR entirely. <details><summary><h1>Media</h1></summary> <p> Bionic wings  Bat Wings  Haven tail  Swallow tail  Long Forked Tail  </p> </details> :cl: - add: The following new markings have been added for Harpies: Bat Wings, Simple Bionic Wings, Haven Tail, Swallow tail, and Long Forked Tail * Split files * Harpy Hotfix (Cherry-Pick Broke Things) (#570) Captain's Carapace inherited HidesHarpyWings because wizden made it parent off Large outerwear for reasons. I've moved HidesHarpyWings to only LargeOuterwear that actually have harpy sprites so that this won't happen again.   * Uncommented digitigrade inv template * Removed duplicate locale entry * Add comment --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: VMSolidus <[email protected]> Co-authored-by: Danger Revolution! <[email protected]>
# Description This ports Simple-Station/Parkstation-Friendly-Chainsaw#46. This PR is something I consider a key feature adjacent to Space Wind Rework and its accompanying updates, and is an essential part of the space station experience. In practice, this weirdly enough makes being launched into space a bit easier to survive, since instead of needing to throw potentially hundreds of items, you can simply throw enough items to get started flying in the direction of the station and will eventually float back to the station. --- <details><summary><h1>Media</h1></summary> <p> https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/5570ef35-16e2-493a-ac35-738f27751346 https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/51fba943-8dce-4265-a9cc-7181155eb8de https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/cd6c0511-2639-4e14-8160-426ba7f2ba73 --- </p> </details> # Changelog :cl: DEATHB4DEFEAT - tweak: Space has suddenly become less dense (objects don't slow down in space) - remove: Moths are unable to move in space - tweak: Moths have way better control in zero gravity environments --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: DEATHB4DEFEAT <[email protected]>
# Description During PR DeltaV-Station#464, somehow Moth's got back their ability to move with their wings whenever the gravity gets shut off. Well, I'm here to correct the injustice by also putting it on Harpies. In fact, Harpies have a much bigger claim to it, their wings are absolutely massive compared to Moths. # Changelog :cl: - add: Harpies remembered that just like moths; they also have wings, and can zoom whenever the gravity turns off. Co-authored-by: Danger Revolution! <[email protected]>
About the PR
Add a Crime Assist program, which helps Security and Lawyer players determine what crime was committed without having to have a wiki open.
Why / Balance
For many players, evidently, reading up on Space Law is an insurmountable obstacle, and as a result they have trouble identifying what is and isn't a crime. For this reason, a PDA program that gives a basic way to see what sort of crime was committed may help.
Technical details
The PDA program is fairly simple. It has a ew buttons (Start, Home, Yes, No) which are visible/invisible depending on the program's State. This State also determines which Localization string is displayed.
Media
Base flowchart (though I fixed the issue where you're always guilty of Hooliganism)

Credit goes to @IcedQuinn for the chart! It's been both very helpful as well as the inspiration for the entire program.
Breaking changes
Changelog
🆑