Commit graph

14 commits

Author SHA1 Message Date
hispidence
4e8080b782 Add IdentifierType for named script types. This is in an effort to consolidate a lot of very similar functions into a few templates. 2021-08-27 18:10:19 +01:00
hispidence
1af07aa8b5 Rearrange GameScriptItemInfo a bit.
Exchange m_temporary in the move constructor.
Fix documentation to reference ObjID instead of int.
2021-07-23 02:03:31 +01:00
hispidence
3d464becb2 Make GameScriptItemInfo inherit from GameScriptNamedBase and remove functions which now reside there. 2021-07-21 18:16:35 +01:00
hispidence
ffa8791c03 Add concept of 'temporary' ItemInfo instances. These instances will kill the ITEM_INFO they reference when they are destroyed. This was previously the default behaviour. However, now that we're using things like GetItemByName, it makes more sense for ItemInfos to be non-owning by default.
Move LDoc from GameScriptItemInfo.h to GameScriptItemInfo.cpp. This might seem counter-intuitive, but LDoc is concerned with the Lua interfaces rather than the actual C++ functions; since the Lua interfaces are defined in GameScriptItemInfo::Register, it makes more sense for the comments to be nearby.
2021-07-20 17:18:39 +01:00
hispidence
f379de7c89 Add m_initialised to GameScriptItemInfo. This is possibly temporary, and controls whether SetRoom calls ItemNewRoom or just sets the room number. This is because ItemNewRoom relies on InitialiseItem having been called, but InitialiseItem requires the roomNumber of the object to be correct.
Add and document GetLara.
2021-07-20 00:10:00 +01:00
hispidence
07d9fdae2f Add SetAnimNumber, GetAnimNumber, SetFrameNumber and GetFrameNumber. Fix SetGoalAnimState call. 2021-07-18 17:37:39 +01:00
hispidence
6e11570e3f Rename «Current/Goal/Required»Anim to «Current/Goal/Required»AnimState. 2021-07-18 15:29:40 +01:00
hispidence
552a4f07ae Fix some whitespace. 2021-07-17 23:50:10 +01:00
hispidence
70d7ae4572 Add GameScriptItemInfo::«Set/Get»ObjectID and GameScriptItemInfo::SetNameCallbacks.
Add calls to the callbacks to GameScriptItemInfo::SetName, so that giving a Lua name to an object removes its existing object and any other object currently using the new name, before then putting the name into the map.

Add initial documentation for the Lua-exported parts.
2021-07-17 23:47:07 +01:00
hispidence
61d5767035 Add and register "name" getter and setter for the string ID of an item. 2021-07-05 18:19:10 +01:00
hispidence
3b6e0e1b8c Merge GameScriptInfo into GameScriptItemInfo. Add move constructor. Make functions use item ptr directly. 2021-07-01 19:27:57 +01:00
hispidence
56a305b546 Add CreateEmpty, so that new can be called on the Lua side with no args.
Change pos and rot from arrays to GameScript[Position/Rotation].

Add getters and setters for the members used so far.

Add Init, which for now is needed to get an item working properly.
2021-06-30 14:08:12 +01:00
MontyTRC89
d25cfb6c92 Moved GameScriptPosition, GameScriptRotation and GameScriptColor classes in separate files 2021-06-29 05:28:17 +02:00
Brad Ellis
434707286c Add GameScriptItemInfo class.
This is the first pass at wrapping an ITEM_INFO in a struct and handing it over to Lua. Many improvements should follow - this is more of a test implementation.
2021-06-28 18:23:26 +01:00