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

Add a lore menu with all tutorial hints #278

Open
Mikolaj opened this issue Oct 25, 2021 · 8 comments
Open

Add a lore menu with all tutorial hints #278

Mikolaj opened this issue Oct 25, 2021 · 8 comments

Comments

@Mikolaj
Copy link
Member

Mikolaj commented Oct 25, 2021

Replace texts of tutorial hints, currently inlined in the code that reports particular events to the player, with constructors of an enumeration datatype to be created for this purpose (and calls to a function that turns the constructors to text, adds a message, etc.). Create a lore menu that lists all tutorial hints and shows which have already been seen in this game.

Extended scope: also keep a record which hints have been seen in all games and let the player not see such hints and also reset the record. [Edit: such record may already exist, but be based on strings, which is more fragile and less performant than enumeration tags.]

@kayvank
Copy link
Contributor

kayvank commented Mar 11, 2022

@Mikolaj is WatchUpdAtomicM.hs an example of such tutorial hints?

@Mikolaj
Copy link
Member Author

Mikolaj commented Mar 11, 2022

Yes, precisely.

@kayvank
Copy link
Contributor

kayvank commented Mar 11, 2022

@Mikolaj Just thinking loud here, looks like we need a
ReaderT, StateT TutorialHint
Do you have preference for package structure? What are your thoughts on:

  • Game.LambdaHack.Client.UI.TutorialHint
  • Game.LambdaHack.Client.UI.TutorialHintM

Similar to Msg.hs & MsgM.hs

@Mikolaj
Copy link
Member Author

Mikolaj commented Mar 12, 2022

It seems the hints are already stored (but probably as a set of strings, and should be as an EnumSet of enums):

engine-src/Game/LambdaHack/Client/UI/Msg.hs-      msgUsedAsHint = S.member msg usedHints

If so, at least at first, it would make sense to keep most of the existing mechanism. Game.LambdaHack.Client.UI.TutorialHint sounds fine for the file in which all the strings are located. With some luck we won't need any monadic code for that, so Game.LambdaHack.Client.UI.TutorialHintM won't be needed.

@kayvank
Copy link
Contributor

kayvank commented Mar 12, 2022

As for the extended scope, is that scoped to SessionUI as described here?

@Mikolaj
Copy link
Member Author

Mikolaj commented Mar 12, 2022

Actually, I only meant extended scope of the task, meaning, extra parts of the task. BTW, you've found where the already seen hints are stored:

https://github.com/LambdaHack/LambdaHack/blob/master/engine-src/Game/LambdaHack/Client/UI/SessionUI.hs#L96

@kayvank
Copy link
Contributor

kayvank commented Mar 15, 2022

@Mikolaj , I did a very small Draft pull request #293 , basically it has some Enums and converts Enums to Text, to make sure I understood the requirements correctly.
However, I am unclear as to what Adding a message means in this context. could you please elaborate on adds a message requirement?

@Mikolaj
Copy link
Member Author

Mikolaj commented Mar 15, 2022

"Adds a message" means msgAdd. See my last comment in the PR. The PR indeed does what it should do.

kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 15, 2022
kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 16, 2022
kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 17, 2022
 Consolidate tutorial-hints in one data type and corresponding unit
 tests in support of issue LambdaHack#278
kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 17, 2022
 Consolidate tutorial-hints in one data type and corresponding unit
 tests in support of issue LambdaHack#278
kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 17, 2022
 Consolidate tutorial-hints in one data type and corresponding unit
 tests in support of issue LambdaHack#278
kayvank added a commit to kayvank/LambdaHack that referenced this issue Mar 17, 2022
 Consolidate tutorial-hints in one data type and corresponding unit
 tests in support of issue LambdaHack#278
Mikolaj pushed a commit that referenced this issue Mar 17, 2022
 Consolidate tutorial-hints in one data type and corresponding unit
 tests in support of issue #278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants