Implement GetCameraRoom instead of GetCameraUnderwater

This commit is contained in:
Lwmte 2023-12-18 01:58:05 +01:00
parent 15b4ad2b46
commit dbf69de04f
3 changed files with 10 additions and 9 deletions

View file

@ -30,7 +30,7 @@ Version 1.3
Lua API changes:
* Add Lara:GetInteractedMoveable() which returns currently interacted moveable by Lara.
* Add Moveable:SetStatus() to set the current status of the moveable.
* Add View:GetCameraUnderwater() to check underwater status of the camera.
* Add View:GetCameraRoom() to get a room where camera is currently placed.
Version 1.2
===========

View file

@ -295,7 +295,7 @@ static constexpr char ScriptReserved_SetCineBars[] = "SetCineBars";
static constexpr char ScriptReserved_SetFOV[] = "SetFOV";
static constexpr char ScriptReserved_GetFOV[] = "GetFOV";
static constexpr char ScriptReserved_GetCameraType[] = "GetCameraType";
static constexpr char ScriptReserved_GetCameraUnderwater[] = "GetCameraUnderwater";
static constexpr char ScriptReserved_GetCameraRoom[] = "GetCameraRoom";
static constexpr char ScriptReserved_KeyIsHeld[] = "KeyIsHeld";
static constexpr char ScriptReserved_KeyIsHit[] = "KeyIsHit";

View file

@ -11,6 +11,7 @@
#include "Scripting/Internal/ScriptUtil.h"
#include "Scripting/Internal/TEN/Color/Color.h"
#include "Scripting/Internal/TEN/DisplaySprite/ScriptDisplaySprite.h"
#include "Scripting/Internal/TEN/Objects/Room/RoomObject.h"
#include "Scripting/Internal/TEN/View/AlignModes.h"
#include "Scripting/Internal/TEN/View/CameraTypes.h"
#include "Scripting/Internal/TEN/View/ScaleModes.h"
@ -67,10 +68,10 @@ namespace TEN::Scripting::View
{
return Camera.oldType;
}
static bool GetCameraUnderwater()
static std::unique_ptr<Room> GetCameraRoom()
{
return Camera.underwater;
return std::make_unique<Room>(g_Level.Rooms[Camera.pos.RoomNumber]);
}
static void ResetObjCamera()
@ -145,10 +146,10 @@ namespace TEN::Scripting::View
//end
tableView.set_function(ScriptReserved_GetCameraType, &GetCameraType);
///Checks if camera is placed underwater or not.
//@function GetCameraUnderwater
//@treturn bool underwater if camera is underwater or not.
tableView.set_function(ScriptReserved_GetCameraUnderwater, &GetCameraUnderwater);
///Gets current room where camera is positioned.
//@function GetCameraRoom
//@treturn Objects.Room current room of the camera
tableView.set_function(ScriptReserved_GetCameraRoom, &GetCameraRoom);
///Enable FlyBy with specific ID
//@function PlayFlyBy