From 6afdb7b6c898c861fd6b6f30a69c7bd7fa267ebd Mon Sep 17 00:00:00 2001 From: Smok94 Date: Sat, 2 Apr 2016 14:43:40 +0200 Subject: [PATCH] First person camera unlocked for Me and Tech *unlocked camaera button for Me and Tech *unlocked first ferson view for Me and Tech *Me and Tech have no "camera view" effect like robots in first person mode #156 --- src/level/robotmain.cpp | 4 ++- src/ui/object_interface.cpp | 49 ++++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp index d7f71be2..274118b7 100644 --- a/src/level/robotmain.cpp +++ b/src/level/robotmain.cpp @@ -2270,7 +2270,9 @@ void CRobotMain::ChangeCamera() ObjectType oType = obj->GetType(); Gfx::CameraType type = controllableObj->GetCameraType(); - if ( oType != OBJECT_MOBILEfa && + if ( oType != OBJECT_HUMAN && + oType != OBJECT_TECH && + oType != OBJECT_MOBILEfa && oType != OBJECT_MOBILEta && oType != OBJECT_MOBILEwa && oType != OBJECT_MOBILEia && diff --git a/src/ui/object_interface.cpp b/src/ui/object_interface.cpp index 81a68006..c2ed098f 100644 --- a/src/ui/object_interface.cpp +++ b/src/ui/object_interface.cpp @@ -1302,8 +1302,9 @@ bool CObjectInterface::CreateInterface(bool bSelect) pw->CreateButton(pos, ddim, 19, EVENT_OBJECT_HELP); } - if ( type != OBJECT_HUMAN && - type != OBJECT_TECH && +//camera button no more disabled for humans + if ( //type != OBJECT_HUMAN && + //type != OBJECT_TECH && !m_object->GetCameraLock() ) { //? if ( m_main->GetShowMap() ) @@ -1396,29 +1397,33 @@ bool CObjectInterface::CreateInterface(bool bSelect) pt->ClearState(STATE_GLINT); } - ddim.x = 64.0f/640.0f; - ddim.y = 64.0f/480.0f; - pos.x = 30.0f/640.0f; - pos.y = 430.0f/480.0f-ddim.y; - pw->CreateGroup(pos, ddim, 13, EVENT_OBJECT_CORNERul); + if (type != OBJECT_HUMAN && + type != OBJECT_TECH) + { + ddim.x = 64.0f / 640.0f; + ddim.y = 64.0f / 480.0f; + pos.x = 30.0f / 640.0f; + pos.y = 430.0f / 480.0f - ddim.y; + pw->CreateGroup(pos, ddim, 13, EVENT_OBJECT_CORNERul); - ddim.x = 64.0f/640.0f; - ddim.y = 64.0f/480.0f; - pos.x = 610.0f/640.0f-ddim.x; - pos.y = 430.0f/480.0f-ddim.y; - pw->CreateGroup(pos, ddim, 14, EVENT_OBJECT_CORNERur); + ddim.x = 64.0f / 640.0f; + ddim.y = 64.0f / 480.0f; + pos.x = 610.0f / 640.0f - ddim.x; + pos.y = 430.0f / 480.0f - ddim.y; + pw->CreateGroup(pos, ddim, 14, EVENT_OBJECT_CORNERur); - ddim.x = 64.0f/640.0f; - ddim.y = 64.0f/480.0f; - pos.x = 30.0f/640.0f; - pos.y = 110.0f/480.0f; - pw->CreateGroup(pos, ddim, 15, EVENT_OBJECT_CORNERdl); + ddim.x = 64.0f / 640.0f; + ddim.y = 64.0f / 480.0f; + pos.x = 30.0f / 640.0f; + pos.y = 110.0f / 480.0f; + pw->CreateGroup(pos, ddim, 15, EVENT_OBJECT_CORNERdl); - ddim.x = 64.0f/640.0f; - ddim.y = 64.0f/480.0f; - pos.x = 610.0f/640.0f-ddim.x; - pos.y = 110.0f/480.0f; - pw->CreateGroup(pos, ddim, 16, EVENT_OBJECT_CORNERdr); + ddim.x = 64.0f / 640.0f; + ddim.y = 64.0f / 480.0f; + pos.x = 610.0f / 640.0f - ddim.x; + pos.y = 110.0f / 480.0f; + pw->CreateGroup(pos, ddim, 16, EVENT_OBJECT_CORNERdr); + } UpdateInterface(); m_lastUpdateTime = 0.0f;