Page 1 of 7

Journal task

Posted: 11 Oct 2011, 16:33
by gus
I've a very simple question: I want that when i press 'j' the journal open. Where should I add the code about the 'j' key?

Re: Jounal task

Posted: 11 Oct 2011, 18:20
by Star-Demon

Code: Select all

enum Actions
      A_Quit,           // Exit the program

      A_Screenshot,     // Take a screenshot

      A_Inventory,      // Toggle inventory screen

      A_Console,        // Toggle console screen

      A_MoveLeft,       // Move player left / right
      A_MoveForward,    // Forward / Backward


      A_Use,        //Use weapon, spell, etc.
      A_AutoMove,   //Toggle Auto-move forward
      A_Rest,       //Rest
      A_Journal,    //Journal
      A_Weapon,     //Draw/Sheath weapon
      A_Spell,      //Ready/Unready Casting
      A_AlwaysRun,  //Toggle Always Run
      A_CycleSpellLeft, //cycling through spells
      A_CycleWeaponLeft,//Cycling through weapons
      A_ToggleSneak,    //Toggles Sneak, add Push-Sneak later
      A_ToggleWalk, //Toggle Walking/Running


      A_LAST            // Marker for the last item
Action is described in there. I suppose you'd add in in that file.

Re: Jounal task

Posted: 11 Oct 2011, 18:40
by gus
Thanks Star!

Re: Journal task

Posted: 17 Oct 2011, 21:27
by gus
A little update: I've done some preliminary work: the J key is now binded to a new window.
The real task starts now (ie display the journal in that window).

Re: Journal task

Posted: 21 Oct 2011, 08:08
by Zini
I don't see any of your code on github yet. Any more progress? (okay, I know it's only 4 days since your last posting, but I am spoiled from the rapid progress with the mwrender refactoring).

Re: Journal task

Posted: 21 Oct 2011, 13:51
by gus
I haven't commited my change yet (as it's still messy). There has been a few progress since last time, but not that much. I'm stuck because i don't know how to display a list of string with MyGUI, but I asked in MyGUI forum, and i hope I will have an answere soon.

BTW, to start with, i will do a very simple journal: a scrollable journal, with all entry at the same place. (I don't know if I'm very clear^^)
(okay, I know it's only 4 days since your last posting, but I am spoiled from the rapid progress with the mwrender refactoring).

Re: Journal task

Posted: 21 Oct 2011, 14:50
by Zini
Okay. Keep in mind that you need to render to four different targets: journal pages, book pages (different task, but at least the layout code should be reusable), scrolls (different task too) and layouting for previous journal pages (the journal opens on the last page; you need to layout all previous pages to determine the page number and what the first entry is).

I good method to handle these requirements is to split the functionality into two classes:

- a render target: a base class that can be specialised for each of the cases listed above

- a layouter: operates on a render target and has a layout-function, which takes a journal entry as argument and calls the various functions of the render target (e.g. getWidth, getHeight, addText, addPicture, newPage).

But it is ultimately up to you how you want to implement it.

Re: Journal task

Posted: 21 Oct 2011, 15:18
by gus
What you propose is much more complicated than what I had in mind.
If I understand well, we should do something different than morrowind journal (as it was pretty bad).

So I had in mind a very simple design (which is IIRC the same than oblivion):

Code: Select all

Quest                         Entry:
*quest1      s                   *entry1        s
*            c                   *              c
*            r                   *              r
*            o                   *              o
*            l                   *              l
*questn      l                   *entrym        l
And when you click on a quest (for exmple quest1) you get the entrys related to the quest.

Is it OK?
As with this implementation, none of the code would be reusable for books and scroll

Re: Journal task

Posted: 21 Oct 2011, 15:38
by Zini
We can improve the usability of the journal GUI, but we should not cut out features. As such implementing the chronological view is a must (and AFAIR Oblivion supports this too).
Reusability of the layout code is important. We may decide at some point to add additional layout features. If we have separate code for journal, books and scrolls. we would need to duplicate these improvements for each GUI.

Re: Journal task

Posted: 23 Oct 2011, 15:47
by gus
I understand uniting book and journal, but scroll is pretty different no? (do not really remember).

But well, I will focus on the journal class for now, and when it's done, i will create a common interface for book/journal at least, and maybe scrolls. But it might take some time: as star pointed out, there is very little documentation for MyGUI.