Skip to content
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

Tutorial recording system overhaul #129

Merged
merged 71 commits into from
Apr 20, 2023
Merged

Conversation

Lowie375
Copy link
Member

@Lowie375 Lowie375 commented Jul 19, 2022

This PR is part 1 of the tutorial recording system overhaul, which contains many of the core features of the overhaul. This has been opened in its current state so that user tests of this system can be done on a build from the develop branch for simplicity.

  • Redesign the tutorial recording menu so that it is easier to use
  • Allow multiple items and privileges to be given on tutorial completion
  • Allow tutorial action grouping
    • Players can complete actions within a group in any order
    • The tutorial will progress once all actions in the group have been completed
  • Add support for tutorial dependencies/dependents

Please see #145 for more detailed information about what this PR includes and what is on the roadmap for part 2 of the tutorial recording system overhaul.

Lowie375 added 14 commits June 29, 2022 16:48
* Reformat tutorial_settings.conf to adhere to configuration file formatting instead of lua file formatting
* Store information in comma-separated lists instead of lua tables (which are unrecognized in configuration files)
* Add additional functions for reading settings information as tables
* Refactor check_pos_x_tolerance, check_pos_y_tolerance, and check_pos_z_tolerance to single check_pos_tolerance list
* Add updated _mc_tool_privs fields to tool definitions
* Add prototypes for rewards and dependencies tabs
* Update other prototypes to formspec v6 (no visual differences)
* Replace old tutorial table booleans with player-keyed tables
* Replace instancedTutorial with temp since they were mutually exclusive
* Separate check_pos_tolerance back into 3 separate settings
* Add helper function from mc_toolhandler to mc_helpers
* Make timers player-specific
* Re-implement keystroke detection system
* Helps avoid potential mod naming conflicts
* Replace existing recording options screen with prototype shell
* Begin refactoring save system to use new outputs
* Replace stringified event names with enum
* Implement tab switching system
* Update recorded defaults to false for consistency + ease of use
  * false can easily be checked for with a not [variable] check
* Replace redundant code with mc_tutorial.register_tutorial_action
* Add registered items/tools/nodes/privileges to selectable reward list in rewards tab
* Begin working on adding event sequence to events tab
* Add edit button+ populate event list in "Events" tab of recording formspec
* Merge separate sequence tables into one table with relevant keys indexed
* Split single storage value into multiple values, indexed by tutorial ID
* Refactor various fields in mc_tutorial into player-specific context tables
* Update return of mc_helpers.getInventoryItemLocation to match function signature
@pauldpickell
Copy link
Contributor

This formspec looks so much better! Just a thought, might we add an item_image element above or below the Available Rewards list that shows the highlighted element in the list? The technical names might not mean much to the lay user. Maybe we need icons for the privs?

@Lowie375
Copy link
Member Author

Lowie375 commented Jul 23, 2022

Just a thought, might we add an item_image element above or below the Available Rewards list that shows the highlighted element in the list?

Yes, that's a great idea! Will work on adding that in

Maybe we need icons for the privs?

This might be helpful too, since some privs aren't very simple to understand from name alone. Will also see if any privs have descriptions that we could use as well
UPDATE: Privileges do have descriptions, will look into integrating a way to view that as well

Lowie375 added 3 commits July 26, 2022 13:03
* Accept table with properties as instead of individual properties as arguments
* Old function still exists but is deprecated - will be fully replaced soon
* New fields will display information about the reward selected most recently (from either list)
…tener

* Make tutorials properly display in tutorial book + function as intended
* Save tutorial saving menu text field content on tab switch
* Block access to tutorials saved in old formats
  * Format conversion may be possible, but that will be considered at a later point in time
@Lowie375 Lowie375 linked an issue Jul 27, 2022 that may be closed by this pull request
45 tasks
Lowie375 added 10 commits July 28, 2022 15:35
* Fix stack overflow caused by minetest.after call in mc_tutorial.tutorial_progress_listener
* Return tutorial deletion functionality to tutorial book
* Add format identifier to player data
* Fix recording key detection algorithm
* Add nil check for listener function call
* Allow rewards (privs/items) to be added to and removed from tutorials
* Give players rewards on tutorial completion
* Give tutorial rewards only on first completion of each tutorial
* Fix crash when running `/listTutorials` due to existence of next_id field
* Populate reward menu with existing rewards when editing a tutorial
* Add nil check before calls to mc_helpers.trim in get_selected_reward_info
* Fix selection adjuster for selected reward list
* Make delete, duplicate, and movement buttons functional
* Make event list preserve selection
* Make "add group" button on event tab functional
* Bump tutorial save format to v4 to reflect addition of event groups (compatible with v3)
* Keep colour and string separate in preparation for search functionality implementation
* Make listener use minetest.get_objects_in_area to simplify checks
* Allow actions within groups to be completed in any order
* Do not allow groups to be placed within other groups (since this does not make sense)
Copy link
Member

@lukasgolson lukasgolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; I don't see any issues after a simple review.

* Fixes issue where dig callbacks register dug items as tools when they shouldn't
@Lowie375 Lowie375 added the Feature New feature or request label Aug 22, 2022
@Lowie375 Lowie375 marked this pull request as draft September 8, 2022 21:12
@Lowie375 Lowie375 changed the base branch from develop to develop_merge_clone November 3, 2022 18:23
@Lowie375 Lowie375 changed the base branch from develop_merge_clone to develop November 3, 2022 18:24
@Lowie375 Lowie375 changed the base branch from develop to develop_merge_clone November 3, 2022 18:24
@Lowie375 Lowie375 changed the base branch from develop_merge_clone to develop November 3, 2022 18:33
* Redesign tutorial recording tool right-click menu
* Allow recording to be stopped from right-click menu
* Remove sidebar (merged into main info area)
* Change key action menu from list + buttons to 2 lists (currently not functional)
* Remove technical names from action selection dropdown
* Add additional info to position and direction action menus
…ed area

* These actions will not be automatically removed from tutorials made in protected areas, since the recorder could have changed realms while recording
* Store key events as bitfields instead of tables of strings
* Add helper functions to convert between key bitfields and table of key strings
* Add update code for tutorials in older formats
* Repopulate "press key" event data on events tab after tutorial reformatting
* Fix event popup menu selection bug which broke "paste selected" buttons and "press key" screen
* Add additional format >= 3 check before editing tutorials
  * Allowing unplayable dynamic V1/V2 tutorials to be edited may cause crashing and other unexpected behaviour
* Prevent empty "press key" events from being added/saves
* This should help improve memory usage
* Move tutorial commands to commands.lua
* Move tutorials_exist function to functions.lua
* Modeled after redesigned student notebook formspec by @mandyhuy
* Add "Exit without saving" button to tutorial recording/editing formspec
* Restyle tutorial book formspec buttons
* Gray out prohibited actions in tutorial book (starting a locked tutorial, editing/deleting an active tutorial)
* Notebook formspec generator function will be moved to mc_core once #183 is merged
…redesign

* Add new API helper to mc_toolhandler
* Begin moving tutortial recording formspec to notebook format
* Make double-clicking on events in the "events" tab open the "edit" dialog
* Populate tutorial summary + append summary info to tutorial info in tutorial book
* Classify privileges internally as SAFE, CAUTION, or UNSAFE (subject to change)
  * SAFE = shout, interact, etc.
  * CAUTION = noclip, give, teleport, etc.
  * UNSAFE = teacher, privs, ban, etc.
* Add description warning messages for CAUTION, UNSAFE, and unclassified privs
* Add warning popup + red colour for UNSAFE privs
@Lowie375 Lowie375 marked this pull request as ready for review April 14, 2023 02:41
@Lowie375 Lowie375 requested a review from pauldpickell April 14, 2023 02:41
@pauldpickell pauldpickell merged commit 5613390 into develop Apr 20, 2023
@pauldpickell pauldpickell deleted the features/tutorial_recording branch August 10, 2023 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Dynamic tutorial framework improvements
3 participants