Commit graph

14 commits

Author SHA1 Message Date
hispidence
b5fe8904c1 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
8473d26425 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
31605294ea Make GameScriptItemInfo inherit from GameScriptNamedBase and remove functions which now reside there. 2021-07-21 18:16:35 +01:00
hispidence
24b7d549f6 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
58ba18b5bc 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
513888ed3c Add SetAnimNumber, GetAnimNumber, SetFrameNumber and GetFrameNumber. Fix SetGoalAnimState call. 2021-07-18 17:37:39 +01:00
hispidence
4ec17f525c Rename «Current/Goal/Required»Anim to «Current/Goal/Required»AnimState. 2021-07-18 15:29:40 +01:00
hispidence
d08585a9e0 Fix some whitespace. 2021-07-17 23:50:10 +01:00
hispidence
4342c8c466 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
988d595955 Add and register "name" getter and setter for the string ID of an item. 2021-07-05 18:19:10 +01:00
hispidence
68f4603c9c Merge GameScriptInfo into GameScriptItemInfo. Add move constructor. Make functions use item ptr directly. 2021-07-01 19:27:57 +01:00
hispidence
d225041048 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
a507e9e1be Moved GameScriptPosition, GameScriptRotation and GameScriptColor classes in separate files 2021-06-29 05:28:17 +02:00
hispidence
5a1c6f78ac 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