2 #define SHOW_DISCLAIMER
5 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Limited camera for in-game editor. Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
19 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"Prefab of class SCR_ManualCamera",
"et",
category:
"Camera")]
20 private ResourceName m_LimitedCameraPrefab;
22 #ifdef SHOW_DISCLAIMER
23 private ref DebugTextScreenSpace m_Disclaimer;
24 private float m_fDisclaimerCountdown;
27 override protected ResourceName GetCameraPrefab()
30 if (!manager)
return ResourceName.Empty;
33 bool isLimited = manager.IsLimited() && !DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_UNLIMITED);
35 #ifdef SHOW_DISCLAIMER
38 m_Disclaimer = DebugTextScreenSpace.Create(
GetGame().GetWorld(),
"", 0, 50, 50, 10, ARGBF(1, 1, 1, 1), ARGBF(1, 0, 0, 0));
39 m_fDisclaimerCountdown = 15;
44 return m_LimitedCameraPrefab;
46 return super.GetCameraPrefab();
48 #ifdef SHOW_DISCLAIMER
49 override void EOnFrame(IEntity owner,
float timeSlice)
51 super.EOnFrame(owner, timeSlice);
55 m_fDisclaimerCountdown -= timeSlice;
56 m_Disclaimer.SetText(
string.Format(
"Armavision camera is restricted around player when no other editor modes are available.\n\nTo unlock it for testing, activate: Debug Menu > Manual Camera > Unlimited Movement\nRestart the editor afterwards.\n\nThis message will disappear in %1 s.", Math.Ceil(m_fDisclaimerCountdown)));
57 if (m_fDisclaimerCountdown < 0)
delete m_Disclaimer;
61 override protected void EOnEditorActivate()
63 super.EOnEditorActivate();
66 if (editorManager) editorManager.GetOnLimitedChange().Insert(ReplaceCamera);
68 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_UNLIMITED,
"",
"Unlimited Movement",
"Manual Camera");
70 override protected void EOnEditorDeactivate()
72 super.EOnEditorDeactivate();
75 if (editorManager) editorManager.GetOnLimitedChange().Remove(ReplaceCamera);
79 #ifdef SHOW_DISCLAIMER