data dirs renamed
[k8-i-v-a-n.git] / Doc / Obsolete / FELL.txt
blobee2db47da6bb958bd8ee8e8ed974b638fbddeb39
1 ----------------------------------------------------------------------------
3                 Fatal Error Listing Library (FELL) documentation
5 ----------------------------------------------------------------------------
7 Overview:
8 ---------
10 A simple system for handing different types of list displays, like the
11 inventory screen of the game or a high score list.
13 Classes:
14 --------
16 highscore (hscore.h)
17 --------------------
19 A class that loads, saves and handles highscore files.
21 highscore(std::string File = "HScore.dat")
23         Creates the class and loads a highscore file with specified
24         filename.
26 Add(long NewScore, std::string NewEntry)
28         Adds a new score entry. The class automatically places the
29         current score to its appropriate position in the list and
30         resizes the list size to one hundred if its longer than that.
31         NewEntry should contain the name of player and the cause of
32         death/victory.
34         Example of usage:
36         highscore HScore;
37         HScore.Add(-1234, "Bill, died of bloodloss after Perttu ate his nuts");
38         HScore.Save();
39         HScore.Draw();
41         Result: Bill is (most likely) placed at the bottom of the score list
42         and the list is drawn onto the screen.
44 Draw()
46         Draws the highscore list and waits for keypress.
48 Save(std::string File)
50         Saves the highscore list.
52 Load(std::string File)
54         Loads a highscore list. Normally called only by the constructor.
56 list (list.h)
57 -------------
59 A simple list class containing list data and draw-to-screen functions.
61 list()
63         Creates an empty list with no topic.
65 list(std::string Topic)
67         Creates an empty list with topic Topic.
69 AddString(std::string S)
71         Adds an element to the list.
73 AddDescription(std::string S)
75         Adds a description to the list. Descriptions are drawn above other
76         list items and they cannot be selected by alphabet keys. Topic
77         counts as the first description.
79 std::string GetString(ushort Index)
81         Returns a previously added element of the list.
83 ushort Length()
85         Returns the total amount of previously added elements.
87 dynarray<std::string>* CString()
89         Returns a pointer to the dynamic element array.
91 ushort Draw(bool WillDrawNumbers)
93         Draws the list onto the screen above the current DoubleBuffer in
94         20 element sections and waits for keypress. WillDrawNumbers
95         determines whether individual alphabet letters are drawn before
96         every element. Pressing the key of element's letter causes the
97         function to terminate and return the index of the element selected,
98         or 0xFFFE if '-' was pressed, 0xFFFD if Escape was pressed and
99         0xFFFF if an illegal key (not of any element nor '-' or Esc) was
100         pressed.
102         Example of usage:
104         list List("Choose your lord:");
105         List.Add("Bill");
106         List.Add("Valpuri");
107         List.Add("Santa Claus");
108         if(List.Draw() == 0)
109         {
110                 ADD_MESSAGE("Suddenly the dungeon just crashes.");
111                 game::CPlayer()->CHP(-98);
112                 game::CPlayer()->CheckDeath("crashed horribly");
113         }
115         Result: Guess twice.
117 DrawDescription()
119         Draws the description strings. Only used by Draw().
121 Empty()
123         Removes all previously added string elements from the list.
124         Descriptions, however, are not affected.
126 ----------------------------------------------------------------------------
128 End of document.