Add and fix documentation.

This commit is contained in:
hispidence 2021-08-21 00:29:54 +01:00
parent ce38cae2d7
commit 73eb96ee39
2 changed files with 86 additions and 57 deletions

View file

@ -171,93 +171,106 @@ void GameScriptItemInfo::Register(sol::state* state)
sol::meta_function::index, index_error, sol::meta_function::index, index_error,
sol::meta_function::new_index, newindex_error, sol::meta_function::new_index, newindex_error,
/// Initialise an item. /// Initialise an item.
//Use this if you called new with no arguments //Use this if you called new with no arguments
// @function ItemInfo.Init // @function ItemInfo.Init
"Init", &GameScriptItemInfo::Init, "Init", &GameScriptItemInfo::Init,
/// Enable the item /// Enable the item
// @function ItemInfo:EnableItem // @function ItemInfo:EnableItem
"Enable", &GameScriptItemInfo::EnableItem, "Enable", &GameScriptItemInfo::EnableItem,
/// Disable the item /// Disable the item
// @function ItemInfo:DisableItem // @function ItemInfo:DisableItem
"Disable", &GameScriptItemInfo::DisableItem, "Disable", &GameScriptItemInfo::DisableItem,
/// (@{ObjID}) object ID /// (@{ObjID}) object ID
// @mem objectID // @mem objectID
"objectID", sol::property(&GameScriptItemInfo::GetObjectID, &GameScriptItemInfo::SetObjectID), "objectID", sol::property(&GameScriptItemInfo::GetObjectID, &GameScriptItemInfo::SetObjectID),
/// (int) State of current animation /*** (int) current animation state
// @mem currentAnimState
The state number of the animation the object is currently doing.
This corresponds to "state" number shown in the animation editor of WadTool.
@mem currentAnimState
*/
"currentAnimState", sol::property(&GameScriptItemInfo::GetCurrentAnimState, &GameScriptItemInfo::SetCurrentAnimState), "currentAnimState", sol::property(&GameScriptItemInfo::GetCurrentAnimState, &GameScriptItemInfo::SetCurrentAnimState),
/// (int) State of required animation /// (int) State of required animation
// @mem requiredAnimState // @mem requiredAnimState
"requiredAnimState", sol::property(&GameScriptItemInfo::GetRequiredAnimState, &GameScriptItemInfo::SetRequiredAnimState), "requiredAnimState", sol::property(&GameScriptItemInfo::GetRequiredAnimState, &GameScriptItemInfo::SetRequiredAnimState),
/// (int) State of goal animation /// (int) State of goal animation
// @mem goalAnimState // @mem goalAnimState
"goalAnimState", sol::property(&GameScriptItemInfo::GetGoalAnimState, &GameScriptItemInfo::SetGoalAnimState), "goalAnimState", sol::property(&GameScriptItemInfo::GetGoalAnimState, &GameScriptItemInfo::SetGoalAnimState),
/// (int) animation number /*** (int) animation number
// @mem animNumber
The index of the animation the object is currently doing.
This corresponds to the number shown in the item's animation list in WadTool.
@mem animNumber
*/
"animNumber", sol::property(&GameScriptItemInfo::GetAnimNumber, &GameScriptItemInfo::SetAnimNumber), "animNumber", sol::property(&GameScriptItemInfo::GetAnimNumber, &GameScriptItemInfo::SetAnimNumber),
/// (int) frame number /*** (int) frame number
// @mem frameNumber
Current fame of the animation the object is currently doing.
The number of frames in an animation can be seen under the heading "End frame" in
the WadTool animation editor.
@mem frameNumber
*/
"frameNumber", sol::property(&GameScriptItemInfo::GetFrameNumber, &GameScriptItemInfo::SetFrameNumber), "frameNumber", sol::property(&GameScriptItemInfo::GetFrameNumber, &GameScriptItemInfo::SetFrameNumber),
/// (int) HP (hit points/health points) of object /// (int) HP (hit points/health points) of object
//@raise an exception if the object is intelligent and an invalid //@raise an exception if the object is intelligent and an invalid
//hp value is given //hp value is given
// @mem HP // @mem HP
"HP", sol::property(&GameScriptItemInfo::GetHP, &GameScriptItemInfo::SetHP), "HP", sol::property(&GameScriptItemInfo::GetHP, &GameScriptItemInfo::SetHP),
/// (int) OCB (object code bit) of object /// (int) OCB (object code bit) of object
// @mem OCB // @mem OCB
"OCB", sol::property(&GameScriptItemInfo::GetOCB, &GameScriptItemInfo::SetOCB), "OCB", sol::property(&GameScriptItemInfo::GetOCB, &GameScriptItemInfo::SetOCB),
/// (table) item flags of object (table of 8 ints) /// (table) item flags of object (table of 8 ints)
// @mem itemFlags // @mem itemFlags
"itemFlags", sol::property(&GameScriptItemInfo::GetItemFlags, &GameScriptItemInfo::SetItemFlags), "itemFlags", sol::property(&GameScriptItemInfo::GetItemFlags, &GameScriptItemInfo::SetItemFlags),
/// (int) AIBits of object. Will be clamped to [0, 255] /// (int) AIBits of object. Will be clamped to [0, 255]
// @mem AIBits // @mem AIBits
"AIBits", sol::property(&GameScriptItemInfo::GetAIBits, &GameScriptItemInfo::SetAIBits), "AIBits", sol::property(&GameScriptItemInfo::GetAIBits, &GameScriptItemInfo::SetAIBits),
/// (int) status of object. /// (int) status of object.
// possible values: // possible values:
// 0 - not active // 0 - not active
// 1 - active // 1 - active
// 2 - deactivated // 2 - deactivated
// 3 - invisible // 3 - invisible
// @mem status // @mem status
"status", sol::property(&GameScriptItemInfo::GetStatus, &GameScriptItemInfo::SetStatus), "status", sol::property(&GameScriptItemInfo::GetStatus, &GameScriptItemInfo::SetStatus),
/// (bool) hit status of object /// (bool) hit status of object
// @mem hitStatus // @mem hitStatus
"hitStatus", sol::property(&GameScriptItemInfo::GetHitStatus, &GameScriptItemInfo::SetHitStatus), "hitStatus", sol::property(&GameScriptItemInfo::GetHitStatus, &GameScriptItemInfo::SetHitStatus),
/// (bool) whether or not the object is active /// (bool) whether or not the object is active
// @mem active // @mem active
"active", sol::property(&GameScriptItemInfo::GetActive, &GameScriptItemInfo::SetActive), "active", sol::property(&GameScriptItemInfo::GetActive, &GameScriptItemInfo::SetActive),
/// (int) room the item is in /// (int) room the item is in
// @mem room // @mem room
"room", sol::property(&GameScriptItemInfo::GetRoom, &GameScriptItemInfo::SetRoom), "room", sol::property(&GameScriptItemInfo::GetRoom, &GameScriptItemInfo::SetRoom),
/// (@{Position}) position in level /// (@{Position}) position in level
// @mem pos // @mem pos
"pos", sol::property(&GameScriptItemInfo::GetPos, &GameScriptItemInfo::SetPos), "pos", sol::property(&GameScriptItemInfo::GetPos, &GameScriptItemInfo::SetPos),
/// (@{Rotation}) rotation represented as degree angles about X, Y, and Z axes /// (@{Rotation}) rotation represented as degree angles about X, Y, and Z axes
// @mem rot // @mem rot
"rot", sol::property(&GameScriptItemInfo::GetRot, &GameScriptItemInfo::SetRot), "rot", sol::property(&GameScriptItemInfo::GetRot, &GameScriptItemInfo::SetRot),
/// (string) unique string identifier. /// (string) unique string identifier.
// e.g. "door_back_room" or "cracked_greek_statue" // e.g. "door\_back\_room" or "cracked\_greek\_statue"
// @mem name // @mem name
"name", sol::property(&GameScriptItemInfo::GetName, &GameScriptItemInfo::SetName) "name", sol::property(&GameScriptItemInfo::GetName, &GameScriptItemInfo::SetName)
); );
} }

View file

@ -81,7 +81,9 @@ pickups, and Lara herself.</p>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ItemInfo.currentAnimState">ItemInfo.currentAnimState</a></td> <td class="name" ><a href="#ItemInfo.currentAnimState">ItemInfo.currentAnimState</a></td>
<td class="summary">(int) State of current animation</td> <td class="summary">(int) current animation state</p>
<p>The state number of the animation the object is currently doing.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ItemInfo.requiredAnimState">ItemInfo.requiredAnimState</a></td> <td class="name" ><a href="#ItemInfo.requiredAnimState">ItemInfo.requiredAnimState</a></td>
@ -93,11 +95,15 @@ pickups, and Lara herself.</p>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ItemInfo.animNumber">ItemInfo.animNumber</a></td> <td class="name" ><a href="#ItemInfo.animNumber">ItemInfo.animNumber</a></td>
<td class="summary">(int) animation number</td> <td class="summary">(int) animation number</p>
<p>The index of the animation the object is currently doing.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ItemInfo.frameNumber">ItemInfo.frameNumber</a></td> <td class="name" ><a href="#ItemInfo.frameNumber">ItemInfo.frameNumber</a></td>
<td class="summary">(int) frame number</td> <td class="summary">(int) frame number</p>
<p>Current fame of the animation the object is currently doing.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ItemInfo.HP">ItemInfo.HP</a></td> <td class="name" ><a href="#ItemInfo.HP">ItemInfo.HP</a></td>
@ -208,7 +214,10 @@ out of scope).</td>
<strong>ItemInfo.currentAnimState</strong> <strong>ItemInfo.currentAnimState</strong>
</dt> </dt>
<dd> <dd>
(int) State of current animation (int) current animation state</p>
<p>The state number of the animation the object is currently doing.
This corresponds to "state" number shown in the animation editor of WadTool.
@ -250,7 +259,10 @@ out of scope).</td>
<strong>ItemInfo.animNumber</strong> <strong>ItemInfo.animNumber</strong>
</dt> </dt>
<dd> <dd>
(int) animation number (int) animation number</p>
<p>The index of the animation the object is currently doing.
This corresponds to the number shown in the item's animation list in WadTool.
@ -264,7 +276,11 @@ out of scope).</td>
<strong>ItemInfo.frameNumber</strong> <strong>ItemInfo.frameNumber</strong>
</dt> </dt>
<dd> <dd>
(int) frame number (int) frame number</p>
<p>Current fame of the animation the object is currently doing.
The number of frames in an animation can be seen under the heading "End frame" in
the WadTool animation editor.
@ -424,7 +440,7 @@ out of scope).</td>
</dt> </dt>
<dd> <dd>
(string) unique string identifier. (string) unique string identifier.
e.g. "door<em>back</em>room" or "cracked<em>greek</em>statue" e.g. "door_back_room" or "cracked_greek_statue"
@ -655,7 +671,7 @@ Use this if you called new with no arguments
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2021-08-16 12:53:44 </i> <i style="float:right;">Last updated 2021-08-21 00:29:08 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>