Added cpcampos command line. Copies the current camera position to clipboard as a vector.
parent
015f4e65ea
commit
3953bb391b
|
|
@ -17074,6 +17074,17 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<string>tp2</string>
|
||||
</map>
|
||||
<key>FSCmdLineCopyCam</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Copies the current camera location to a vector of the form <x, y, z> to the clipboard.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>cpcampos</string>
|
||||
</map>
|
||||
<!--<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues-->
|
||||
<key>FSCmdLineBandWidth</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -448,6 +448,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture)
|
|||
static LLCachedControl<std::string> sFSCmdLineClearChat(gSavedSettings, "FSCmdLineClearChat");
|
||||
static LLCachedControl<std::string> sFSCmdLineMedia(gSavedSettings, "FSCmdLineMedia");
|
||||
static LLCachedControl<std::string> sFSCmdLineMusic(gSavedSettings, "FSCmdLineMusic");
|
||||
static LLCachedControl<std::string> sFSCmdLineCopyCam(gSavedSettings, "FSCmdLineCopyCam");
|
||||
//<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues
|
||||
static LLCachedControl<std::string> sFSCmdLineBandwidth(gSavedSettings, "FSCmdLineBandWidth");
|
||||
|
||||
|
|
@ -1157,6 +1158,26 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture)
|
|||
{
|
||||
invrepair();
|
||||
}
|
||||
else if (command == std::string(sFSCmdLineCopyCam))
|
||||
{
|
||||
LLViewerRegion* agentRegionp = gAgent.getRegion();
|
||||
if (agentRegionp)
|
||||
{
|
||||
LLVector3 cameraPosition = gAgentCamera.getCameraPositionAgent();
|
||||
std::string cameraPositionString = llformat("<%.3f, %.3f, %.3f>",
|
||||
cameraPosition.mV[VX], cameraPosition.mV[VY], cameraPosition.mV[VZ]);
|
||||
LLUI::sWindow->copyTextToClipboard(utf8str_to_wstring(cameraPositionString));
|
||||
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[POS]"] = cameraPositionString;
|
||||
reportToNearbyChat(LLTrans::getString("FSCameraPositionCopied", args));
|
||||
}
|
||||
else
|
||||
{
|
||||
reportToNearbyChat("Could not get a valid region pointer.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -918,6 +918,24 @@
|
|||
tool_tip=""
|
||||
control_name="FSCmdLineBandWidth"
|
||||
width="200"/>
|
||||
<!--cpcampos-->
|
||||
<text
|
||||
top_pad="5"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
name="FSCmdLineCopyCam_txt"
|
||||
width="250">
|
||||
Copy camera position to clipboard
|
||||
</text>
|
||||
<line_editor
|
||||
top_pad="0"
|
||||
follows="left|top"
|
||||
height="20"
|
||||
max_length_chars="256"
|
||||
name="FSCmdLineCopyCam"
|
||||
tool_tip=""
|
||||
control_name="FSCmdLineCopyCam"
|
||||
width="200"/>
|
||||
<!--rezplat-->
|
||||
<text
|
||||
top_pad="5"
|
||||
|
|
|
|||
|
|
@ -2492,6 +2492,7 @@ Try enclosing path to the editor with double quotes.
|
|||
|
||||
<string name="DrawDistanceSteppingGestureObsolete">Due to the changes in code, it is no longer necessary to use this gesture. Progressive Draw Distance stepping has been enabled.</string>
|
||||
<string name="FSCmdLineDrawDistanceSet">Draw Distance set to [DISTANCE]m.</string>
|
||||
<string name="FSCameraPositionCopied">Camera position [POS] copied to clipboard.</string>
|
||||
|
||||
<!-- Build types for about floater -->
|
||||
<string name="FSWithHavok">with Havok support</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue