-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thour tiny tutorial tweaks (and a unit test) (#5695)
# About the pull request <ol> <li> Commit 5014927: Makes the 'Tutorial Menu' automatically close when a tutorial is started. <ul> <li>Also adds an <code>abort_tutorial()</code> call to <code>/datum/tutorial/proc/start_tutorial()</code>, since it may have been possible to for player to get trapped in the tutorial otherwise.</li> </ul> </li> <li>Commit b10974c: Adds a <code>tutorial_id</code> to the basic Xenomorph tutorial.</li> <li>Commit 38c03c9: Edited the tutorial Xenomorph a bit so that it's always "You are Inquisitive Drone (XX-123)", as opposed to "You are Inquisitive Young/Mature/etc. Drone (XX-123)".</li> <li> Commits a595b97 + 27e38e6: Adds a basic unit test for <code>/datum/tutorial</code> subtypes to verify that they have set some basic variables. <ul> <li>Also lightly organises the <code>#include</code>s in <code>code/modules/unit_tests/_unit_tests.dm</code>.</li> </ul> </li> </ol> # Explain why it's good for the game Just a couple of things I noticed while exploring tutorial code. The third commit is maybe a bit subjective, but I personally think it makes the tutorials seem like more of a separate game state, if that makes sense. # Testing Photographs and Procedure <details> <summary>Screenshots & Videos</summary> Put screenshots and videos here with an empty line between the screenshots and the `<details>` tags. </details> # Changelog :cl: ui: Made the Tutorial Menu automatically close when a tutorial is started. code: Made the tutorial Xenomorph not inherit the user's 'age' prefix. code: Added a basic unit test for tutorials. /:cl:
- Loading branch information
Showing
6 changed files
with
39 additions
and
7 deletions.
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
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 |
---|---|---|
|
@@ -79,5 +79,6 @@ | |
return | ||
|
||
path = new path | ||
path.start_tutorial(usr) | ||
return TRUE | ||
if(path.start_tutorial(usr)) | ||
ui.close() | ||
return TRUE |
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
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
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
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,19 @@ | ||
/datum/unit_test/tutorials | ||
|
||
/datum/unit_test/tutorials/Run() | ||
var/datum/tutorial/base_path = /datum/tutorial | ||
for(var/datum/tutorial/tutorial_path as anything in subtypesof(base_path)) | ||
if(initial(tutorial_path.parent_path) == tutorial_path) | ||
continue | ||
|
||
// Make sure these variables are overridden on any subtypes. | ||
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.name), initial(base_path.name), | ||
"[tutorial_path] does not have a name set.") | ||
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.tutorial_id), initial(base_path.tutorial_id), | ||
"[tutorial_path] does not have a tutorial_id set.") | ||
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.desc), initial(base_path.desc), | ||
"[tutorial_path] does not have a desc set.") | ||
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.icon_state), initial(base_path.icon_state), | ||
"[tutorial_path] does not have an icon_state set.") | ||
|
||
// TODO: Add a test verifying that a basic tutorial can be started and completed. (Requires unit test client handling) |