Improve camera floater
parent
db15a86f2e
commit
533b3540cc
|
|
@ -393,9 +393,11 @@ BOOL LLFloaterCamera::postBuild()
|
|||
mTrack = getChild<LLJoystickCameraTrack>(PAN);
|
||||
mPresetCombo = getChild<LLComboBox>("preset_combo");
|
||||
|
||||
getChild<LLTextBox>("precise_ctrs_label")->setShowCursorHand(false);
|
||||
getChild<LLTextBox>("precise_ctrs_label")->setSoundFlags(LLView::MOUSE_UP);
|
||||
getChild<LLTextBox>("precise_ctrs_label")->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE));
|
||||
// <FS:Ansariel> Improved camera floater
|
||||
//getChild<LLTextBox>("precise_ctrs_label")->setShowCursorHand(false);
|
||||
//getChild<LLTextBox>("precise_ctrs_label")->setSoundFlags(LLView::MOUSE_UP);
|
||||
//getChild<LLTextBox>("precise_ctrs_label")->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE));
|
||||
// </FS:Ansariel>
|
||||
|
||||
mPresetCombo->setCommitCallback(boost::bind(&LLFloaterCamera::onCustomPresetSelected, this));
|
||||
LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCamera::populatePresetCombo, this));
|
||||
|
|
@ -555,6 +557,16 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param)
|
|||
if (camera_floater)
|
||||
camera_floater->switchMode(CAMERA_CTRL_MODE_FREE_CAMERA);
|
||||
}
|
||||
// <FS:Ansariel> Improved camera floater
|
||||
else if ("reset_view" == name)
|
||||
{
|
||||
LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance();
|
||||
if (camera_floater)
|
||||
camera_floater->switchMode(CAMERA_CTRL_MODE_PAN);
|
||||
gAgentCamera.changeCameraToDefault();
|
||||
switchToPreset("rear_view");
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
else
|
||||
{
|
||||
LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance();
|
||||
|
|
|
|||
|
|
@ -32,12 +32,14 @@
|
|||
#include "lluictrlfactory.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llpresetsmanager.h"
|
||||
|
||||
|
||||
LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this));
|
||||
mCommitCallbackRegistrar.add("CameraPresets.Save", boost::bind(&LLFloaterPreferenceViewAdvanced::onSavePreset, this)); // <FS:Ansariel> Improved camera floater
|
||||
}
|
||||
|
||||
LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced()
|
||||
|
|
@ -80,3 +82,18 @@ void LLFloaterPreferenceViewAdvanced::onCommitSettings()
|
|||
vector3d.mdV[VZ] = (F32)getChild<LLUICtrl>("focus_z")->getValue().asReal();
|
||||
gSavedSettings.setVector3d("FocusOffsetRearView", vector3d);
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Improved camera floater
|
||||
void LLFloaterPreferenceViewAdvanced::onSavePreset()
|
||||
{
|
||||
LLFloaterReg::hideInstance("delete_pref_preset", PRESETS_CAMERA);
|
||||
LLFloaterReg::hideInstance("load_pref_preset", PRESETS_CAMERA);
|
||||
|
||||
LLSD key;
|
||||
key["subdirectory"] = PRESETS_CAMERA;
|
||||
std::string current_preset = gSavedSettings.getString("PresetCameraActive");
|
||||
bool is_custom_preset = current_preset != "" && !LLPresetsManager::getInstance()->isDefaultCameraPreset(current_preset);
|
||||
key["index"] = is_custom_preset ? 1 : 0;
|
||||
LLFloaterReg::showInstance("save_pref_preset", key);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public:
|
|||
void onCommitSettings();
|
||||
void updateCameraControl(const LLVector3& vector);
|
||||
void updateFocusControl(const LLVector3d& vector3d);
|
||||
void onSavePreset(); // <FS:Ansariel> Improved camera floater
|
||||
|
||||
private:
|
||||
virtual ~LLFloaterPreferenceViewAdvanced();
|
||||
|
|
|
|||
|
|
@ -1,17 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
header_height="0"
|
||||
bg_opaque_image="Window_NoTitle_Foreground"
|
||||
bg_alpha_image="Window_NoTitle_Foreground"
|
||||
positioning="specified"
|
||||
right="-460"
|
||||
bottom="-50"
|
||||
follows="left|bottom"
|
||||
legacy_header_height="18"
|
||||
can_minimize="true"
|
||||
can_close="true"
|
||||
height="135"
|
||||
legacy_header_height="0"
|
||||
can_minimize="false"
|
||||
can_close="false"
|
||||
height="85"
|
||||
layout="topleft"
|
||||
name="camera_floater"
|
||||
help_topic="camera_floater"
|
||||
save_visibility="true"
|
||||
show_title="false"
|
||||
single_instance="true"
|
||||
title="Camera Controls"
|
||||
chrome="true"
|
||||
|
|
@ -36,10 +40,11 @@
|
|||
<string name="inactive_combo_text">Use preset</string>
|
||||
<panel
|
||||
border="false"
|
||||
follows="top|left"
|
||||
height="123"
|
||||
layout="topleft"
|
||||
left="2"
|
||||
top="0"
|
||||
top_pad="-23"
|
||||
mouse_opaque="false"
|
||||
name="controls"
|
||||
width="190">
|
||||
|
|
@ -47,7 +52,7 @@
|
|||
<panel
|
||||
border="false"
|
||||
class="camera_zoom_panel"
|
||||
height="123"
|
||||
bottom="-1"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
mouse_opaque="false"
|
||||
|
|
@ -123,32 +128,20 @@
|
|||
tool_tip="Move camera up and down, left and right"
|
||||
top="25"
|
||||
width="78"/>
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="15"
|
||||
layout="topleft"
|
||||
left="41"
|
||||
top_pad="9"
|
||||
name="precise_ctrs_label"
|
||||
width="200">
|
||||
Use precise controls
|
||||
</text>
|
||||
</panel>
|
||||
</panel>
|
||||
<panel
|
||||
follows="all"
|
||||
height="102"
|
||||
height="27"
|
||||
layout="topleft"
|
||||
left_pad="2"
|
||||
name="buttons_panel"
|
||||
top="17"
|
||||
width="212">
|
||||
top_delta="18"
|
||||
width="120">
|
||||
<panel_camera_item
|
||||
name="front_view"
|
||||
tool_tip="Front View"
|
||||
width="25">
|
||||
width="18">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
parameter="front_view" />
|
||||
|
|
@ -160,8 +153,8 @@
|
|||
<panel_camera_item
|
||||
name="group_view"
|
||||
tool_tip="Side View"
|
||||
width="25"
|
||||
left_pad="4">
|
||||
width="18"
|
||||
left_pad="2">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
parameter="group_view" />
|
||||
|
|
@ -173,8 +166,8 @@
|
|||
<panel_camera_item
|
||||
name="rear_view"
|
||||
tool_tip="Rear View"
|
||||
width="25"
|
||||
left_pad="4">
|
||||
width="18"
|
||||
left_pad="2">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
tool_tip="Rear View"
|
||||
|
|
@ -187,8 +180,8 @@
|
|||
<panel_camera_item
|
||||
name="object_view"
|
||||
tool_tip="Object View"
|
||||
width="25"
|
||||
left_pad="4">
|
||||
width="18"
|
||||
left_pad="2">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
parameter="object_view" />
|
||||
|
|
@ -200,8 +193,8 @@
|
|||
<panel_camera_item
|
||||
name="mouselook_view"
|
||||
tool_tip="Mouselook View"
|
||||
width="25"
|
||||
left_pad="4">
|
||||
width="18"
|
||||
left_pad="2">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
parameter="mouselook_view" />
|
||||
|
|
@ -210,12 +203,26 @@
|
|||
<panel_camera_item.selected_picture
|
||||
image_name="MouseLook_View_On" />
|
||||
</panel_camera_item>
|
||||
<panel_camera_item
|
||||
name="reset_view"
|
||||
tool_tip="Reset view"
|
||||
width="18"
|
||||
left_pad="2">
|
||||
<panel_camera_item.mousedown_callback
|
||||
function="CameraPresets.ChangeView"
|
||||
parameter="reset_view" />
|
||||
<panel_camera_item.picture
|
||||
image_name="StopReload_Off" />
|
||||
<panel_camera_item.selected_picture
|
||||
image_name="StopReload_Over" />
|
||||
</panel_camera_item>
|
||||
</panel>
|
||||
<combo_box
|
||||
height="23"
|
||||
left="0"
|
||||
left_delta="-1"
|
||||
mouse_opaque="true"
|
||||
name="preset_combo"
|
||||
top_pad="5"
|
||||
top_pad="7"
|
||||
width="122">
|
||||
<combo_box.item
|
||||
label="Use preset"
|
||||
|
|
@ -238,6 +245,7 @@
|
|||
<button.commit_callback
|
||||
function="CameraPresets.ShowPresetsList"/>
|
||||
</button>
|
||||
<!--
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
|
|
@ -250,5 +258,18 @@
|
|||
<button.commit_callback
|
||||
function="CameraPresets.Save"/>
|
||||
</button>
|
||||
</panel>
|
||||
-->
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Camera Position..."
|
||||
layout="topleft"
|
||||
left_delta="-125"
|
||||
name="camera_position_btn"
|
||||
top_pad="9"
|
||||
width="143">
|
||||
<button.commit_callback
|
||||
function="Floater.Show"
|
||||
parameter="prefs_view_advanced"/>
|
||||
</button>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
height="128"
|
||||
height="138"
|
||||
layout="topleft"
|
||||
name="floaterpreferencesviewadvanced"
|
||||
help_topic="floaterviewadvanced"
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
height="16"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="10"
|
||||
top="5"
|
||||
width="100">
|
||||
Camera offset:
|
||||
</text>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
height="16"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top_pad="20"
|
||||
top_pad="10"
|
||||
width="100">
|
||||
Focus offset:
|
||||
</text>
|
||||
|
|
@ -113,4 +113,31 @@
|
|||
<spinner.commit_callback
|
||||
function="CommitSettings" />
|
||||
</spinner>
|
||||
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Save as preset..."
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="save_preset_btn"
|
||||
top_pad="10"
|
||||
width="125">
|
||||
<button.commit_callback
|
||||
function="CameraPresets.Save"/>
|
||||
</button>
|
||||
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Close"
|
||||
layout="topleft"
|
||||
left_pad="10"
|
||||
name="close_btn"
|
||||
top_delta="0"
|
||||
width="125">
|
||||
<button.commit_callback
|
||||
function="Floater.Hide"
|
||||
parameter="prefs_view_advanced"/>
|
||||
</button>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
<button
|
||||
name="open_prefs_btn"
|
||||
label="Open Camera floater"
|
||||
tool_tip = "Bring up Camera floater"
|
||||
tool_tip="Bring up Camera floater"
|
||||
top_delta="3"
|
||||
left="15"
|
||||
height="22"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
width="180">
|
||||
<panel_camera_item.icon_over
|
||||
follows="top|left"
|
||||
height="25"
|
||||
height="18"
|
||||
image_name="ListItem_Over"
|
||||
left="0"
|
||||
mouse_opaque="false"
|
||||
|
|
@ -15,10 +15,10 @@
|
|||
top="25"
|
||||
scale_image="true"
|
||||
visible="false"
|
||||
width="25" />
|
||||
width="18" />
|
||||
<panel_camera_item.icon_selected
|
||||
follows="top|left"
|
||||
height="25"
|
||||
height="18"
|
||||
image_name="ListItem_Select"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
|
|
@ -27,10 +27,10 @@
|
|||
top="25"
|
||||
scale_image="true"
|
||||
visible="false"
|
||||
width="25" />
|
||||
width="18" />
|
||||
<panel_camera_item.picture
|
||||
follows="top|left"
|
||||
height="25"
|
||||
height="18"
|
||||
image_name="Icon_For_Sale"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
|
|
@ -39,10 +39,10 @@
|
|||
tab_stop="false"
|
||||
top="25"
|
||||
top_pad="10"
|
||||
width="25" />
|
||||
width="18" />
|
||||
<panel_camera_item.selected_picture
|
||||
follows="top|left"
|
||||
height="25"
|
||||
height="18"
|
||||
image_name="Cam_Rotate_In"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
top="25"
|
||||
top_pad="8"
|
||||
visible="false"
|
||||
width="25" />
|
||||
width="18" />
|
||||
<panel_camera_item.text
|
||||
follows="top|left|right"
|
||||
font="SansSerifMedium"
|
||||
|
|
|
|||
Loading…
Reference in New Issue