diff options
author | Christian Goetze <cg@lindenlab.com> | 2009-03-13 21:28:40 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2009-03-13 21:28:40 +0000 |
commit | 1aa0416aef379bb3ad1012441588b6d7fab81b40 (patch) | |
tree | 14a247470bd0d508aba923dc00e940b961d304da /indra/newview | |
parent | 7573288ab3ede23f97bff2f5caefcb622e7e9842 (diff) |
svn merge -r114093:114412 svn+ssh://svn.lindenlab.com/svn/linden/branches/featurettes/featurettes-batch5-merge
Melinda (coco): 5th and final batch of featurettes. My work here is done.
Diffstat (limited to 'indra/newview')
69 files changed, 2045 insertions, 1603 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 76be212c95..1ca1b4f915 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -148,6 +148,7 @@ set(viewer_SOURCE_FILES llfloaterenvsettings.cpp llfloaterevent.cpp llfloaterfriends.cpp + llfloaterfonttest.cpp llfloatergesture.cpp llfloatergodtools.cpp llfloatergroupinfo.cpp @@ -156,6 +157,7 @@ set(viewer_SOURCE_FILES llfloaterhandler.cpp llfloaterhardwaresettings.cpp llfloaterhtml.cpp + llfloaterhtmlcurrency.cpp llfloaterhtmlhelp.cpp llfloaterhtmlsimple.cpp llfloaterhud.cpp @@ -549,6 +551,7 @@ set(viewer_HEADER_FILES llfloatereditui.h llfloaterenvsettings.h llfloaterevent.h + llfloaterfonttest.h llfloaterfriends.h llfloatergesture.h llfloatergodtools.h @@ -558,6 +561,7 @@ set(viewer_HEADER_FILES llfloaterhandler.h llfloaterhardwaresettings.h llfloaterhtml.h + llfloaterhtmlcurrency.h llfloaterhtmlhelp.h llfloaterhtmlsimple.h llfloaterhud.h @@ -1058,6 +1062,7 @@ set(viewer_XUI_FILES skins/default/xui/en-us/floater_device_settings.xml skins/default/xui/en-us/floater_directory.xml skins/default/xui/en-us/floater_env_settings.xml + skins/default/xui/en-us/floater_font_test.xml skins/default/xui/en-us/floater_gesture.xml skins/default/xui/en-us/floater_god_tools.xml skins/default/xui/en-us/floater_group_info.xml @@ -1081,6 +1086,7 @@ set(viewer_XUI_FILES skins/default/xui/en-us/floater_live_lsleditor.xml skins/default/xui/en-us/floater_lsl_guide.xml skins/default/xui/en-us/floater_media_browser.xml + skins/default/xui/en-us/floater_mini_map.xml skins/default/xui/en-us/floater_moveview.xml skins/default/xui/en-us/floater_mute_object.xml skins/default/xui/en-us/floater_mute.xml @@ -1126,6 +1132,7 @@ set(viewer_XUI_FILES skins/default/xui/en-us/floater_sim_release_message.xml skins/default/xui/en-us/floater_snapshot.xml skins/default/xui/en-us/floater_sound_preview.xml + skins/default/xui/en-us/floater_statistics.xml skins/default/xui/en-us/floater_telehub.xml skins/default/xui/en-us/floater_test.xml skins/default/xui/en-us/floater_texture_ctrl.xml @@ -1138,11 +1145,13 @@ set(viewer_XUI_FILES skins/default/xui/en-us/floater_wearable_save_as.xml skins/default/xui/en-us/floater_windlight_options.xml skins/default/xui/en-us/floater_world_map.xml + skins/default/xui/en-us/fonts.xml skins/default/xui/en-us/menu_inventory.xml skins/default/xui/en-us/menu_login.xml skins/default/xui/en-us/menu_pie_attachment.xml skins/default/xui/en-us/menu_pie_avatar.xml skins/default/xui/en-us/menu_pie_land.xml + skins/default/xui/en-us/menu_mini_map.xml skins/default/xui/en-us/menu_pie_object.xml skins/default/xui/en-us/menu_pie_self.xml skins/default/xui/en-us/menu_slurl.xml @@ -1177,6 +1186,7 @@ set(viewer_XUI_FILES skins/default/xui/en-us/panel_media_controls.xml skins/default/xui/en-us/panel_media_remote_expanded.xml skins/default/xui/en-us/panel_media_remote.xml + skins/default/xui/en-us/panel_mini_map.xml skins/default/xui/en-us/panel_notifications_channel.xml skins/default/xui/en-us/panel_overlaybar.xml skins/default/xui/en-us/panel_place_small.xml @@ -1191,6 +1201,7 @@ set(viewer_XUI_FILES skins/default/xui/en-us/panel_preferences_popups.xml skins/default/xui/en-us/panel_preferences_voice.xml skins/default/xui/en-us/panel_preferences_web.xml + skins/default/xui/en-us/panel_progress.xml skins/default/xui/en-us/panel_region_covenant.xml skins/default/xui/en-us/panel_region_debug.xml skins/default/xui/en-us/panel_region_estate.xml diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 993033aa2c..41120522d5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1255,6 +1255,17 @@ <real>0.75</real> </array> </map> + <key>CameraOffsetScale</key> + <map> + <key>Comment</key> + <string>Scales the default offset</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>1.0</real> + </map> <key>CameraPosOnLogout</key> <map> <key>Comment</key> @@ -2267,6 +2278,600 @@ <key>Value</key> <integer>0</integer> </map> + <key>DebugStatModeFPS</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeBandwidth</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModePacketLoss</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatMode</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeKTrisDrawnFr</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeKTrisDrawnSec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeTotalObjs</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeNewObjs</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeTextureCount</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeRawCount</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeGLMem</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeFormattedMem</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeRawMem</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeBoundMem</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModePacketsIn</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModePacketsOut</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeObjects</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeTexture</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeAsset</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeLayers</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeActualIn</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeActualOut</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeVFSPendingOps</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeTimeDialation</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimFPS</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModePhysicsFPS</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModePinnedObjects</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeLowLODObjects</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeMemoryAllocated</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeAgentUpdatesSec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeMainAgents</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeChildAgents</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimObjects</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimActiveObjects</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimActiveScripts</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimScriptEvents</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimInPPS</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimOutPPS</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimPendingDownloads</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>SimPendingUploads</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimTotalUnackedBytes</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimFrameMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimNetMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSimPhysicsMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSimOtherMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimAgentMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimImagesMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimScriptMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSpareMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSimPhysicsStepMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSimPhysicsShapeUpdateMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSimPhysicsOtherMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimSleepMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> + <key>DebugStatModeSimPumpIOMsec</key> + <map> + <key>Comment</key> + <string>Mode of stat in Statistics floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> <key>DebugViews</key> <map> <key>Comment</key> @@ -3444,6 +4049,22 @@ <integer>400</integer> </array> </map> + <key>FloaterStatisticsRect</key> + <map> + <key>Comment</key> + <string>Rectangle for chat history</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Rect</string> + <key>Value</key> + <array> + <integer>0</integer> + <integer>400</integer> + <integer>250</integer> + <integer>0</integer> + </array> + </map> <key>FloaterViewBottom</key> <map> <key>Comment</key> @@ -4444,6 +5065,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>LandBrushSize</key> + <map> + <key>Comment</key> + <string>Size of affected region when using teraform tool</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>2.0</real> + </map> <key>LCDDestination</key> <map> <key>Comment</key> @@ -5241,6 +5873,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>NearMeRange</key> + <map> + <key>Comment</key> + <string>Search radius for nearby avatars</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <integer>20</integer> + </map> <key>NextOwnerCopy</key> <map> <key>Comment</key> @@ -5504,6 +6147,50 @@ <key>Value</key> <integer>1</integer> </map> + <key>OpenDebugStatTexture</key> + <map> + <key>Comment</key> + <string>Expand Texture performance stats display</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>OpenDebugStatPhysicsDetails</key> + <map> + <key>Comment</key> + <string>Expand Physics Details performance stats display</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>OpenDebugStatSimTime</key> + <map> + <key>Comment</key> + <string>Expand Simulator Time performance stats display</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>OpenDebugStatSimTimeDetails</key> + <map> + <key>Comment</key> + <string>Expand Simulator Time Details performance stats display</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>OutBandwidth</key> <map> <key>Comment</key> @@ -7460,6 +8147,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ShowBanLines</key> + <map> + <key>Comment</key> + <string>Show in-world ban/access borders</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>ShowCameraControls</key> <map> <key>Comment</key> @@ -10264,6 +10962,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>AutoDisengageMic</key> + <map> + <key>Comment</key> + <string>Automatically turn off the microphone when ending IM calls.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>VoiceEarLocation</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d4978566da..858855fe18 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -101,6 +101,7 @@ #include "llstartup.h" #include "llimview.h" #include "lltool.h" +#include "lltoolcomp.h" #include "lltoolfocus.h" #include "lltoolgrab.h" #include "lltoolmgr.h" @@ -436,10 +437,8 @@ void LLAgent::init() mCameraFocusOffsetTarget = LLVector4(gSavedSettings.getVector3("CameraOffsetBuild")); mCameraOffsetDefault = gSavedSettings.getVector3("CameraOffsetDefault"); -// mCameraOffsetNorm = mCameraOffsetDefault; -// mCameraOffsetNorm.normalize(); mCameraCollidePlane.clearVec(); - mCurrentCameraDistance = mCameraOffsetDefault.magVec(); + mCurrentCameraDistance = mCameraOffsetDefault.magVec() * gSavedSettings.getF32("CameraOffsetScale"); mTargetCameraDistance = mCurrentCameraDistance; mCameraZoomFraction = 1.f; mTrackFocusObject = gSavedSettings.getBOOL("TrackFocusObject"); @@ -1887,7 +1886,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) { if (mFocusOnAvatar && mCameraMode == CAMERA_MODE_THIRD_PERSON) { - F32 camera_offset_dist = llmax(0.001f, mCameraOffsetDefault.magVec()); + F32 camera_offset_dist = llmax(0.001f, mCameraOffsetDefault.magVec() * gSavedSettings.getF32("CameraOffsetScale")); mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; @@ -2814,7 +2813,7 @@ U8 LLAgent::getRenderState() static const LLFloaterView::skip_list_t& get_skip_list() { static LLFloaterView::skip_list_t skip_list; - skip_list.insert(gFloaterMap); + skip_list.insert(LLFloaterMap::getInstance()); return skip_list; } @@ -2892,7 +2891,7 @@ void LLAgent::endAnimationUpdateUI() // let the mini-map go visible again. JC if (!LLAppViewer::instance()->quitRequested()) { - gFloaterMap->popVisible(); + LLFloaterMap::getInstance()->popVisible(); } if( gMorphView ) @@ -2989,7 +2988,7 @@ void LLAgent::endAnimationUpdateUI() { LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); - gFloaterMap->pushVisible(FALSE); + LLFloaterMap::getInstance()->pushVisible(FALSE); /* LLView *view; for (view = gFloaterView->getFirstChild(); view; view = gFloaterView->getNextChild()) @@ -3257,8 +3256,11 @@ void LLAgent::updateCamera() { LLVector3d agent_pos = getPositionGlobal(); LLVector3d camera_pos_agent = camera_pos_global - agent_pos; + // Sitting on what you're manipulating can cause camera jitter with smoothing. + // This turns off smoothing while editing. -MG + mCameraSmoothingStop |= (BOOL)LLToolMgr::getInstance()->inBuildMode(); - if (cameraThirdPerson() && !mCameraSmoothingStop) // only smooth in third person mode + if (cameraThirdPerson() && !mCameraSmoothingStop) { const F32 SMOOTHING_HALF_LIFE = 0.02f; @@ -3684,7 +3686,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - local_camera_offset = mCameraZoomFraction * mCameraOffsetDefault; + local_camera_offset = mCameraZoomFraction * mCameraOffsetDefault * gSavedSettings.getF32("CameraOffsetScale"); // are we sitting down? if (mAvatarObject.notNull() && mAvatarObject->getParent()) @@ -3915,10 +3917,10 @@ void LLAgent::handleScrollWheel(S32 clicks) } else if (mFocusOnAvatar && mCameraMode == CAMERA_MODE_THIRD_PERSON) { - F32 current_zoom_fraction = mTargetCameraDistance / mCameraOffsetDefault.magVec(); + F32 current_zoom_fraction = mTargetCameraDistance / (mCameraOffsetDefault.magVec() * gSavedSettings.getF32("CameraOffsetScale")); current_zoom_fraction *= 1.f - pow(ROOT_ROOT_TWO, clicks); - cameraOrbitIn(current_zoom_fraction * mCameraOffsetDefault.magVec()); + cameraOrbitIn(current_zoom_fraction * mCameraOffsetDefault.magVec() * gSavedSettings.getF32("CameraOffsetScale")); } else { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fc37c42f99..1e6d8fdf25 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -242,7 +242,6 @@ BOOL gDisconnected = FALSE; // Map scale in pixels per region F32 gMapScale = 128.f; -F32 gMiniMapScale = 128.f; // used to restore texture state after a mode switch LLFrameTimer gRestoreGLTimer; @@ -399,7 +398,6 @@ static void settings_to_globals() gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); gMapScale = gSavedSettings.getF32("MapScale"); - gMiniMapScale = gSavedSettings.getF32("MiniMapScale"); LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); @@ -1747,9 +1745,6 @@ bool LLAppViewer::initConfiguration() // - load overrides from user_settings loadSettingsFromDirectory("User"); - gSavedSettings.setString("FontSansSerifFallback", - gSavedSettings.getString("FontSansSerifBundledFallback") + ";" + LLWindow::getFontListSans() ); - // - apply command line settings clp.notify(); @@ -2172,7 +2167,6 @@ void LLAppViewer::cleanupSavedSettings() if (gDebugView) { gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible()); - gSavedSettings.setBOOL("ShowDebugStats", gDebugView->mFloaterStatsp->getVisible()); } } @@ -2192,7 +2186,6 @@ void LLAppViewer::cleanupSavedSettings() } gSavedSettings.setF32("MapScale", gMapScale ); - gSavedSettings.setF32("MiniMapScale", gMiniMapScale ); gSavedSettings.setBOOL("ShowHoverTips", LLHoverView::sShowHoverTips); // Some things are cached in LLAgent. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index cb10ad3661..6d7c3c8577 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -304,7 +304,6 @@ extern BOOL gDisconnected; // Map scale in pixels per region extern F32 gMapScale; -extern F32 gMiniMapScale; extern LLFrameTimer gRestoreGLTimer; extern BOOL gRestoreGL; diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 481a6ceb26..5b04e241a1 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -34,12 +34,11 @@ #include "llassetuploadresponders.h" +// viewer includes #include "llagent.h" #include "llcompilequeue.h" #include "llfloaterbuycurrency.h" -#include "lleconomy.h" #include "llfilepicker.h" -#include "llfocusmgr.h" #include "llnotify.h" #include "llinventorymodel.h" #include "llinventoryview.h" @@ -48,7 +47,7 @@ #include "llpreviewscript.h" #include "llpreviewgesture.h" #include "llgesturemgr.h" -#include "llscrolllistctrl.h" +#include "llstatusbar.h" // sendMoneyBalanceRequest() #include "llsdserialize.h" #include "lluploaddialog.h" #include "llviewerobject.h" @@ -58,6 +57,12 @@ #include "llviewerwindow.h" #include "lltexlayer.h" +// library includes +#include "lleconomy.h" +#include "llfocusmgr.h" +#include "llscrolllistctrl.h" +#include "llsdserialize.h" + // When uploading multiple files, don't display any of them when uploading more than this number. static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; @@ -216,13 +221,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) asset_type == LLAssetType::AT_SOUND || asset_type == LLAssetType::AT_ANIMATION) { - gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_MoneyData); - gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); - gAgent.sendReliableMessage(); + LLStatusBar::sendMoneyBalanceRequest(); LLSD args; args["AMOUNT"] = llformat("%d", expected_upload_cost); diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 528fb9cff5..5f8d9ed27b 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -67,7 +67,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect mCaption = new LLTextBox( name, LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), name, - LLFontGL::sSansSerifSmall ); + LLFontGL::getFontSansSerifSmall() ); mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); addChild( mCaption ); @@ -94,7 +94,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect mCaption = new LLTextBox( label, LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), label, - LLFontGL::sSansSerifSmall ); + LLFontGL::getFontSansSerifSmall() ); mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); addChild( mCaption ); diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 3ec6db3dad..40f5202067 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -98,20 +98,6 @@ LLDebugView::LLDebugView(const std::string& name, const LLRect &rect) addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - // - // Debug statistics - // - r.set(rect.getWidth() - 250, - rect.getHeight() - 50, - rect.getWidth(), - rect.getHeight() - 450); - mFloaterStatsp = new LLFloaterStats(r); - - mFloaterStatsp->setFollowsTop(); - mFloaterStatsp->setFollowsRight(); - // since this is a floater, it belongs to LLFloaterView - //addChild(mFloaterStatsp); - const S32 VELOCITY_LEFT = 10; // 370; const S32 VELOCITY_WIDTH = 500; const S32 VELOCITY_TOP = 140; diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 9db4723c8d..189efd3a3f 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -59,7 +59,6 @@ public: LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; LLConsole* mDebugConsolep; - LLFloaterStats* mFloaterStatsp; }; extern LLDebugView* gDebugView; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 340254a909..c9037d0fbb 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -292,7 +292,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) S32 LLFastTimerView::getLegendIndex(S32 y) { - S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::sMonospace->getLineHeight()+2) - 5; + S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::getFontMonospace()->getLineHeight()+2) - 5; if (idx >= 0 && idx < FTV_DISPLAY_NUM) { return ft_display_idx[idx]; @@ -483,7 +483,7 @@ void LLFastTimerView::draw() x = xleft; y = height - ytop; - texth = (S32)LLFontGL::sMonospace->getLineHeight(); + texth = (S32)LLFontGL::getFontMonospace()->getLineHeight(); char modedesc[][32] = { "2 x Average ", @@ -498,16 +498,16 @@ void LLFastTimerView::draw() }; tdesc = llformat("Full bar = %s [Click to pause/reset] [SHIFT-Click to toggle]",modedesc[mDisplayMode]); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); - textw = LLFontGL::sMonospace->getWidth(tdesc); + textw = LLFontGL::getFontMonospace()->getWidth(tdesc); x = xleft, y -= (texth + 2); tdesc = llformat("Justification = %s [CTRL-Click to toggle]",centerdesc[mDisplayCenter]); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); y -= (texth + 2); - LLFontGL::sMonospace->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"), + LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"), 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); y -= (texth + 2); } @@ -632,15 +632,15 @@ void LLFastTimerView::draw() if (is_child_of_hover_item) { - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD); } else { - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP); } y -= (texth + 2); - textw = dx + LLFontGL::sMonospace->getWidth(std::string(ft_display_table[i].desc)) + 40; + textw = dx + LLFontGL::getFontMonospace()->getWidth(std::string(ft_display_table[i].desc)) + 40; if (textw > legendwidth) legendwidth = textw; } @@ -654,7 +654,7 @@ void LLFastTimerView::draw() // update rectangle that includes timer bars mBarRect.mLeft = xleft; mBarRect.mRight = getRect().mRight - xleft; - mBarRect.mTop = ytop - ((S32)LLFontGL::sMonospace->getLineHeight() + 4); + mBarRect.mTop = ytop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4); mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT; y = ytop; @@ -740,23 +740,23 @@ void LLFastTimerView::draw() U32 ms = (U32)((F64)totalticks * iclock_freq) ; tdesc = llformat("%.1f ms |", (F32)ms*.25f); - x = xleft + barw/4 - LLFontGL::sMonospace->getWidth(tdesc); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, + x = xleft + barw/4 - LLFontGL::getFontMonospace()->getWidth(tdesc); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); tdesc = llformat("%.1f ms |", (F32)ms*.50f); - x = xleft + barw/2 - LLFontGL::sMonospace->getWidth(tdesc); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, + x = xleft + barw/2 - LLFontGL::getFontMonospace()->getWidth(tdesc); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); tdesc = llformat("%.1f ms |", (F32)ms*.75f); - x = xleft + (barw*3)/4 - LLFontGL::sMonospace->getWidth(tdesc); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, + x = xleft + (barw*3)/4 - LLFontGL::getFontMonospace()->getWidth(tdesc); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); tdesc = llformat( "%d ms |", ms); - x = xleft + barw - LLFontGL::sMonospace->getWidth(tdesc); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, + x = xleft + barw - LLFontGL::getFontMonospace()->getWidth(tdesc); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); } @@ -768,7 +768,7 @@ void LLFastTimerView::draw() S32 by = y + 2; - y -= ((S32)LLFontGL::sMonospace->getLineHeight() + 4); + y -= ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4); //heading gl_rect_2d(xleft-5, by, getRect().getWidth()-5, y+5, FALSE); @@ -962,10 +962,10 @@ void LLFastTimerView::draw() else tdesc = llformat("%4.2f ms", ms); - x = graph_rect.mRight - LLFontGL::sMonospace->getWidth(tdesc)-5; - y = graph_rect.mTop - ((S32)LLFontGL::sMonospace->getLineHeight()); + x = graph_rect.mRight - LLFontGL::getFontMonospace()->getWidth(tdesc)-5; + y = graph_rect.mTop - ((S32)LLFontGL::getFontMonospace()->getLineHeight()); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); //highlight visible range @@ -1073,7 +1073,7 @@ void LLFastTimerView::draw() x = (graph_rect.mRight + graph_rect.mLeft)/2; y = graph_rect.mBottom + 8; - LLFontGL::sMonospace->renderUTF8(std::string(ft_display_table[mHoverIndex].desc), 0, x, y, LLColor4::white, + LLFontGL::getFontMonospace()->renderUTF8(std::string(ft_display_table[mHoverIndex].desc), 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM); } } diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index e9c0a7c26c..e382fefece 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -35,6 +35,7 @@ #include "message.h" +#include "llagent.h" #include "llbutton.h" #include "llfocusmgr.h" #include "llinventoryview.h" @@ -43,7 +44,8 @@ #include "llscrolllistctrl.h" #include "lltextbox.h" #include "lluictrlfactory.h" -#include "llagent.h" +#include "llviewercontrol.h" +#include "llworld.h" const S32 MIN_WIDTH = 200; const S32 MIN_HEIGHT = 340; @@ -59,6 +61,8 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) { + // TODO: This class should not be a singleton as it's used in multiple places + // and therefore can't be used simultaneously. -MG if (!sInstance) { sInstance = new LLFloaterAvatarPicker(); @@ -78,6 +82,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, sInstance->setAllowMultiple(allow_multiple); } + sInstance->mNearMeListComplete = FALSE; sInstance->mCloseOnSelect = closeOnSelect; return sInstance; } @@ -98,39 +103,58 @@ BOOL LLFloaterAvatarPicker::postBuild() childSetAction("Find", onBtnFind, this); childDisable("Find"); + childSetAction("Refresh", onBtnRefresh, this); + childSetCommitCallback("near_me_range", onRangeAdjust, this); - mListNames = getChild<LLScrollListCtrl>("Names"); - childSetDoubleClickCallback("Names",onBtnAdd); - childSetCommitCallback("Names", onList, this); - childDisable("Names"); + childSetDoubleClickCallback("SearchResults", onBtnSelect); + childSetDoubleClickCallback("NearMe", onBtnSelect); + childSetCommitCallback("SearchResults", onList, this); + childSetCommitCallback("NearMe", onList, this); + childDisable("SearchResults"); - childSetAction("Select", onBtnAdd, this); + childSetAction("Select", onBtnSelect, this); childDisable("Select"); - childSetAction("Close", onBtnClose, this); + childSetAction("Cancel", onBtnClose, this); childSetFocus("Edit"); - if (mListNames) + LLPanel* search_panel = getChild<LLPanel>("SearchPanel"); + if (search_panel) { - mListNames->addCommentText(std::string("No results")); // *TODO: Translate + // Start searching when Return is pressed in the line editor. + search_panel->setDefaultBtn("Find"); } - mInventoryPanel = getChild<LLInventoryPanel>("Inventory Panel"); - if(mInventoryPanel) - { - mInventoryPanel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD); - mInventoryPanel->setFollowsAll(); - mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD); - mInventoryPanel->setSelectCallback(LLFloaterAvatarPicker::onSelectionChange, this); - } + getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("no_results")); + + LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel"); + inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD); + inventory_panel->setFollowsAll(); + inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD); + inventory_panel->setSelectCallback(LLFloaterAvatarPicker::onCallingCardSelectionChange, this); + + childSetTabChangeCallback("ResidentChooserTabs", "SearchPanel", onTabChanged, this); + childSetTabChangeCallback("ResidentChooserTabs", "CallingCardsPanel", onTabChanged, this); + childSetTabChangeCallback("ResidentChooserTabs", "NearMePanel", onTabChanged, this); setAllowMultiple(FALSE); return TRUE; } +void LLFloaterAvatarPicker::onTabChanged(void* userdata, bool from_click) +{ + LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; + if (!self) + { + return; + } + + self->childSetEnabled("Select", self->visibleItemsSelected()); +} + // Destroys the object LLFloaterAvatarPicker::~LLFloaterAvatarPicker() { @@ -145,22 +169,50 @@ void LLFloaterAvatarPicker::onBtnFind(void* userdata) if(self) self->find(); } -void LLFloaterAvatarPicker::onBtnAdd(void* userdata) +static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, std::vector<LLUUID>& avatar_ids) +{ + std::vector<LLScrollListItem*> items = from->getAllSelected(); + for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter) + { + LLScrollListItem* item = *iter; + if (item->getUUID().notNull()) + { + avatar_names.push_back(item->getColumn(0)->getValue().asString()); + avatar_ids.push_back(item->getUUID()); + } + } +} + +void LLFloaterAvatarPicker::onBtnSelect(void* userdata) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; if(self->mCallback) { - self->mCallback(self->mAvatarNames, self->mAvatarIDs, self->mCallbackUserdata); - } - if (self->mInventoryPanel) - { - self->mInventoryPanel->setSelection(LLUUID::null, FALSE); - } - if (self->mListNames) - { - self->mListNames->deselectAllItems(TRUE); + LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs"); + + if(active_panel == self->getChild<LLPanel>("CallingCardsPanel")) + { + self->mCallback(self->mSelectedInventoryAvatarNames, self->mSelectedInventoryAvatarIDs, self->mCallbackUserdata); + } + else if(active_panel == self->getChild<LLPanel>("SearchPanel")) + { + std::vector<std::string> avatar_names; + std::vector<LLUUID> avatar_ids; + getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids); + self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + } + else if(active_panel == self->getChild<LLPanel>("NearMePanel")) + { + std::vector<std::string> avatar_names; + std::vector<LLUUID> avatar_ids; + getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids); + self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + } } + self->getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE); + self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); + self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); if(self->mCloseOnSelect) { self->mCloseOnSelect = FALSE; @@ -168,68 +220,61 @@ void LLFloaterAvatarPicker::onBtnAdd(void* userdata) } } +void LLFloaterAvatarPicker::onBtnRefresh(void* userdata) +{ + LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; + if (!self) + { + return; + } + + self->getChild<LLScrollListCtrl>("NearMe")->deleteAllItems(); + self->getChild<LLScrollListCtrl>("NearMe")->addCommentText(self->getString("searching")); + self->mNearMeListComplete = FALSE; +} + void LLFloaterAvatarPicker::onBtnClose(void* userdata) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; if(self) self->close(); } +void LLFloaterAvatarPicker::onRangeAdjust(LLUICtrl* source, void* data) +{ + LLFloaterAvatarPicker::onBtnRefresh(data); +} + void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if (!self) - { - return; - } - - self->mAvatarIDs.clear(); - self->mAvatarNames.clear(); - - if (!self->mListNames) - { - return; - } - - std::vector<LLScrollListItem*> items = - self->mListNames->getAllSelected(); - for ( - std::vector<LLScrollListItem*>::iterator iter = items.begin(); - iter != items.end(); - ++iter) + if (self) { - LLScrollListItem* item = *iter; - self->mAvatarNames.push_back(item->getColumn(0)->getValue().asString()); - self->mAvatarIDs.push_back(item->getUUID()); - self->childSetEnabled("Select", TRUE); + self->childSetEnabled("Select", self->visibleItemsSelected()); } } // static callback for inventory picker (select from calling cards) -void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) +void LLFloaterAvatarPicker::onCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data; if (self) { - self->doSelectionChange( items, user_action, data ); + self->doCallingCardSelectionChange( items, user_action, data ); } } // Callback for inventory picker (select from calling cards) -void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) +void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) { - if (!mListNames) + bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel")); + + mSelectedInventoryAvatarIDs.clear(); + mSelectedInventoryAvatarNames.clear(); + + if (panel_active) { - return; - } - - std::vector<LLScrollListItem*> search_items = mListNames->getAllSelected(); - if ( search_items.size() == 0 ) - { // Nothing selected in the search results - mAvatarIDs.clear(); - mAvatarNames.clear(); childSetEnabled("Select", FALSE); } - BOOL first_calling_card = TRUE; std::deque<LLFolderViewItem*>::const_iterator item_it; for (item_it = items.begin(); item_it != items.end(); ++item_it) @@ -238,26 +283,97 @@ void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem* if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD) { LLInventoryItem* item = gInventory.getItem(listenerp->getUUID()); - if (item) { - if ( first_calling_card ) - { // Have a calling card selected, so clear anything from the search panel - first_calling_card = FALSE; - mAvatarIDs.clear(); - mAvatarNames.clear(); - mListNames->deselectAllItems(); - } - - // Add calling card info to the selected avatars - mAvatarIDs.push_back(item->getCreatorUUID()); - mAvatarNames.push_back(listenerp->getName()); - childSetEnabled("Select", TRUE); + mSelectedInventoryAvatarIDs.push_back(item->getCreatorUUID()); + mSelectedInventoryAvatarNames.push_back(listenerp->getName()); } } } + + if (panel_active) + { + childSetEnabled("Select", visibleItemsSelected()); + } +} + +void LLFloaterAvatarPicker::populateNearMe() +{ + BOOL all_loaded = TRUE; + BOOL empty = TRUE; + LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe"); + near_me_scroller->deleteAllItems(); + + std::vector<LLUUID> avatar_ids; + LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + for(U32 i=0; i<avatar_ids.size(); i++) + { + LLUUID& av = avatar_ids[i]; + if(av == gAgent.getID()) continue; + LLSD element; + element["id"] = av; // value + std::string fullname; + if(!gCacheName->getFullName(av, fullname)) + { + element["columns"][0]["value"] = LLCacheName::getDefaultName(); + all_loaded = FALSE; + } + else + { + element["columns"][0]["value"] = fullname; + } + near_me_scroller->addElement(element); + empty = FALSE; + } + + if (empty) + { + childDisable("NearMe"); + childDisable("Select"); + near_me_scroller->addCommentText(getString("no_one_near")); + } + else + { + childEnable("NearMe"); + childEnable("Select"); + near_me_scroller->selectFirstItem(); + onList(near_me_scroller, this); + near_me_scroller->setFocus(TRUE); + } + + if (all_loaded) + { + mNearMeListComplete = TRUE; + } +} + +void LLFloaterAvatarPicker::draw() +{ + LLFloater::draw(); + if (!mNearMeListComplete && childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("NearMePanel")) + { + populateNearMe(); + } } +BOOL LLFloaterAvatarPicker::visibleItemsSelected() const +{ + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + + if(active_panel == getChild<LLPanel>("SearchPanel")) + { + return getChild<LLScrollListCtrl>("SearchResults")->getFirstSelectedIndex() >= 0; + } + else if(active_panel == getChild<LLPanel>("CallingCardsPanel")) + { + return mSelectedInventoryAvatarIDs.size() > 0; + } + else if(active_panel == getChild<LLPanel>("NearMePanel")) + { + return getChild<LLScrollListCtrl>("NearMe")->getFirstSelectedIndex() >= 0; + } + return FALSE; +} void LLFloaterAvatarPicker::find() { @@ -277,11 +393,8 @@ void LLFloaterAvatarPicker::find() gAgent.sendReliableMessage(); - if (mListNames) - { - mListNames->deleteAllItems(); - mListNames->addCommentText(std::string("Searching...")); // *TODO: Translate - } + getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems(); + getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("searching")); childSetEnabled("Select", FALSE); mResultsReturned = FALSE; @@ -289,15 +402,9 @@ void LLFloaterAvatarPicker::find() void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) { - mAllowMultiple = allow_multiple; - if (mInventoryPanel) - { - mInventoryPanel->setAllowMultiSelect(mAllowMultiple); - } - if (mListNames) - { - mListNames->setAllowMultipleSelection(mAllowMultiple); - } + getChild<LLScrollListCtrl>("SearchResults")->setAllowMultipleSelection(allow_multiple); + getChild<LLInventoryPanel>("InventoryPanel")->setAllowMultiSelect(allow_multiple); + getChild<LLScrollListCtrl>("NearMe")->setAllowMultipleSelection(allow_multiple); } // static @@ -325,52 +432,48 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* return; } - if (!self->mResultsReturned) - { - // clear "Searching" label on first results - if (self->mListNames) - { - self->mListNames->deleteAllItems(); - } - } + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("SearchResults"); + + // clear "Searching" label on first results + search_results->deleteAllItems(); + self->mResultsReturned = TRUE; - if (self->mListNames) - { - BOOL found_one = FALSE; - S32 num_new_rows = msg->getNumberOfBlocks("Data"); - for (S32 i = 0; i < num_new_rows; i++) - { - msg->getUUIDFast( _PREHASH_Data,_PREHASH_AvatarID, avatar_id, i); - msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, first_name, i); - msg->getStringFast(_PREHASH_Data,_PREHASH_LastName, last_name, i); - - std::string avatar_name; - if (avatar_id.isNull()) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->childGetText("Edit"); - avatar_name = self->getString("NotFound", map); - self->mListNames->setEnabled(FALSE); - } - else - { - avatar_name = first_name + " " + last_name; - self->mListNames->setEnabled(TRUE); - found_one = TRUE; - } - LLSD element; - element["id"] = avatar_id; // value - element["columns"][0]["value"] = avatar_name; - self->mListNames->addElement(element); - } + BOOL found_one = FALSE; + S32 num_new_rows = msg->getNumberOfBlocks("Data"); + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getUUIDFast( _PREHASH_Data,_PREHASH_AvatarID, avatar_id, i); + msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, first_name, i); + msg->getStringFast(_PREHASH_Data,_PREHASH_LastName, last_name, i); - if (found_one) + std::string avatar_name; + if (avatar_id.isNull()) { - self->mListNames->selectFirstItem(); - self->onList(self->mListNames, self); - self->mListNames->setFocus(TRUE); + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->childGetText("Edit"); + avatar_name = self->getString("not_found", map); + search_results->setEnabled(FALSE); + self->childDisable("Select"); } + else + { + avatar_name = first_name + " " + last_name; + search_results->setEnabled(TRUE); + found_one = TRUE; + } + LLSD element; + element["id"] = avatar_id; // value + element["columns"][0]["value"] = avatar_name; + search_results->addElement(element); + } + + if (found_one) + { + self->childEnable("Select"); + search_results->selectFirstItem(); + self->onList(search_results, self); + search_results->setFocus(TRUE); } } @@ -378,32 +481,23 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data; - if (caller->getText().size() >= 3) - { - self->childSetEnabled("Find",TRUE); - } - else - { - self->childSetEnabled("Find",FALSE); - } + self->childSetEnabled("Find", caller->getText().size() >= 3); } // virtual BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) { - if (key == KEY_RETURN - && mask == MASK_NONE) + if (key == KEY_RETURN && mask == MASK_NONE) { if (childHasFocus("Edit")) { onBtnFind(this); - return TRUE; } else { - onBtnAdd(this); - return TRUE; + onBtnSelect(this); } + return TRUE; } else if (key == KEY_ESCAPE && mask == MASK_NONE) { diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 7d7ce2bd29..56bc387bce 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -37,14 +37,6 @@ #include <vector> -class LLUICtrl; -class LLTextBox; -class LLLineEditor; -class LLButton; -class LLScrollListCtrl; -class LLMessageSystem; -class LLInventoryPanel; -class LLFolderViewItem; class LLFloaterAvatarPicker : public LLFloater { @@ -58,47 +50,47 @@ public: BOOL closeOnSelect = FALSE); virtual BOOL postBuild(); - static void processAvatarPickerReply(LLMessageSystem* msg, void**); - static void editKeystroke(LLLineEditor* caller, void* user_data); + static void processAvatarPickerReply(class LLMessageSystem* msg, void**); -protected: - static void* createInventoryPanel(void* userdata); +private: + + static void editKeystroke(class LLLineEditor* caller, void* user_data); static void onBtnFind(void* userdata); - static void onBtnAdd(void* userdata); + static void onBtnSelect(void* userdata); + static void onBtnRefresh(void* userdata); + static void onRangeAdjust(LLUICtrl* source, void* data); static void onBtnClose(void* userdata); - static void onList(LLUICtrl* ctrl, void* userdata); + static void onList(class LLUICtrl* ctrl, void* userdata); + static void onTabChanged(void* userdata, bool from_click); - void doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); - static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); + void doCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data); + static void onCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data); + + void populateNearMe(); + BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. void find(); void setAllowMultiple(BOOL allow_multiple); + virtual void draw(); virtual BOOL handleKeyHere(KEY key, MASK mask); -protected: - LLScrollListCtrl* mListNames; - LLInventoryPanel* mInventoryPanel; - - std::vector<LLUUID> mAvatarIDs; - std::vector<std::string> mAvatarNames; - BOOL mAllowMultiple; + std::vector<LLUUID> mSelectedInventoryAvatarIDs; + std::vector<std::string> mSelectedInventoryAvatarNames; LLUUID mQueryID; BOOL mResultsReturned; + BOOL mNearMeListComplete; BOOL mCloseOnSelect; void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata); void* mCallbackUserdata; -protected: static LLFloaterAvatarPicker* sInstance; -protected: // do not call these directly LLFloaterAvatarPicker(); virtual ~LLFloaterAvatarPicker(); }; - #endif diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 98468297d8..4697296e16 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -145,26 +145,27 @@ void LLFloaterBulkPermission::inventoryChanged(LLViewerObject* viewer_object, void LLFloaterBulkPermission::onApplyBtn(void* user_data) { - LLFloaterBulkPermission* self = (LLFloaterBulkPermission*)user_data; + LLFloaterBulkPermission* self = static_cast<LLFloaterBulkPermission*>(user_data); self->doApply(); } void LLFloaterBulkPermission::onCloseBtn(void* user_data) { - LLFloaterBulkPermission* self = (LLFloaterBulkPermission*)user_data; + LLFloaterBulkPermission* self = static_cast<LLFloaterBulkPermission*>(user_data); self->onClose(false); } //static void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data) { + LLFloaterBulkPermission* self = static_cast<LLFloaterBulkPermission*>(data); // Implements fair use BOOL copyable = gSavedSettings.getBOOL("BulkChangeNextOwnerCopy"); if(!copyable) { gSavedSettings.setBOOL("BulkChangeNextOwnerTransfer", TRUE); } - LLCheckBoxCtrl* xfer = static_cast<LLFloaterPerms*>(data)->getChild<LLCheckBoxCtrl>("next_owner_transfer"); + LLCheckBoxCtrl* xfer = self->getChild<LLCheckBoxCtrl>("next_owner_transfer"); xfer->setEnabled(copyable); } diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index f57042eedb..682ed8e26b 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -71,6 +71,7 @@ #include "llchatbar.h" #include "lllogchat.h" #include "lltexteditor.h" +#include "lltextparser.h" #include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" @@ -263,6 +264,9 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) history_editor->setParseHTML(TRUE); history_editor_with_mute->setParseHTML(TRUE); + history_editor->setParseHighlights(TRUE); + history_editor_with_mute->setParseHighlights(TRUE); + if (!chat.mMuted) { add_timestamped_line(history_editor, chat, color); @@ -405,7 +409,10 @@ void LLFloaterChat::addChat(const LLChat& chat, if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) addChatHistory(chat,false); - + + LLTextParser* highlight = LLTextParser::getInstance(); + highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow()); + if(!from_instant_message) addChatHistory(chat); } diff --git a/indra/newview/llfloaterfonttest.cpp b/indra/newview/llfloaterfonttest.cpp new file mode 100644 index 0000000000..4bb1d9605d --- /dev/null +++ b/indra/newview/llfloaterfonttest.cpp @@ -0,0 +1,65 @@ +/** + * @file llfloaterfonttest.cpp + * @author Brad Payne + * @brief LLFloaterFontTest class implementation + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008 Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +/** + * Floater that appears when buying an object, giving a preview + * of its contents and their permissions. + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterfonttest.h" +#include "lluictrlfactory.h" + + +LLFloaterFontTest* LLFloaterFontTest::sInstance = NULL; + +LLFloaterFontTest::LLFloaterFontTest() + : LLFloater(std::string("floater_font_test"), LLRect(0,500,700,0), std::string("Font Test")) +{ + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_font_test.xml"); +} + +LLFloaterFontTest::~LLFloaterFontTest() +{ + sInstance = NULL; +} + +// static +void LLFloaterFontTest::show(void *unused) +{ + if (!sInstance) + sInstance = new LLFloaterFontTest(); + + sInstance->open(); /*Flawfinder: ignore*/ + sInstance->setFocus(TRUE); +} diff --git a/indra/newview/llfloaterfonttest.h b/indra/newview/llfloaterfonttest.h new file mode 100644 index 0000000000..45ff890423 --- /dev/null +++ b/indra/newview/llfloaterfonttest.h @@ -0,0 +1,51 @@ +/** + * @file llfloaterfonttest.h + * @author Brad Payne + * @brief floater to exercise standard fonts + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERFONTTEST_H +#define LL_LLFLOATERFONTTEST_H + +#include "llfloater.h" + +class LLFloaterFontTest: + public LLFloater +{ +public: + static void show(void* unused); + +private: + LLFloaterFontTest(); + ~LLFloaterFontTest(); + + static LLFloaterFontTest* sInstance; +}; + +#endif diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 9a31582c24..4959a2913e 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -1351,8 +1351,8 @@ void LLPanelRequestTools::refresh() list->operateOnAll(LLCtrlListInterface::OP_DELETE); list->addSimpleElement(SELECTION); list->addSimpleElement(AGENT_REGION); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; std::string name = regionp->getName(); @@ -1412,8 +1412,8 @@ void LLPanelRequestTools::onClickRequest(void* data) else { // find region by name - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; if(dest == regionp->getName()) diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index 15f1e4852d..91471ca2d0 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -100,19 +100,15 @@ LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) mMinWidth = atoi( config_string.c_str() ); mStringArgs["[CLIENT_FRAME_RATE_CRITICAL]"] = getString("client_frame_rate_critical_fps"); - mStringArgs["[CLIENT_FRAME_RATE_CRITICAL]"] = getString("client_frame_rate_critical_fps"); mStringArgs["[CLIENT_FRAME_RATE_WARNING]"] = getString("client_frame_rate_warning_fps"); mStringArgs["[NETWORK_PACKET_LOSS_CRITICAL]"] = getString("network_packet_loss_critical_pct"); - mStringArgs["[NETWORK_PACKET_LOSS_CRITICAL]"] = getString("network_packet_loss_critical_pct"); mStringArgs["[NETWORK_PACKET_LOSS_WARNING]"] = getString("network_packet_loss_warning_pct"); mStringArgs["[NETWORK_PING_CRITICAL]"] = getString("network_ping_critical_ms"); - mStringArgs["[NETWORK_PING_CRITICAL]"] = getString("network_ping_critical_ms"); mStringArgs["[NETWORK_PING_WARNING]"] = getString("network_ping_warning_ms"); mStringArgs["[SERVER_FRAME_RATE_CRITICAL]"] = getString("server_frame_rate_critical_fps"); - mStringArgs["[SERVER_FRAME_RATE_CRITICAL]"] = getString("server_frame_rate_critical_fps"); mStringArgs["[SERVER_FRAME_RATE_WARNING]"] = getString("server_frame_rate_warning_fps"); childSetAction("minimize", onClickShrink, this); @@ -202,6 +198,12 @@ void LLFloaterLagMeter::determineNetwork() bool find_cause_loss = false; bool find_cause_ping = false; + // *FIXME: We can't blame a large ping time on anything in + // particular if the frame rate is low, because a low frame + // rate is a sure recipe for crappy ping times right now until + // the network handlers are de-synched from the rendering. + F32 client_frame_time_ms = 1000.0f * LLViewerStats::getInstance()->mFPSStat.getMeanDuration(); + if(packet_loss >= mNetworkPacketLossCritical) { mNetworkButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME); @@ -211,8 +213,11 @@ void LLFloaterLagMeter::determineNetwork() else if(ping_time >= mNetworkPingCritical) { mNetworkButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME); - mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) ); - find_cause_ping = true; + if (client_frame_time_ms < mNetworkPingCritical) + { + mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) ); + find_cause_ping = true; + } } else if(packet_loss >= mNetworkPacketLossWarning) { @@ -223,8 +228,11 @@ void LLFloaterLagMeter::determineNetwork() else if(ping_time >= mNetworkPingWarning) { mNetworkButton->setImageUnselected(LAG_WARNING_IMAGE_NAME); - mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) ); - find_cause_ping = true; + if (client_frame_time_ms < mNetworkPingWarning) + { + mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) ); + find_cause_ping = true; + } } else { diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index ede2f3d47f..e0396e070c 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -65,6 +65,7 @@ #include "lltexturectrl.h" #include "lluiconstants.h" #include "lluictrlfactory.h" +#include "llviewerimagelist.h" // LLUIImageList #include "llviewermessage.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -193,8 +194,6 @@ void LLFloaterLand::onClose(bool app_quitting) LLFloaterLand::LLFloaterLand(const LLSD& seed) : LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) { - - LLCallbackMap::map_t factory_map; factory_map["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); @@ -305,7 +304,6 @@ LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) BOOL LLPanelLandGeneral::postBuild() { - mEditName = getChild<LLLineEditor>("Name"); mEditName->setCommitCallback(onCommitAny); childSetPrevalidate("Name", LLLineEditor::prevalidatePrintableNotPipe); @@ -335,7 +333,6 @@ BOOL LLPanelLandGeneral::postBuild() mBtnSetGroup->setClickedCallback(onClickSetGroup, this); - mCheckDeedToGroup = getChild<LLCheckBoxCtrl>( "check deed"); childSetCommitCallback("check deed", onCommitAny, this); @@ -615,9 +612,9 @@ void LLPanelLandGeneral::refresh() &dwell); // Area - LLUIString price = childGetText("area_size_text"); + LLUIString price = getString("area_size_text"); price.setArg("[AREA]", llformat("%d",area)); - mTextPriceLabel->setText(childGetText("area_text")); + mTextPriceLabel->setText(getString("area_text")); mTextPrice->setText(price.getString()); mTextDwell->setText(llformat("%.0f", dwell)); @@ -1425,7 +1422,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo return; } - const LLFontGL* FONT = LLFontGL::sSansSerif; + const LLFontGL* FONT = LLFontGL::getFontSansSerif(); // Extract all of the owners. S32 rows = msg->getNumberOfBlocksFast(_PREHASH_Data); @@ -1841,11 +1838,12 @@ LLPanelLandOptions::~LLPanelLandOptions() { } -// public +// virtual void LLPanelLandOptions::refresh() { + refreshSearch(); + LLParcel *parcel = mParcel->getParcel(); - if (!parcel) { mCheckEditObjects ->set(FALSE); @@ -1878,17 +1876,9 @@ void LLPanelLandOptions::refresh() mCheckOtherScripts ->set(FALSE); mCheckOtherScripts ->setEnabled(FALSE); - mCheckShowDirectory ->set(FALSE); - mCheckShowDirectory ->setEnabled(FALSE); - mPushRestrictionCtrl->set(FALSE); mPushRestrictionCtrl->setEnabled(FALSE); - // *TODO:Translate - const std::string& none_string = LLParcel::getCategoryUIString(LLParcel::C_NONE); - mCategoryCombo->setSimple(none_string); - mCategoryCombo->setEnabled(FALSE); - mLandingTypeCombo->setCurrentByIndex(0); mLandingTypeCombo->setEnabled(FALSE); @@ -1952,20 +1942,14 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->setEnabled(can_change_options); } - BOOL can_change_identity = - LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_IDENTITY); - // Set by string in case the order in UI doesn't match the order by index. - // *TODO:Translate - LLParcel::ECategory cat = parcel->getCategory(); - const std::string& category_string = LLParcel::getCategoryUIString(cat); - mCategoryCombo->setSimple(category_string); - mCategoryCombo->setEnabled( can_change_identity ); - BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType()); mLandingTypeCombo->setEnabled( can_change_landing_point ); + bool can_change_identity = + LLViewerParcelMgr::isParcelModifiableByAgent( + parcel, GP_LAND_CHANGE_IDENTITY); mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); mSnapshotCtrl->setEnabled( can_change_identity ); @@ -2003,36 +1987,109 @@ void LLPanelLandOptions::refresh() // virtual void LLPanelLandOptions::draw() { - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel(); - - if(parcel) + refreshSearch(); // Is this necessary? JC + LLPanel::draw(); +} + + +// private +void LLPanelLandOptions::refreshSearch() +{ + LLParcel *parcel = mParcel->getParcel(); + if (!parcel) { - LLViewerRegion* region; - region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); - llassert(region); // Region should never be null. + mCheckShowDirectory->set(FALSE); + mCheckShowDirectory->setEnabled(FALSE); - BOOL can_change_identity = region ? - LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_IDENTITY) && - ! (region->getRegionFlags() & REGION_FLAGS_BLOCK_PARCEL_SEARCH) : false; + // *TODO:Translate + const std::string& none_string = LLParcel::getCategoryUIString(LLParcel::C_NONE); + mCategoryCombo->setSimple(none_string); + mCategoryCombo->setEnabled(FALSE); + return; + } + + LLViewerRegion* region = + LLViewerParcelMgr::getInstance()->getSelectionRegion(); + + bool can_change = + LLViewerParcelMgr::isParcelModifiableByAgent( + parcel, GP_LAND_CHANGE_IDENTITY) + && region + && !(region->getRegionFlags() & REGION_FLAGS_BLOCK_PARCEL_SEARCH); + + // There is a bug with this panel whereby the Show Directory bit can be + // slammed off by the Region based on an override. Since this data is cached + // locally the change will not reflect in the panel, which could cause confusion + // A workaround for this is to flip the bit off in the locally cached version + // when we detect a mismatch case. + if(!can_change && parcel->getParcelFlag(PF_SHOW_DIRECTORY)) + { + parcel->setParcelFlag(PF_SHOW_DIRECTORY, FALSE); + } + BOOL show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); + mCheckShowDirectory ->set(show_directory); + + // Set by string in case the order in UI doesn't match the order by index. + // *TODO:Translate + LLParcel::ECategory cat = parcel->getCategory(); + const std::string& category_string = LLParcel::getCategoryUIString(cat); + mCategoryCombo->setSimple(category_string); - // There is a bug with this panel whereby the Show Directory bit can be - // slammed off by the Region based on an override. Since this data is cached - // locally the change will not reflect in the panel, which could cause confusion - // A workaround for this is to flip the bit off in the locally cached version - // when we detect a mismatch case. - if(! can_change_identity && parcel->getParcelFlag(PF_SHOW_DIRECTORY)) + std::string tooltip; + bool enable_show_directory = false; + // Parcels <= 128 square meters cannot be listed in search, in an + // effort to reduce search spam from small parcels. See also + // the search crawler "grid-crawl.py" in secondlife.com/doc/app/search/ JC + const S32 MIN_PARCEL_AREA_FOR_SEARCH = 128; + bool large_enough = parcel->getArea() > MIN_PARCEL_AREA_FOR_SEARCH; + if (large_enough) + { + if (can_change) + { + tooltip = getString("search_enabled_tooltip"); + enable_show_directory = true; + } + else { - parcel->setParcelFlag(PF_SHOW_DIRECTORY, FALSE); + tooltip = getString("search_disabled_permissions_tooltip"); + enable_show_directory = false; } - mCheckShowDirectory ->set(parcel->getParcelFlag(PF_SHOW_DIRECTORY)); - mCheckShowDirectory ->setEnabled(can_change_identity); - mCategoryCombo->setEnabled(can_change_identity); } - - LLPanel::draw(); + else + { + // not large enough to include in search + if (can_change) + { + if (show_directory) + { + // parcels that are too small, but are still in search for + // legacy reasons, need to have the check box enabled so + // the owner can delist the parcel. JC + tooltip = getString("search_enabled_tooltip"); + enable_show_directory = true; + } + else + { + tooltip = getString("search_disabled_small_tooltip"); + enable_show_directory = false; + } + } + else + { + // both too small and don't have permission, so just + // show the permissions as the reason (which is probably + // the more common case) JC + tooltip = getString("search_disabled_permissions_tooltip"); + enable_show_directory = false; + } + } + mCheckShowDirectory->setToolTip(tooltip); + mCategoryCombo->setToolTip(tooltip); + mCheckShowDirectory->setEnabled(enable_show_directory); + mCategoryCombo->setEnabled(enable_show_directory); +} -} // static void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 7854b7d72c..520ed4147e 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -38,7 +38,8 @@ #include <vector> #include "llfloater.h" -#include "llviewerimagelist.h" +//#include "llviewerimagelist.h" +#include "llmemory.h" // LLPointer<> typedef std::set<LLUUID, lluuid_less> uuid_list_t; const F32 CACHE_REFRESH_TIME = 2.5f; @@ -56,6 +57,7 @@ class LLTabContainer; class LLTextBox; class LLTextEditor; class LLTextureCtrl; +class LLUIImage; class LLViewerTextEditor; class LLParcelSelection; @@ -90,8 +92,7 @@ protected: LLFloaterLand(const LLSD& seed); virtual ~LLFloaterLand(); - void refresh(); - + /*virtual*/ void refresh(); static void* createPanelLandGeneral(void* data); static void* createPanelLandCovenant(void* data); @@ -131,7 +132,7 @@ class LLPanelLandGeneral public: LLPanelLandGeneral(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandGeneral(); - void refresh(); + /*virtual*/ void refresh(); void refreshNames(); virtual void draw(); @@ -231,7 +232,7 @@ class LLPanelLandObjects public: LLPanelLandObjects(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandObjects(); - void refresh(); + /*virtual*/ void refresh(); virtual void draw(); bool callbackReturnOwnerObjects(const LLSD& notification, const LLSD& response); @@ -281,9 +282,9 @@ protected: LLButton *mBtnReturnOwnerList; LLNameListCtrl *mOwnerList; - LLUIImagePtr mIconAvatarOnline; - LLUIImagePtr mIconAvatarOffline; - LLUIImagePtr mIconGroup; + LLPointer<LLUIImage> mIconAvatarOnline; + LLPointer<LLUIImage> mIconAvatarOffline; + LLPointer<LLUIImage> mIconGroup; BOOL mFirstReply; @@ -302,18 +303,20 @@ class LLPanelLandOptions public: LLPanelLandOptions(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandOptions(); - void refresh(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); + /*virtual*/ void refresh(); +private: + // Refresh the "show in search" checkbox and category selector. + void refreshSearch(); static void onCommitAny(LLUICtrl* ctrl, void *userdata); static void onClickSet(void* userdata); static void onClickClear(void* userdata); static void onClickPublishHelp(void*); - virtual BOOL postBuild(); - virtual void draw(); - -protected: +private: LLCheckBoxCtrl* mCheckEditObjects; LLCheckBoxCtrl* mCheckEditGroupObjects; LLCheckBoxCtrl* mCheckAllObjectEntry; diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 6ad6e0c275..3b1e4c7ac7 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -32,120 +32,43 @@ #include "llviewerprecompiledheaders.h" -// self include #include "llfloatermap.h" -// Library includes -#include "llfontgl.h" -#include "llinventory.h" -#include "message.h" - -// Viewer includes #include "llagent.h" #include "llcolorscheme.h" #include "llviewercontrol.h" #include "lldraghandle.h" -#include "lleconomy.h" -#include "llfloaterworldmap.h" -#include "llfocusmgr.h" #include "llnetmap.h" #include "llregionhandle.h" #include "llresizebar.h" -#include "llresizehandle.h" -#include "llresmgr.h" -#include "llsky.h" -#include "llsliderctrl.h" -#include "llspinctrl.h" -#include "llstatgraph.h" -#include "llstatusbar.h" -//#include "lltextbox.h" -#include "llui.h" -#include "llviewermenu.h" -#include "llviewerparceloverlay.h" -#include "llviewerregion.h" -#include "llviewerstats.h" -#include "llurlsimstring.h" - -#include "llglheaders.h" - -// -// Constants -// -const S32 LEGEND_SIZE = 16; - -const S32 HPAD = 4; - -const S32 MAP_COMBOBOX_WIDTH = 128; -const S32 MAP_COMBOBOX_HEIGHT = 20; -const S32 GO_BTN_WIDTH = 20; -const S32 SLIDER_WIDTH = LEGEND_SIZE + MAP_COMBOBOX_WIDTH + HPAD + GO_BTN_WIDTH - HPAD; -const S32 SLIDER_HEIGHT = 16; - -const S32 SIM_STAT_WIDTH = 8; - -const S32 MAP_SCALE_MIN = 35; // in pixels per sim -const S32 MAP_SCALE_MAX = 180; // in pixels per sim -const S32 MAP_SCALE_INCREMENT = 5; - -const S32 NETMAP_MIN_WIDTH = 128; -const S32 NETMAP_MIN_HEIGHT = 128; - -const S32 FLOATERMAP_MIN_WIDTH = - SLIDER_WIDTH + - 2 * (HPAD + LLPANEL_BORDER_WIDTH); - -const S32 MORE_BTN_VPAD = 2; - -const S32 SPIN_VPAD = 4; - -const S32 TRACKING_LABEL_HEIGHT = 16; - -const S32 FLOATERMAP_MIN_HEIGHT_LARGE = 60; - -// -// Globals -// -LLFloaterMap *gFloaterMap = NULL; - +#include "lluictrlfactory.h" +LLFloaterMap::LLFloaterMap(const LLSD& key) + : + LLFloater(std::string("minimap")), + mPanelMap(NULL) +{ + LLCallbackMap::map_t factory_map; + factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); +} -// -// Member functions -// +// static +void* LLFloaterMap::createPanelMiniMap(void* data) +{ + LLFloaterMap* self = (LLFloaterMap*)data; + self->mPanelMap = new LLNetMap("Mapview"); + return self->mPanelMap; +} -LLFloaterMap::LLFloaterMap(const std::string& name) - : - LLFloater(name, - std::string("FloaterMiniMapRect"), - LLStringUtil::null, - TRUE, - FLOATERMAP_MIN_WIDTH, - FLOATERMAP_MIN_HEIGHT_LARGE, - FALSE, - FALSE, - TRUE) // close button +BOOL LLFloaterMap::postBuild() { - const S32 LEFT = LLPANEL_BORDER_WIDTH; - const S32 TOP = getRect().getHeight(); - - S32 y = 0; - - // Map itself - LLRect map_rect( - LEFT, - TOP - LLPANEL_BORDER_WIDTH, - getRect().getWidth() - LLPANEL_BORDER_WIDTH, - y ); - LLColor4 bg_color = gColors.getColor( "NetMapBackgroundColor" ); - mMap = new LLNetMap("Net Map", map_rect, bg_color); - mMap->setFollowsAll(); - addChildAtEnd(mMap); - - // Get the drag handle all the way in back + // Send the drag handle to the back, but make sure close stays on top sendChildToBack(getDragHandle()); - + sendChildToFront(getChild<LLButton>("llfloater_close_btn")); setIsChrome(TRUE); + return TRUE; } @@ -155,11 +78,11 @@ LLFloaterMap::~LLFloaterMap() // virtual -void LLFloaterMap::setVisible(BOOL visible) +void LLFloaterMap::onOpen() { - LLFloater::setVisible(visible); + gFloaterView->adjustToFitScreen(this, FALSE); - gSavedSettings.setBOOL("ShowMiniMap", visible); + gSavedSettings.setBOOL("ShowMiniMap", TRUE); } @@ -189,7 +112,7 @@ void LLFloaterMap::draw() setMouseOpaque(FALSE); getDragHandle()->setMouseOpaque(FALSE); - drawChild(mMap); + drawChild(mPanelMap); } else { @@ -200,18 +123,3 @@ void LLFloaterMap::draw() } } -// static -void LLFloaterMap::toggle(void*) -{ - if( gFloaterMap ) - { - if (gFloaterMap->getVisible()) - { - gFloaterMap->close(); - } - else - { - gFloaterMap->open(); /* Flawfinder: ignore */ - } - } -} diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index 9d7abaf2ae..ec2db27f7a 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -37,32 +37,26 @@ class LLNetMap; -// -// Classes -// -class LLFloaterMap -: public LLFloater +class LLFloaterMap : + public LLFloater, + public LLFloaterSingleton<LLFloaterMap> { + friend class LLUISingleton<LLFloaterMap, VisibilityPolicy<LLFloater> >; public: - LLFloaterMap(const std::string& name); virtual ~LLFloaterMap(); - static void toggle(void*); + static void* createPanelMiniMap(void* data); + + BOOL postBuild(); - /*virtual*/ void setVisible(BOOL visible); /*virtual*/ void draw(); + /*virtual*/ void onOpen(); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ BOOL canClose(); -protected: - LLNetMap* mMap; +private: + LLFloaterMap(const LLSD& key = LLSD()); + LLNetMap* mPanelMap; }; - -// -// Globals -// - -extern LLFloaterMap *gFloaterMap; - #endif // LL_LLFLOATERMAP_H diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 08eb450b6d..52fba0aa20 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -78,13 +78,14 @@ void LLFloaterPerms::onClickCancel(void* data) //static void LLFloaterPerms::onCommitCopy(LLUICtrl* ctrl, void* data) { + LLFloaterPerms* self = static_cast<LLFloaterPerms*>(data); // Implements fair use BOOL copyable = gSavedSettings.getBOOL("NextOwnerCopy"); if(!copyable) { gSavedSettings.setBOOL("NextOwnerTransfer", TRUE); } - LLCheckBoxCtrl* xfer = static_cast<LLFloaterPerms*>(data)->getChild<LLCheckBoxCtrl>("next_owner_transfer"); + LLCheckBoxCtrl* xfer = self->getChild<LLCheckBoxCtrl>("next_owner_transfer"); xfer->setEnabled(copyable); } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 3f699fda99..412494eeb3 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -65,7 +65,6 @@ #include "llviewerregion.h" #include "llcombobox.h" #include "lltooldraganddrop.h" -#include "llfloatermap.h" #include "lluiconstants.h" #include "lluploaddialog.h" #include "llcallingcard.h" diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index cabf165cea..bc774e77ac 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -174,7 +174,7 @@ LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLUUID& object_id) getRect().getWidth() - LLFLOATER_HPAD, LLFLOATER_VPAD ); mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::sSansSerif); + history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); mHistoryEditor->setWordWrap( TRUE ); mHistoryEditor->setFollowsAll(); mHistoryEditor->setEnabled( FALSE ); @@ -197,7 +197,7 @@ void LLFloaterScriptDebugOutput::initFloater(const std::string& title, BOOL resi getRect().getWidth() - LLFLOATER_HPAD, LLFLOATER_VPAD ); mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::sSansSerif); + history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); mHistoryEditor->setWordWrap( TRUE ); mHistoryEditor->setFollowsAll(); mHistoryEditor->setEnabled( FALSE ); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 164c33b10d..e3b95e4058 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2076,6 +2076,8 @@ void LLFloaterSnapshot::draw() void LLFloaterSnapshot::onClose(bool app_quitting) { gSnapshotFloaterView->setEnabled(FALSE); + // Set invisible so it doesn't eat tooltips. JC + gSnapshotFloaterView->setVisible(FALSE); destroy(); } @@ -2104,6 +2106,7 @@ void LLFloaterSnapshot::show(void*) sInstance->open(); /* Flawfinder: ignore */ sInstance->focusFirstItem(FALSE); gSnapshotFloaterView->setEnabled(TRUE); + gSnapshotFloaterView->setVisible(TRUE); gSnapshotFloaterView->adjustToFitScreen(sInstance, FALSE); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 704b53e816..a33b49563c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -309,7 +309,7 @@ BOOL LLFloaterTools::postBuild() mSliderDozerSize = getChild<LLSlider>("slider brush size"); childSetCommitCallback("slider brush size", commit_slider_dozer_size, (void*)0); - childSetValue( "slider brush size", gSavedSettings.getS32("RadioLandBrushSize")); + childSetValue( "slider brush size", gSavedSettings.getF32("LandBrushSize")); mSliderDozerForce = getChild<LLSlider>("slider force"); childSetCommitCallback("slider force",commit_slider_dozer_force, (void*)0); @@ -890,8 +890,8 @@ void click_popup_dozer_mode(LLUICtrl *, void *user) void commit_slider_dozer_size(LLUICtrl *ctrl, void*) { - S32 size = (S32)ctrl->getValue().asInteger(); - gSavedSettings.setS32("RadioLandBrushSize", size); + F32 size = (F32)ctrl->getValue().asReal(); + gSavedSettings.setF32("LandBrushSize", size); } void commit_slider_dozer_force(LLUICtrl *ctrl, void*) diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index f5969b67e5..91beb801ad 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -272,7 +272,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { std::vector<LLDrawable*> potentials; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 6497821349..20140073f4 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -93,8 +93,8 @@ LLHUDText::LLHUDText(const U8 type) : mVisibleOffScreen(FALSE), mWidth(0.f), mHeight(0.f), - mFontp(LLFontGL::sSansSerifSmall), - mBoldFontp(LLFontGL::sSansSerifBold), + mFontp(LLFontGL::getFontSansSerifSmall()), + mBoldFontp(LLFontGL::getFontSansSerifBold()), mMass(1.f), mMaxLines(10), mOffsetY(0), diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index de9e92fcdd..f3943345c7 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -504,7 +504,13 @@ void LLVoiceChannel::deactivate() if (callStarted()) { setState(STATE_HUNG_UP); + // mute the microphone if required when returning to the proximal channel + if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this) + { + gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); + } } + if (sCurrentVoiceChannel == this) { // default channel is proximal channel @@ -523,11 +529,14 @@ void LLVoiceChannel::activate() // deactivate old channel and mark ourselves as the active one if (sCurrentVoiceChannel != this) { - if (sCurrentVoiceChannel) + // mark as current before deactivating the old channel to prevent + // activating the proximal channel between IM calls + LLVoiceChannel* old_channel = sCurrentVoiceChannel; + sCurrentVoiceChannel = this; + if (old_channel) { - sCurrentVoiceChannel->deactivate(); + old_channel->deactivate(); } - sCurrentVoiceChannel = this; } if (mState == STATE_NO_CHANNEL_INFO) @@ -1282,6 +1291,7 @@ BOOL LLFloaterIMPanel::postBuild() mHistoryEditor = getChild<LLViewerTextEditor>("im_history"); mHistoryEditor->setParseHTML(TRUE); + mHistoryEditor->setParseHighlights(TRUE); if ( IM_SESSION_GROUP_START == mDialog ) { @@ -1634,60 +1644,32 @@ BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - BOOL accepted = FALSE; - switch(cargo_type) + + if (mDialog == IM_NOTHING_SPECIAL) { - case DAD_CALLINGCARD: - { - accepted = dropCallingCard((LLInventoryItem*)cargo_data, drop); - break; - } - case DAD_CATEGORY: + LLToolDragAndDrop::handleGiveDragAndDrop(mOtherParticipantUUID, mSessionUUID, drop, + cargo_type, cargo_data, accept); + } + + // handle case for dropping calling cards (and folders of calling cards) onto invitation panel for invites + else if (isInviteAllowed()) + { + *accept = ACCEPT_NO; + + if (cargo_type == DAD_CALLINGCARD) { - accepted = dropCategory((LLInventoryCategory*)cargo_data, drop); - break; + if (dropCallingCard((LLInventoryItem*)cargo_data, drop)) + { + *accept = ACCEPT_YES_MULTI; + } } - - // See stdenums.h - case DAD_TEXTURE: - case DAD_SOUND: - // DAD_CALLINGCARD above - case DAD_LANDMARK: - case DAD_SCRIPT: - case DAD_CLOTHING: - case DAD_OBJECT: - case DAD_NOTECARD: - // DAD_CATEGORY above - case DAD_BODYPART: - case DAD_ANIMATION: - case DAD_GESTURE: + else if (cargo_type == DAD_CATEGORY) { - if (mDialog == IM_NOTHING_SPECIAL) + if (dropCategory((LLInventoryCategory*)cargo_data, drop)) { - // See LLDropTarget for similar code. - LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; - if(gInventory.getItem(inv_item->getUUID()) - && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) - { - accepted = true; - if(drop) - { - LLToolDragAndDrop::giveInventory(mOtherParticipantUUID, inv_item, mSessionUUID); - } - } + *accept = ACCEPT_YES_MULTI; } - break; } - default: - break; - } - if (accepted) - { - *accept = ACCEPT_YES_MULTI; - } - else - { - *accept = ACCEPT_NO; } return TRUE; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0aa406dff1..69a403e388 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1846,15 +1846,23 @@ void LLFolderBridge::folderOptionsMenu() LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; + + const LLInventoryCategory* category = model->getCategory(mUUID); + bool is_default_folder = category && + (LLAssetType::AT_NONE != category->getPreferredType()); // calling card related functionality for folders. - LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); - if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) + // Only enable calling-card related options for non-default folders. + if (!is_default_folder) { - mItems.push_back(std::string("Calling Card Separator")); - mItems.push_back(std::string("Conference Chat Folder")); - mItems.push_back(std::string("IM All Contacts In Folder")); + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); + if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) + { + mItems.push_back(std::string("Calling Card Separator")); + mItems.push_back(std::string("Conference Chat Folder")); + mItems.push_back(std::string("IM All Contacts In Folder")); + } } // wearables related functionality for folders. @@ -1871,8 +1879,7 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Folder Wearables Separator")); // Only enable add/replace outfit for non-default folders. - const LLInventoryCategory* category = model->getCategory(mUUID); - if (!category || (LLAssetType::AT_NONE == category->getPreferredType())) + if (!is_default_folder) { mItems.push_back(std::string("Add To Outfit")); mItems.push_back(std::string("Replace Outfit")); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index dfc34f86da..b1cdfe3886 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1822,7 +1822,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) } LLVector3 help_text_pos = selection_center_start + (mSnapRegimeOffset * 5.f * offset_dir); - const LLFontGL* big_fontp = LLFontGL::sSansSerif; + const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); std::string help_text = "Move mouse cursor over ruler"; LLColor4 help_text_color = LLColor4::white; diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index dfa624a59c..f2585c8543 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1436,7 +1436,7 @@ void LLManipTranslate::renderSnapGuides() LLVector3 selection_center_start = getSavedPivotPoint();//LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent(); LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); - const LLFontGL* big_fontp = LLFontGL::sSansSerif; + const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); std::string help_text = "Move mouse cursor over ruler to snap"; LLColor4 help_text_color = LLColor4::white; diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp index 97dc373b07..215cc6940b 100644 --- a/indra/newview/llmemoryview.cpp +++ b/indra/newview/llmemoryview.cpp @@ -156,7 +156,7 @@ void LLMemoryView::draw() S32 x, y; S32 margin = 10; - S32 texth = (S32)LLFontGL::sMonospace->getLineHeight(); + S32 texth = (S32)LLFontGL::getFontMonospace()->getLineHeight(); S32 xleft = margin; S32 ytop = height - margin; @@ -204,11 +204,11 @@ void LLMemoryView::draw() S32 mbytes = bytes >> 20; tdesc = llformat("%s [%4d MB] in %06d NEWS",mtv_display_table[i].desc,mbytes, LLMemType::sNewCount[tidx]); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); y -= (texth + 2); - S32 textw = LLFontGL::sMonospace->getWidth(tdesc); + S32 textw = LLFontGL::getFontMonospace()->getWidth(tdesc); if (textw > labelwidth) labelwidth = textw; } @@ -230,7 +230,7 @@ void LLMemoryView::draw() tdesc = llformat("Total Bytes: %d MB Overhead: %d KB Avs %d Motions:%d Loading:%d Loaded:%d Active:%d Dep:%d", LLMemType::sTotalMem >> 20, LLMemType::sOverheadMem >> 10, num_avatars, num_motions, num_loading_motions, num_loaded_motions, num_active_motions, num_deprecated_motions); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); } // Bars diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index fea610b92b..6775cbf29e 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -96,7 +96,7 @@ void handle_map(void*) void handle_mini_map(void*) { - LLFloaterMap::toggle(NULL); + LLFloaterMap::toggleInstance(); } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f0fde23535..2eee54df40 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -47,21 +47,18 @@ #include "llviewercontrol.h" #include "llfloateravatarinfo.h" #include "llfloaterworldmap.h" -#include "llfloatermap.h" #include "llframetimer.h" #include "lltracker.h" #include "llmenugl.h" -#include "llstatgraph.h" #include "llsurface.h" #include "lltextbox.h" +#include "lluictrlfactory.h" #include "lluuid.h" #include "llviewercamera.h" #include "llviewerimage.h" #include "llviewerimagelist.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" -#include "llviewermenu.h" -#include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatar.h" @@ -76,19 +73,13 @@ const F32 MAP_SCALE_MID = 172; const F32 MAP_SCALE_MAX = 512; const F32 MAP_SCALE_INCREMENT = 16; const F32 MAP_MIN_PICK_DIST = 4; +const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; const S32 TRACKING_RADIUS = 3; -//static -BOOL LLNetMap::sRotateMap = FALSE; -LLNetMap* LLNetMap::sInstance = NULL; - -LLNetMap::LLNetMap( - const std::string& name, - const LLRect& rect, - const LLColor4& bg_color ) - : - LLUICtrl(name, rect, FALSE, NULL, NULL), mBackgroundColor( bg_color ), +LLNetMap::LLNetMap(const std::string& name) : + LLPanel(name), + mScale(128.f), mObjectMapTPM(1.f), mObjectMapPixels(255.f), mTargetPanX( 0.f ), @@ -97,107 +88,57 @@ LLNetMap::LLNetMap( mCurPanY( 0.f ), mUpdateNow( FALSE ) { - mPixelsPerMeter = gMiniMapScale / REGION_WIDTH_METERS; - - LLNetMap::sRotateMap = gSavedSettings.getBOOL( "MiniMapRotate" ); - - // Surface texture is dynamically generated/updated. -// createObjectImage(); + mScale = gSavedSettings.getF32("MiniMapScale"); + mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); - // TODO: exteralize hardcoded constants. - const S32 DIR_WIDTH = 10; - const S32 DIR_HEIGHT = 10; - LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); - const LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); - const LLRect minor_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH * 2, 0 ); - - // Note: removing special treatment for north compass point (DEV-10559). -MG - //mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); - //mTextBoxNorth->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); - //addChild( mTextBoxNorth ); - mTextBoxNorth = new LLTextBox( std::string("N"), major_dir_rect ); - mTextBoxNorth->setColor( minor_color ); - addChild( mTextBoxNorth ); - - mTextBoxEast = new LLTextBox( std::string("E"), major_dir_rect ); - mTextBoxEast->setColor( minor_color ); - addChild( mTextBoxEast ); - - major_dir_rect.mRight += 1 ; - mTextBoxWest = new LLTextBox( std::string("W"), major_dir_rect ); - mTextBoxWest->setColor( minor_color ); - addChild( mTextBoxWest ); - major_dir_rect.mRight -= 1 ; - - mTextBoxSouth = new LLTextBox( std::string("S"), major_dir_rect ); - mTextBoxSouth->setColor( minor_color ); - addChild( mTextBoxSouth ); - - mTextBoxSouthEast = new LLTextBox( std::string("SE"), minor_dir_rect ); - mTextBoxSouthEast->setColor( minor_color ); - addChild( mTextBoxSouthEast ); - - mTextBoxNorthEast = new LLTextBox( std::string("NE"), minor_dir_rect ); - mTextBoxNorthEast->setColor( minor_color ); - addChild( mTextBoxNorthEast ); - - mTextBoxSouthWest = new LLTextBox( std::string("SW"), minor_dir_rect ); - mTextBoxSouthWest->setColor( minor_color ); - addChild( mTextBoxSouthWest ); - - mTextBoxNorthWest = new LLTextBox( std::string("NW"), minor_dir_rect ); - mTextBoxNorthWest->setColor( minor_color ); - addChild( mTextBoxNorthWest ); - - // Right-click menu - LLMenuGL* menu; - menu = new LLMenuGL(std::string("popup")); - menu->setCanTearOff(FALSE); - menu->append(new LLMenuItemCallGL(std::string("Zoom Close"), handleZoomLevel, - NULL, (void*)2) ); - menu->append(new LLMenuItemCallGL(std::string("Zoom Medium"), handleZoomLevel, - NULL, (void*)1) ); - menu->append(new LLMenuItemCallGL(std::string("Zoom Far"), handleZoomLevel, - NULL, (void*)0) ); - menu->appendSeparator(); - menu->append(new LLMenuItemCallGL(std::string("Stop Tracking"), &LLTracker::stopTracking, - &LLTracker::isTracking, NULL) ); - menu->append(new LLMenuItemCallGL(std::string("Profile..."), &showAgentProfile, - &isAgentUnderCursor, NULL) ); + // Register event listeners for popup menu + (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); + (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); + (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); + (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); + (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); + + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); + + updateMinorDirections(); + + LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_mini_map.xml", this); + if (!menu) + { + menu = new LLMenuGL(LLStringUtil::null); + } menu->setVisible(FALSE); - addChild(menu); mPopupMenuHandle = menu->getHandle(); - sInstance = this; } LLNetMap::~LLNetMap() { - sInstance = NULL; } void LLNetMap::setScale( F32 scale ) { - gMiniMapScale = scale; - if (gMiniMapScale == 0.f) + mScale = scale; + if (mScale == 0.f) { - gMiniMapScale = 0.1f; + mScale = 0.1f; } + gSavedSettings.setF32("MiniMapScale", mScale); if (mObjectImagep.notNull()) { - F32 half_width = (F32)(getRect().getWidth() / 2); - F32 half_height = (F32)(getRect().getHeight() / 2); - F32 radius = sqrt( half_width * half_width + half_height * half_height ); - F32 region_widths = (2.f*radius)/gMiniMapScale; + F32 width = (F32)(getRect().getWidth()); + F32 height = (F32)(getRect().getHeight()); + F32 diameter = sqrt(width * width + height * height); + F32 region_widths = diameter / mScale; F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); F32 num_pixels = (F32)mObjectImagep->getWidth(); - mObjectMapTPM = num_pixels/meters; - mObjectMapPixels = 2.f*radius; + mObjectMapTPM = num_pixels / meters; + mObjectMapPixels = diameter; } - mPixelsPerMeter = gMiniMapScale / REGION_WIDTH_METERS; + mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); mUpdateNow = TRUE; } @@ -219,16 +160,16 @@ void LLNetMap::draw() { createObjectImage(); } - + mCurPanX = lerp(mCurPanX, mTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); mCurPanY = lerp(mCurPanY, mTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); - // Prepare a scissor region F32 rotation = 0; + // Prepare a scissor region { LLGLEnable scissor(GL_SCISSOR_TEST); - + { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLLocalClipRect clip(getLocalRect()); @@ -236,8 +177,11 @@ void LLNetMap::draw() glMatrixMode(GL_MODELVIEW); // Draw background rectangle - gGL.color4fv( mBackgroundColor.mV ); - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0); + if(isBackgroundVisible()) + { + gGL.color4fv(isBackgroundOpaque() ? getBackgroundColor().mV : getTransparentColor().mV); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0); + } } // region 0,0 is in the middle @@ -248,7 +192,8 @@ void LLNetMap::draw() gGL.translatef( (F32) center_sw_left, (F32) center_sw_bottom, 0.f); - if( LLNetMap::sRotateMap ) + BOOL rotate_map = gSavedSettings.getBOOL( "MiniMapRotate" ); + if( rotate_map ) { // rotate subsequent draws to agent rotation rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); @@ -257,35 +202,30 @@ void LLNetMap::draw() // figure out where agent is S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + LLColor4 this_region_color = gColors.getColor( "NetMapThisRegion" ); + LLColor4 live_region_color = gColors.getColor( "NetMapLiveRegion" ); + LLColor4 dead_region_color = gColors.getColor( "NetMapDeadRegion" ); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; // Find x and y position relative to camera's center. LLVector3 origin_agent = regionp->getOriginAgent(); LLVector3 rel_region_pos = origin_agent - gAgent.getCameraPositionAgent(); - F32 relative_x = (rel_region_pos.mV[0] / region_width) * gMiniMapScale; - F32 relative_y = (rel_region_pos.mV[1] / region_width) * gMiniMapScale; + F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale; + F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale; // background region rectangle F32 bottom = relative_y; F32 left = relative_x; - F32 top = bottom + gMiniMapScale ; - F32 right = left + gMiniMapScale ; - - if (regionp == gAgent.getRegion()) - { - gGL.color4f(1.f, 1.f, 1.f, 1.f); - } - else - { - gGL.color4f(0.8f, 0.8f, 0.8f, 1.f); - } + F32 top = bottom + mScale ; + F32 right = left + mScale ; + gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV); if (!regionp->isAlive()) { - gGL.color4f(1.f, 0.5f, 0.5f, 1.f); + gGL.color4fv(dead_region_color.mV); } @@ -351,8 +291,8 @@ void LLNetMap::draw() LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); map_center_agent -= gAgent.getCameraPositionAgent(); - map_center_agent.mV[VX] *= gMiniMapScale/region_width; - map_center_agent.mV[VY] *= gMiniMapScale/region_width; + map_center_agent.mV[VX] *= mScale/region_width; + map_center_agent.mV[VY] *= mScale/region_width; gGL.getTexUnit(0)->bind(mObjectImagep); F32 image_half_width = 0.5f*mObjectMapPixels; @@ -377,93 +317,64 @@ void LLNetMap::draw() // Mouse pointer in local coordinates S32 local_mouse_x; S32 local_mouse_y; - //localMouse(&local_mouse_x, &local_mouse_y); LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); mClosestAgentToCursor.setNull(); F32 closest_dist = F32_MAX; // Draw avatars - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); + LLColor4 friend_color = gColors.getColor( "MapFriend" ); + std::vector<LLUUID> avatar_ids; + std::vector<LLVector3d> positions; + LLWorld::getInstance()->getAvatars(&avatar_ids, &positions); + for(U32 i=0; i<avatar_ids.size(); i++) { - LLViewerRegion* regionp = *iter; - const LLVector3d& origin_global = regionp->getOriginGlobal(); - - S32 count = regionp->mMapAvatars.count(); - S32 i; - LLVector3 pos_local; - U32 compact_local; - U8 bits; // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest. // just be careful to sort the avatar IDs along with the positions. -MG - for (i = 0; i < count; i++) - { - compact_local = regionp->mMapAvatars.get(i); - - bits = compact_local & 0xFF; - pos_local.mV[VZ] = F32(bits) * 4.f; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VY] = (F32)bits; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VX] = (F32)bits; - - pos_global.setVec( pos_local ); - pos_global += origin_global; + pos_map = globalPosToView(positions[i], rotate_map); - pos_map = globalPosToView(pos_global); + LLWorldMapView::drawAvatar( + pos_map.mV[VX], pos_map.mV[VY], + is_agent_friend(avatar_ids[i]) ? friend_color : avatar_color, + pos_map.mV[VZ]); - BOOL show_as_friend = FALSE; - if( i < regionp->mMapAvatarIDs.count()) - { - show_as_friend = is_agent_friend(regionp->mMapAvatarIDs.get(i)); - } - LLWorldMapView::drawAvatar( - pos_map.mV[VX], pos_map.mV[VY], - show_as_friend ? gFriendMapColor : gAvatarMapColor, - pos_map.mV[VZ]); - - F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); - if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) - { - closest_dist = dist_to_cursor; - mClosestAgentToCursor = regionp->mMapAvatarIDs.get(i); - } + F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); + if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) + { + closest_dist = dist_to_cursor; + mClosestAgentToCursor = avatar_ids[i]; } } // Draw dot for autopilot target if (gAgent.getAutoPilot()) { - drawTracking( gAgent.getAutoPilotTargetGlobal(), gTrackColor ); + drawTracking( gAgent.getAutoPilotTargetGlobal(), rotate_map, gTrackColor ); } else { LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if ( LLTracker::TRACKING_AVATAR == tracking_status ) { - drawTracking( LLAvatarTracker::instance().getGlobalPos(), gTrackColor ); + drawTracking( LLAvatarTracker::instance().getGlobalPos(), rotate_map, gTrackColor ); } else if ( LLTracker::TRACKING_LANDMARK == tracking_status || LLTracker::TRACKING_LOCATION == tracking_status ) { - drawTracking( LLTracker::getTrackedPositionGlobal(), gTrackColor ); + drawTracking( LLTracker::getTrackedPositionGlobal(), rotate_map, gTrackColor ); } } // Draw dot for self avatar position pos_global = gAgent.getPositionGlobal(); - pos_map = globalPosToView(pos_global); + pos_map = globalPosToView(pos_global, rotate_map); LLUIImagePtr you = LLWorldMapView::sAvatarYouSmallImage; you->draw( llround(pos_map.mV[VX]) - you->getWidth()/2, llround(pos_map.mV[VY]) - you->getHeight()/2); // Draw frustum - F32 meters_to_pixels = gMiniMapScale/ LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); @@ -478,9 +389,9 @@ void LLNetMap::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - if( LLNetMap::sRotateMap ) + if( rotate_map ) { - gGL.color4fv(gFrustumMapColor.mV); + gGL.color4fv(gColors.getColor("NetMapFrustum").mV); gGL.begin( LLRender::TRIANGLES ); gGL.vertex2f( ctr_x, ctr_y ); @@ -490,7 +401,7 @@ void LLNetMap::draw() } else { - gGL.color4fv(gRotatingFrustumMapColor.mV); + gGL.color4fv(gColors.getColor("NetMapFrustumRotating").mV); // If we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); @@ -506,21 +417,26 @@ void LLNetMap::draw() } // Rotation of 0 means that North is up - setDirectionPos( mTextBoxEast, rotation ); - setDirectionPos( mTextBoxNorth, rotation + F_PI_BY_TWO ); - setDirectionPos( mTextBoxWest, rotation + F_PI ); - setDirectionPos( mTextBoxSouth, rotation + F_PI + F_PI_BY_TWO ); + setDirectionPos( getChild<LLTextBox>("e_label"), rotation); + setDirectionPos( getChild<LLTextBox>("n_label"), rotation + F_PI_BY_TWO); + setDirectionPos( getChild<LLTextBox>("w_label"), rotation + F_PI); + setDirectionPos( getChild<LLTextBox>("s_label"), rotation + F_PI + F_PI_BY_TWO); - setDirectionPos( mTextBoxNorthEast, rotation + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxNorthWest, rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxSouthWest, rotation + F_PI + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxSouthEast, rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos( getChild<LLTextBox>("ne_label"), rotation + F_PI_BY_TWO / 2); + setDirectionPos( getChild<LLTextBox>("nw_label"), rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); + setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); - LLUICtrl::draw(); + LLView::draw(); } -LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) +void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) { + LLPanel::reshape(width, height, called_from_parent); + updateMinorDirections(); +} + +LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos, BOOL rotated ){ LLVector3d relative_pos_global = global_pos - gAgent.getCameraPositionGlobal(); LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles @@ -529,7 +445,7 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters - if( LLNetMap::sRotateMap ) + if( rotated ) { F32 radians = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); LLQuaternion rot(radians, LLVector3(0.f, 0.f, 1.f)); @@ -542,10 +458,10 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) return pos_local; } -void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, - BOOL draw_arrow ) +void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated, + const LLColor4& color, BOOL draw_arrow ) { - LLVector3 pos_local = globalPosToView( pos_global ); + LLVector3 pos_local = globalPosToView( pos_global, rotated ); if( (pos_local.mV[VX] < 0) || (pos_local.mV[VY] < 0) || (pos_local.mV[VX] >= getRect().getWidth()) || @@ -568,22 +484,22 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, } } -LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) +LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) { x -= llround(getRect().getWidth() / 2 + mCurPanX); y -= llround(getRect().getHeight() / 2 + mCurPanY); - LLVector3 pos_local( (F32)x, (F32)y, 0 ); + LLVector3 pos_local( (F32)x, (F32)y, 0.f ); F32 radians = - atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); - if( LLNetMap::sRotateMap ) + if( rotated ) { LLQuaternion rot(radians, LLVector3(0.f, 0.f, 1.f)); pos_local.rotVec( rot ); } - pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / gMiniMapScale ); + pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); LLVector3d pos_global; pos_global.setVec( pos_local ); @@ -595,7 +511,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { // note that clicks are reversed from what you'd think - setScale(llclamp(gMiniMapScale - clicks*MAP_SCALE_INCREMENT, MAP_SCALE_MIN, MAP_SCALE_MAX)); + setScale(llclamp(mScale - clicks*MAP_SCALE_INCREMENT, MAP_SCALE_MIN, MAP_SCALE_MAX)); return TRUE; } @@ -606,7 +522,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec { return FALSE; } - LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y , gSavedSettings.getBOOL( "MiniMapRotate" )) ); if( region ) { msg.assign(""); @@ -627,9 +543,8 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec buffer = region->getHost().getString(); msg.append(buffer); #endif - // *TODO: put this under the control of XUI so it can be - // translated. - msg.append("\n(Double-click to open Map)"); + msg.append("\n"); + msg.append(getToolTip()); S32 SLOP = 4; localPointToScreen( @@ -637,8 +552,12 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) ); sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP; sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP; + handled = TRUE; + } + if(!handled) + { + return LLPanel::handleToolTip(x, y, msg, sticky_rect_screen); } - handled = TRUE; return handled; } @@ -648,19 +567,32 @@ void LLNetMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) // Rotation is in radians. // Rotation of 0 means x = 1, y = 0 on the unit circle. - - F32 map_half_height = (F32)(getRect().getHeight() / 2); - F32 map_half_width = (F32)(getRect().getWidth() / 2); - F32 text_half_height = (F32)(text_box->getRect().getHeight() / 2); - F32 text_half_width = (F32)(text_box->getRect().getWidth() / 2); - F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); + F32 half_height = (F32)( (getRect().getHeight() - text_box->getRect().getHeight()) / 2); + F32 half_width = (F32)( (getRect().getWidth() - text_box->getRect().getWidth()) / 2); + F32 radius = llmin( half_height, half_width ); // Inset by a little to account for position display. radius -= 8.f; - text_box->setOrigin( - llround(map_half_width - text_half_width + radius * cos( rotation )), - llround(map_half_height - text_half_height + radius * sin( rotation )) ); + text_box->setOrigin(llround(half_width + radius * cos( rotation )), + llround(half_height + radius * sin( rotation ))); +} + +void LLNetMap::updateMinorDirections() +{ + if (getChild<LLTextBox>("ne_label") == NULL) + { + return; + } + + // Hide minor directions if they cover too much of the map + bool show_minors = getChild<LLTextBox>("ne_label")->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * + llmin(getRect().getWidth(), getRect().getHeight()); + + getChild<LLTextBox>("ne_label")->setVisible(show_minors); + getChild<LLTextBox>("nw_label")->setVisible(show_minors); + getChild<LLTextBox>("sw_label")->setVisible(show_minors); + getChild<LLTextBox>("se_label")->setVisible(show_minors); } void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius_meters ) @@ -765,10 +697,10 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, void LLNetMap::createObjectImage() { // Find the size of the side of a square that surrounds the circle that surrounds getRect(). - F32 half_width = (F32)(getRect().getWidth() / 2); - F32 half_height = (F32)(getRect().getHeight() / 2); - F32 radius = sqrt( half_width * half_width + half_height * half_height ); - S32 square_size = S32( 2 * radius ); + // ... which is, the diagonal of the rect. + F32 width = getRect().getWidth(); + F32 height = getRect().getHeight(); + S32 square_size = llround( sqrt(width*width + height*height) ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 32; @@ -787,7 +719,7 @@ void LLNetMap::createObjectImage() U8* data = mObjectRawImagep->getData(); memset( data, 0, img_size * img_size * 4 ); mObjectImagep = new LLImageGL( mObjectRawImagep, FALSE); - setScale(gMiniMapScale); + setScale(mScale); } mUpdateNow = TRUE; } @@ -813,28 +745,53 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) // static -void LLNetMap::handleZoomLevel(void* which) +bool LLNetMap::LLScaleMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - intptr_t level = (intptr_t)which; + LLNetMap *self = mPtr; + + S32 level = userdata.asInteger(); switch(level) { case 0: - LLNetMap::sInstance->setScale(MAP_SCALE_MIN); + self->setScale(MAP_SCALE_MIN); break; case 1: - LLNetMap::sInstance->setScale(MAP_SCALE_MID); + self->setScale(MAP_SCALE_MID); break; case 2: - LLNetMap::sInstance->setScale(MAP_SCALE_MAX); + self->setScale(MAP_SCALE_MAX); break; default: break; } + + return true; } -// static -void LLNetMap::showAgentProfile(void*) -{ - LLFloaterAvatarInfo::show(sInstance->mClosestAgentAtLastRightClick); +bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) +{ + LLTracker::stopTracking(NULL); + return true; +} + +bool LLNetMap::LLEnableTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) +{ + LLNetMap *self = mPtr; + self->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking(NULL)); + return true; +} + +bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) +{ + LLNetMap *self = mPtr; + LLFloaterAvatarInfo::show(self->mClosestAgentAtLastRightClick); + return true; +} + +bool LLNetMap::LLEnableProfile::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) +{ + LLNetMap *self = mPtr; + self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); + return true; } diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index fd6635cb4c..a5bf9f0fb5 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -33,59 +33,55 @@ #ifndef LL_LLNETMAP_H #define LL_LLNETMAP_H -#include "llmath.h" -#include "lluictrl.h" +#include "llpanel.h" +#include "llmemberlistener.h" #include "v3math.h" #include "v3dmath.h" #include "v4color.h" #include "llimage.h" #include "llimagegl.h" -class LLColor4U; -class LLCoordGL; + class LLTextBox; -class LLMenuGL; -class LLNetMap : public LLUICtrl +class LLNetMap : public LLPanel { public: - LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color ); + LLNetMap(const std::string& name); virtual ~LLNetMap(); virtual void draw(); + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); + void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); + +private: + void setScale( F32 scale ); + + // *TODO: Enable panning of the mini-map void translatePan( F32 delta_x, F32 delta_y ); void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } - const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; } void renderPoint(const LLVector3 &pos, const LLColor4U &color, S32 diameter, S32 relative_height = 0); - void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); - - LLVector3 globalPosToView(const LLVector3d& global_pos); - LLVector3d viewPosToGlobal(S32 x,S32 y); - - static void setRotateMap( BOOL b ) { LLNetMap::sRotateMap = b; } - static void handleZoomLevel(void* which); + LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated); + LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated); - void drawTracking( const LLVector3d& pos_global, - const LLColor4& color, - BOOL draw_arrow = TRUE); + void drawTracking( const LLVector3d& pos_global, + BOOL rotated, + const LLColor4& color, + BOOL draw_arrow = TRUE); -protected: void setDirectionPos( LLTextBox* text_box, F32 rotation ); + void updateMinorDirections(); void createObjectImage(); - static void teleport( const LLVector3d& destination ); - static void fly( const LLVector3d& destination ); -public: LLHandle<LLView> mPopupMenuHandle; - LLColor4 mBackgroundColor; F32 mScale; // Size of a region in pixels F32 mPixelsPerMeter; // world meters to map pixels @@ -99,15 +95,6 @@ public: LLVector3d mObjectImageCenterGlobal; LLPointer<LLImageRaw> mObjectRawImagep; LLPointer<LLImageGL> mObjectImagep; - LLTextBox* mTextBoxEast; - LLTextBox* mTextBoxNorth; - LLTextBox* mTextBoxWest; - LLTextBox* mTextBoxSouth; - - LLTextBox* mTextBoxSouthEast; - LLTextBox* mTextBoxNorthEast; - LLTextBox* mTextBoxNorthWest; - LLTextBox* mTextBoxSouthWest; private: LLUUID mClosestAgentToCursor; @@ -117,6 +104,37 @@ private: static LLNetMap* sInstance; static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); } static void showAgentProfile(void*); + BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } + + class LLScaleMap : public LLMemberListener<LLNetMap> + { + public: + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); + }; + + class LLStopTracking : public LLMemberListener<LLNetMap> + { + public: + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); + }; + + class LLEnableTracking : public LLMemberListener<LLNetMap> + { + public: + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); + }; + + class LLShowAgentProfile : public LLMemberListener<LLNetMap> + { + public: + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); + }; + + class LLEnableProfile : public LLMemberListener<LLNetMap> + { + public: + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); + }; }; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 41f8f3941a..7253d758ea 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -138,79 +138,15 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - BOOL handled = FALSE; if(getParent()) { - // check if inside - //LLRect parent_rect = mParentView->getRect(); - //getRect().set(0, parent_rect.getHeight(), parent_rect.getWidth(), 0); - handled = TRUE; + LLToolDragAndDrop::handleGiveDragAndDrop(mAgentID, LLUUID::null, drop, + cargo_type, cargo_data, accept); - // check the type - switch(cargo_type) - { - case DAD_TEXTURE: - case DAD_SOUND: - case DAD_LANDMARK: - case DAD_SCRIPT: - case DAD_OBJECT: - case DAD_NOTECARD: - case DAD_CLOTHING: - case DAD_BODYPART: - case DAD_ANIMATION: - case DAD_GESTURE: - { - LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; - if(gInventory.getItem(inv_item->getUUID()) - && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) - { - // *TODO: get multiple object transfers working - *accept = ACCEPT_YES_COPY_SINGLE; - if(drop) - { - LLToolDragAndDrop::giveInventory(mAgentID, inv_item); - } - } - else - { - // It's not in the user's inventory (it's probably - // in an object's contents), so disallow dragging - // it here. You can't give something you don't - // yet have. - *accept = ACCEPT_NO; - } - break; - } - case DAD_CATEGORY: - { - LLViewerInventoryCategory* inv_cat = (LLViewerInventoryCategory*)cargo_data; - if( gInventory.getCategory( inv_cat->getUUID() ) ) - { - // *TODO: get multiple object transfers working - *accept = ACCEPT_YES_COPY_SINGLE; - if(drop) - { - LLToolDragAndDrop::giveInventoryCategory(mAgentID, - inv_cat); - } - } - else - { - // It's not in the user's inventory (it's probably - // in an object's contents), so disallow dragging - // it here. You can't give something you don't - // yet have. - *accept = ACCEPT_NO; - } - break; - } - case DAD_CALLINGCARD: - default: - *accept = ACCEPT_NO; - break; - } + return TRUE; } - return handled; + + return FALSE; } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index d18cfe85fb..13e7cca464 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -242,7 +242,7 @@ void LLPreviewTexture::draw() if( mLoadingFullImage ) { // *TODO: Translate - LLFontGL::sSansSerif->renderUTF8(std::string("Receiving:"), 0, + LLFontGL::getFontSansSerif()->renderUTF8(std::string("Receiving:"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, @@ -279,7 +279,7 @@ void LLPreviewTexture::draw() if( !mSavedFileTimer.hasExpired() ) { // *TODO: Translate - LLFontGL::sSansSerif->renderUTF8(std::string("File Saved"), 0, + LLFontGL::getFontSansSerif()->renderUTF8(std::string("File Saved"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 36304a7191..5f96fc7da0 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -135,6 +135,7 @@ #include "llsrv.h" #include "llstatview.h" #include "lltrans.h" +#include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance #include "llsurface.h" #include "lltexturecache.h" #include "lltexturefetch.h" @@ -1676,11 +1677,14 @@ bool idle_startup() gLoginMenuBarView->setVisible( FALSE ); gLoginMenuBarView->setEnabled( FALSE ); - gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); - LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0); gViewerWindow->adjustControlRectanglesForFirstUse(window); + if(gSavedSettings.getBOOL("ShowMiniMap")) + { + LLFloaterMap::showInstance(); + } + if (gSavedSettings.getBOOL("ShowCameraControls")) { LLFloaterCamera::showInstance(); @@ -1708,7 +1712,10 @@ bool idle_startup() LLError::logToFixedBuffer(gDebugView->mDebugConsolep); // set initial visibility of debug console gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); - gDebugView->mFloaterStatsp->setVisible(gSavedSettings.getBOOL("ShowDebugStats")); + if (gSavedSettings.getBOOL("ShowDebugStats")) + { + LLFloaterStats::showInstance(); + } } // @@ -1774,9 +1781,8 @@ bool idle_startup() gFrameIntervalSeconds = 0.f; } - // Initialize FOV - LLViewerCamera::getInstance()->setView(gSavedSettings.getF32("CameraAngle")); // Make sure agent knows correct aspect ratio + // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); if (gViewerWindow->mWindow->getFullscreen()) { @@ -1786,6 +1792,8 @@ bool idle_startup() { LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); } + // Initialize FOV + LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle")); // Move agent to starting location. The position handed to us by // the space server is in global coordinates, but the agent frame @@ -2115,13 +2123,7 @@ bool idle_startup() // Get L$ and ownership credit information llinfos << "Requesting Money Balance" << llendl; - msg->newMessageFast(_PREHASH_MoneyBalanceRequest); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_MoneyData); - msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); - gAgent.sendReliableMessage(); + LLStatusBar::sendMoneyBalanceRequest(); // request all group information llinfos << "Requesting Agent Data" << llendl; @@ -3185,570 +3187,6 @@ void init_stat_view() LLFrameStatView *frameviewp = gDebugView->mFrameStatView; frameviewp->setup(gFrameStats); frameviewp->mShowPercent = FALSE; - - LLRect rect; - LLStatBar *stat_barp; - rect = gDebugView->mFloaterStatsp->getRect(); - - // - // Viewer advanced stats - // - LLStatView *stat_viewp = NULL; - - // - // Viewer Basic - // - stat_viewp = new LLStatView("basic stat view", "Basic", "OpenDebugStatBasic", rect); - gDebugView->mFloaterStatsp->addStatView(stat_viewp); - - stat_barp = stat_viewp->addStat("FPS", &(LLViewerStats::getInstance()->mFPSStat)); - stat_barp->setUnitLabel(" fps"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 45.f; - stat_barp->mTickSpacing = 7.5f; - stat_barp->mLabelSpacing = 15.f; - stat_barp->mPrecision = 1; - stat_barp->mDisplayBar = TRUE; - stat_barp->mDisplayHistory = TRUE; - - stat_barp = stat_viewp->addStat("Bandwidth", &(LLViewerStats::getInstance()->mKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 900.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 300.f; - stat_barp->mDisplayBar = TRUE; - stat_barp->mDisplayHistory = FALSE; - - stat_barp = stat_viewp->addStat("Packet Loss", &(LLViewerStats::getInstance()->mPacketsLostPercentStat)); - stat_barp->setUnitLabel(" %"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 5.f; - stat_barp->mTickSpacing = 1.f; - stat_barp->mLabelSpacing = 1.f; - stat_barp->mDisplayBar = FALSE; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayMean = TRUE; - stat_barp->mPrecision = 1; - - stat_barp = stat_viewp->addStat("Ping Sim", &(LLViewerStats::getInstance()->mSimPingStat)); - stat_barp->setUnitLabel(" msec"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 1000.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mDisplayBar = FALSE; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayMean = FALSE; - - - stat_viewp = new LLStatView("advanced stat view", "Advanced", "OpenDebugStatAdvanced", rect); - gDebugView->mFloaterStatsp->addStatView(stat_viewp); - - - LLStatView *render_statviewp; - render_statviewp = new LLStatView("render stat view", "Render", "OpenDebugStatRender", rect); - stat_viewp->addChildAtEnd(render_statviewp); - - stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat)); - stat_barp->setUnitLabel("/fr"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 500.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 500.f; - stat_barp->mPrecision = 1; - stat_barp->mPerSec = FALSE; - - stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat)); - stat_barp->setUnitLabel("/sec"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 3000.f; - stat_barp->mTickSpacing = 250.f; - stat_barp->mLabelSpacing = 1000.f; - stat_barp->mPrecision = 1; - - stat_barp = render_statviewp->addStat("Total Objs", &(gObjectList.mNumObjectsStat)); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 10000.f; - stat_barp->mTickSpacing = 2500.f; - stat_barp->mLabelSpacing = 5000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - - stat_barp = render_statviewp->addStat("New Objs", &(gObjectList.mNumNewObjectsStat)); - stat_barp->setLabel("New Objs"); - stat_barp->setUnitLabel("/sec"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 1000.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 500.f; - stat_barp->mPerSec = TRUE; - stat_barp->mDisplayBar = FALSE; - - - // Texture statistics - LLStatView *texture_statviewp; - texture_statviewp = new LLStatView("texture stat view", "Texture", "", rect); - render_statviewp->addChildAtEnd(texture_statviewp); - - stat_barp = texture_statviewp->addStat("Count", &(gImageList.sNumImagesStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 8000.f; - stat_barp->mTickSpacing = 2000.f; - stat_barp->mLabelSpacing = 4000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - - stat_barp = texture_statviewp->addStat("Raw Count", &(gImageList.sNumRawImagesStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 8000.f; - stat_barp->mTickSpacing = 2000.f; - stat_barp->mLabelSpacing = 4000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - - stat_barp = texture_statviewp->addStat("GL Mem", &(gImageList.sGLTexMemStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 400.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPrecision = 1; - stat_barp->mPerSec = FALSE; - - stat_barp = texture_statviewp->addStat("Formatted Mem", &(gImageList.sFormattedMemStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 400.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPrecision = 1; - stat_barp->mPerSec = FALSE; - - stat_barp = texture_statviewp->addStat("Raw Mem", &(gImageList.sRawMemStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 400.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPrecision = 1; - stat_barp->mPerSec = FALSE; - - stat_barp = texture_statviewp->addStat("Bound Mem", &(gImageList.sGLBoundMemStat)); - stat_barp->setUnitLabel(""); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 400.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPrecision = 1; - stat_barp->mPerSec = FALSE; - - - // Network statistics - LLStatView *net_statviewp; - net_statviewp = new LLStatView("network stat view", "Network", "OpenDebugStatNet", rect); - stat_viewp->addChildAtEnd(net_statviewp); - - stat_barp = net_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mPacketsInStat)); - stat_barp->setUnitLabel("/sec"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mPacketsOutStat)); - stat_barp->setUnitLabel("/sec"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mObjectKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Texture", &(LLViewerStats::getInstance()->mTextureKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Asset", &(LLViewerStats::getInstance()->mAssetKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Layers", &(LLViewerStats::getInstance()->mLayersKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mDisplayBar = FALSE; - - stat_barp = net_statviewp->addStat("Actual In", &(LLViewerStats::getInstance()->mActualInKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 1024.f; - stat_barp->mTickSpacing = 128.f; - stat_barp->mLabelSpacing = 256.f; - stat_barp->mDisplayBar = TRUE; - stat_barp->mDisplayHistory = FALSE; - - stat_barp = net_statviewp->addStat("Actual Out", &(LLViewerStats::getInstance()->mActualOutKBitStat)); - stat_barp->setUnitLabel(" kbps"); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 512.f; - stat_barp->mTickSpacing = 128.f; - stat_barp->mLabelSpacing = 256.f; - stat_barp->mDisplayBar = TRUE; - stat_barp->mDisplayHistory = FALSE; - - stat_barp = net_statviewp->addStat("VFS Pending Ops", &(LLViewerStats::getInstance()->mVFSPendingOperations)); - stat_barp->setUnitLabel(" "); - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - - - // Simulator stats - LLStatView *sim_statviewp = new LLStatView("sim stat view", "Simulator", "OpenDebugStatSim", rect); - gDebugView->mFloaterStatsp->addStatView(sim_statviewp); - - stat_barp = sim_statviewp->addStat("Time Dilation", &(LLViewerStats::getInstance()->mSimTimeDilation)); - stat_barp->mPrecision = 2; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 1.f; - stat_barp->mTickSpacing = 0.25f; - stat_barp->mLabelSpacing = 0.5f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Sim FPS", &(LLViewerStats::getInstance()->mSimFPS)); - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 200.f; - stat_barp->mTickSpacing = 20.f; - stat_barp->mLabelSpacing = 100.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Physics FPS", &(LLViewerStats::getInstance()->mSimPhysicsFPS)); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 66.f; - stat_barp->mTickSpacing = 33.f; - stat_barp->mLabelSpacing = 33.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - LLStatView *phys_details_viewp; - phys_details_viewp = new LLStatView("phys detail view", "Physics Details", "", rect); - sim_statviewp->addChildAtEnd(phys_details_viewp); - - stat_barp = phys_details_viewp->addStat("Pinned Objects", &(LLViewerStats::getInstance()->mPhysicsPinnedTasks)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 500.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 40.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = phys_details_viewp->addStat("Low LOD Objects", &(LLViewerStats::getInstance()->mPhysicsLODTasks)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 500.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 40.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = phys_details_viewp->addStat("Memory Allocated", &(LLViewerStats::getInstance()->mPhysicsMemoryAllocated)); - stat_barp->setUnitLabel(" MB"); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 1024.f; - stat_barp->mTickSpacing = 128.f; - stat_barp->mLabelSpacing = 256.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(LLViewerStats::getInstance()->mSimAgentUPS)); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 100.f; - stat_barp->mTickSpacing = 25.f; - stat_barp->mLabelSpacing = 50.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Main Agents", &(LLViewerStats::getInstance()->mSimMainAgents)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 80.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 40.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Child Agents", &(LLViewerStats::getInstance()->mSimChildAgents)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 5.f; - stat_barp->mLabelSpacing = 10.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mSimObjects)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 30000.f; - stat_barp->mTickSpacing = 5000.f; - stat_barp->mLabelSpacing = 10000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Active Objects", &(LLViewerStats::getInstance()->mSimActiveObjects)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 800.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Active Scripts", &(LLViewerStats::getInstance()->mSimActiveScripts)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 800.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Script Events", &(LLViewerStats::getInstance()->mSimScriptEPS)); - stat_barp->setUnitLabel(" eps"); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 20000.f; - stat_barp->mTickSpacing = 2500.f; - stat_barp->mLabelSpacing = 5000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mSimInPPS)); - stat_barp->setUnitLabel(" pps"); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 2000.f; - stat_barp->mTickSpacing = 250.f; - stat_barp->mLabelSpacing = 1000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mSimOutPPS)); - stat_barp->setUnitLabel(" pps"); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 2000.f; - stat_barp->mTickSpacing = 250.f; - stat_barp->mLabelSpacing = 1000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Pending Downloads", &(LLViewerStats::getInstance()->mSimPendingDownloads)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 800.f; - stat_barp->mTickSpacing = 100.f; - stat_barp->mLabelSpacing = 200.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Pending Uploads", &(LLViewerStats::getInstance()->mSimPendingUploads)); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 100.f; - stat_barp->mTickSpacing = 25.f; - stat_barp->mLabelSpacing = 50.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(LLViewerStats::getInstance()->mSimTotalUnackedBytes)); - stat_barp->setUnitLabel(" kb"); - stat_barp->mPrecision = 0; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 100000.f; - stat_barp->mTickSpacing = 25000.f; - stat_barp->mLabelSpacing = 50000.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - LLStatView *sim_time_viewp; - sim_time_viewp = new LLStatView("sim perf view", "Time (ms)", "", rect); - sim_statviewp->addChildAtEnd(sim_time_viewp); - - stat_barp = sim_time_viewp->addStat("Total Frame Time", &(LLViewerStats::getInstance()->mSimFrameMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Net Time", &(LLViewerStats::getInstance()->mSimNetMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Physics Time", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Simulation Time", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Agent Time", &(LLViewerStats::getInstance()->mSimAgentMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Images Time", &(LLViewerStats::getInstance()->mSimImagesMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Script Time", &(LLViewerStats::getInstance()->mSimScriptMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = sim_time_viewp->addStat("Spare Time", &(LLViewerStats::getInstance()->mSimSpareMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - - // 2nd level time blocks under 'Details' second - LLStatView *detailed_time_viewp; - detailed_time_viewp = new LLStatView("sim perf view", "Time Details (ms)", "", rect); - sim_time_viewp->addChildAtEnd(detailed_time_viewp); - { - stat_barp = detailed_time_viewp->addStat(" Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = detailed_time_viewp->addStat(" Update Physics Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = detailed_time_viewp->addStat(" Physics Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = detailed_time_viewp->addStat(" Sleep Time", &(LLViewerStats::getInstance()->mSimSleepMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - - stat_barp = detailed_time_viewp->addStat(" Pump IO", &(LLViewerStats::getInstance()->mSimPumpIOMsec)); - stat_barp->setUnitLabel("ms"); - stat_barp->mPrecision = 1; - stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = 40.f; - stat_barp->mTickSpacing = 10.f; - stat_barp->mLabelSpacing = 20.f; - stat_barp->mPerSec = FALSE; - stat_barp->mDisplayBar = FALSE; - stat_barp->mDisplayMean = FALSE; - } - - LLRect r = gDebugView->mFloaterStatsp->getRect(); - - // Reshape based on the parameters we set. - gDebugView->mFloaterStatsp->reshape(r.getWidth(), r.getHeight()); } void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32) @@ -3947,8 +3385,7 @@ void reset_login() } // Hide any other stuff - if ( gFloaterMap ) - gFloaterMap->setVisible( FALSE ); + LLFloaterMap::hideInstance(); } //--------------------------------------------------------------------------- diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 35e86c6350..971930d7ee 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -34,18 +34,10 @@ #include "llstatusbar.h" -#include <iomanip> - -#include "imageids.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llparcel.h" -#include "llstring.h" -#include "message.h" - +// viewer includes #include "llagent.h" #include "llbutton.h" +#include "llcommandhandler.h" #include "llviewercontrol.h" #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" @@ -82,7 +74,18 @@ #include "llfocusmgr.h" #include "llappviewer.h" -//#include "llfirstuse.h" +// library includes +#include "imageids.h" +#include "llfontgl.h" +#include "llrect.h" +#include "llerror.h" +#include "llparcel.h" +#include "llstring.h" +#include "message.h" + +// system includes +#include <iomanip> + // // Globals @@ -349,7 +352,7 @@ void LLStatusBar::refresh() childSetRect("health", r); x += buttonRect.getWidth(); - const S32 health_width = S32( LLFontGL::sSansSerifSmall->getWidth(std::string("100%")) ); + const S32 health_width = S32( LLFontGL::getFontSansSerifSmall()->getWidth(std::string("100%")) ); r.set(x, y+TEXT_HEIGHT - 2, x+health_width, y); mTextHealth->setRect(r); x += health_width; @@ -678,6 +681,21 @@ void LLStatusBar::setBalance(S32 balance) } } + +// static +void LLStatusBar::sendMoneyBalanceRequest() +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_MoneyBalanceRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_MoneyData); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); + gAgent.sendReliableMessage(); +} + + void LLStatusBar::setHealth(S32 health) { //llinfos << "Setting health to: " << buffer << llendl; @@ -907,3 +925,25 @@ BOOL can_afford_transaction(S32 cost) { return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); } + + +// Implements secondlife:///app/balance/request to request a L$ balance +// update via UDP message system. JC +class LLBalanceHandler : public LLCommandHandler +{ +public: + // Requires "trusted" browser/URL source + LLBalanceHandler() : LLCommandHandler("balance", true) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web) + { + if (tokens.size() == 1 + && tokens[0].asString() == "request") + { + LLStatusBar::sendMoneyBalanceRequest(); + return true; + } + return false; + } +}; +// register with command dispatch system +LLBalanceHandler gBalanceHandler; diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index c17e6fd1ec..c5b4be035a 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -96,6 +96,9 @@ public: void debitBalance(S32 debit); void creditBalance(S32 credit); + // Request the latest currency balance from the server + static void sendMoneyBalanceRequest(); + void setHealth(S32 percent); void setLandCredit(S32 credit); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 9820d20512..dc34c5ad37 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -926,21 +926,21 @@ LLTextureCtrl::LLTextureCtrl( mCaption = new LLTextBox( label, LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), label, - LLFontGL::sSansSerifSmall ); + LLFontGL::getFontSansSerifSmall() ); mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); addChild( mCaption ); S32 image_top = getRect().getHeight(); S32 image_bottom = BTN_HEIGHT_SMALL; S32 image_middle = (image_top + image_bottom) / 2; - S32 line_height = llround(LLFontGL::sSansSerifSmall->getLineHeight()); + S32 line_height = llround(LLFontGL::getFontSansSerifSmall()->getLineHeight()); mTentativeLabel = new LLTextBox( std::string("Multiple"), LLRect( 0, image_middle + line_height / 2, getRect().getWidth(), image_middle - line_height / 2 ), std::string("Multiple"), - LLFontGL::sSansSerifSmall ); + LLFontGL::getFontSansSerifSmall() ); mTentativeLabel->setHAlign( LLFontGL::HCENTER ); mTentativeLabel->setFollowsAll(); addChild( mTentativeLabel ); @@ -1355,7 +1355,7 @@ void LLTextureCtrl::draw() (mTexturep->getDiscardLevel() != 1) && (mTexturep->getDiscardLevel() != 0)) { - LLFontGL* font = LLFontGL::sSansSerifBig; + LLFontGL* font = LLFontGL::getFontSansSerifBig(); font->renderUTF8( mLoadingPlaceholderString, 0, llfloor(interior.mLeft+10), diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index ab7d70d20e..f00d5e5b48 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -209,7 +209,7 @@ void LLTextureBar::draw() mImagep->mFetchPriority); } - LLFontGL::sMonospace->renderUTF8(tex_str, 0, title_x1, getRect().getHeight(), + LLFontGL::getFontMonospace()->renderUTF8(tex_str, 0, title_x1, getRect().getHeight(), color, LLFontGL::LEFT, LLFontGL::TOP); // State @@ -245,7 +245,7 @@ void LLTextureBar::draw() mImagep->mFetchState; state = llclamp(state,0,fetch_state_desc_size-1); - LLFontGL::sMonospace->renderUTF8(fetch_state_desc[state].desc, 0, title_x2, getRect().getHeight(), + LLFontGL::getFontMonospace()->renderUTF8(fetch_state_desc[state].desc, 0, title_x2, getRect().getHeight(), fetch_state_desc[state].color, LLFontGL::LEFT, LLFontGL::TOP); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -327,7 +327,7 @@ void LLTextureBar::draw() // draw the packet data // { // std::string num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets); -// LLFontGL::sMonospace->renderUTF8(num_str, 0, bar_left + 100, getRect().getHeight(), color, +// LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, bar_left + 100, getRect().getHeight(), color, // LLFontGL::LEFT, LLFontGL::TOP); // } @@ -335,7 +335,7 @@ void LLTextureBar::draw() { std::string num_str = llformat("%3dx%3d (%d) %7d", mImagep->getWidth(), mImagep->getHeight(), mImagep->getDiscardLevel(), mImagep->mTextureMemory); - LLFontGL::sMonospace->renderUTF8(num_str, 0, title_x4, getRect().getHeight(), color, + LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, title_x4, getRect().getHeight(), color, LLFontGL::LEFT, LLFontGL::TOP); } } @@ -370,7 +370,7 @@ public: : LLView(name, FALSE), mTextureView(texview) { - S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f); + S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); setRect(LLRect(0,0,100,line_height * 4)); } @@ -389,7 +389,7 @@ void LLGLTexMemBar::draw() S32 total_mem = (LLViewerImage::sTotalTextureMemory >> 20); S32 max_total_mem = LLViewerImage::sMaxTotalTextureMem; F32 discard_bias = LLViewerImage::sDesiredDiscardBias; - S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f); + S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -403,7 +403,7 @@ void LLGLTexMemBar::draw() max_bound_mem, discard_bias); - LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*3, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, line_height*3, text_color, LLFontGL::LEFT, LLFontGL::TOP); //---------------------------------------------------------------------------- @@ -470,40 +470,40 @@ void LLGLTexMemBar::draw() LLImageRaw::sRawImageCount, LLViewerImage::sRawCount, LLViewerImage::sAuxCount, gImageList.mCallbackList.size()); - LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*2, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, line_height*2, text_color, LLFontGL::LEFT, LLFontGL::TOP); S32 dx1 = 0; if (LLAppViewer::getTextureFetch()->mDebugPause) { - LLFontGL::sMonospace->renderUTF8(std::string("!"), 0, title_x1, line_height, + LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); dx1 += 8; } if (mTextureView->mFreezeView) { - LLFontGL::sMonospace->renderUTF8(std::string("*"), 0, title_x1, line_height, + LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); dx1 += 8; } if (mTextureView->mOrderFetch) { - LLFontGL::sMonospace->renderUTF8(title_string1b, 0, title_x1+dx1, line_height, + LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); } else { - LLFontGL::sMonospace->renderUTF8(title_string1a, 0, title_x1+dx1, line_height, + LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); } - LLFontGL::sMonospace->renderUTF8(title_string2, 0, title_x2, line_height, + LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); - LLFontGL::sMonospace->renderUTF8(title_string3, 0, title_x3, line_height, + LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); - LLFontGL::sMonospace->renderUTF8(title_string4, 0, title_x4, line_height, + LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); } diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 015db69d1e..c42693d03f 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -97,7 +97,24 @@ LLToolBrushLand::LLToolBrushLand() mGotHover(FALSE), mBrushSelected(FALSE) { - mBrushIndex = gSavedSettings.getS32("RadioLandBrushSize"); + mBrushSize = gSavedSettings.getF32("LandBrushSize"); +} + + +U8 LLToolBrushLand::getBrushIndex() +{ + // find the best index for desired size + // (compatibility with old sims, brush_index is now depricated - DEV-8252) + U8 index = 0; + for (U8 i = 0; i < LAND_BRUSH_SIZE_COUNT; i++) + { + if (mBrushSize > LAND_BRUSH_SIZE[i]) + { + index = i; + } + } + + return index; } void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, @@ -158,7 +175,6 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, F32 seconds = (1.0f / gFPSClamped) * gSavedSettings.getF32("LandBrushForce"); F32 x_pos = (F32)pos_region.mV[VX]; F32 y_pos = (F32)pos_region.mV[VY]; - U8 brush_size = (U8)mBrushIndex; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ModifyLand); msg->nextBlockFast(_PREHASH_AgentData); @@ -166,7 +182,7 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ModifyBlock); msg->addU8Fast(_PREHASH_Action, (U8)action); - msg->addU8Fast(_PREHASH_BrushSize, brush_size); + msg->addU8Fast(_PREHASH_BrushSize, getBrushIndex()); msg->addF32Fast(_PREHASH_Seconds, seconds); msg->addF32Fast(_PREHASH_Height, mStartingZ); msg->nextBlockFast(_PREHASH_ParcelData); @@ -175,6 +191,8 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, msg->addF32Fast(_PREHASH_South, y_pos ); msg->addF32Fast(_PREHASH_East, x_pos ); msg->addF32Fast(_PREHASH_North, y_pos ); + msg->nextBlock("ModifyBlockExtended"); + msg->addF32("BrushSize", mBrushSize); msg->sendMessage(regionp->getHost()); } } @@ -295,7 +313,6 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() regionp->forceUpdate(); // tell the simulator what we've done - U8 brush_size = (U8)mBrushIndex; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ModifyLand); msg->nextBlockFast(_PREHASH_AgentData); @@ -303,7 +320,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ModifyBlock); msg->addU8Fast(_PREHASH_Action, (U8)action); - msg->addU8Fast(_PREHASH_BrushSize, brush_size); + msg->addU8Fast(_PREHASH_BrushSize, getBrushIndex()); msg->addF32Fast(_PREHASH_Seconds, seconds); msg->addF32Fast(_PREHASH_Height, mStartingZ); @@ -328,6 +345,9 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() msg->addF32Fast(_PREHASH_East, max_region.mV[VX] ); msg->addF32Fast(_PREHASH_North, max_region.mV[VY] ); } + + msg->nextBlock("ModifyBlockExtended"); + msg->addF32("BrushSize", mBrushSize); msg->sendMessage(regionp->getHost()); } @@ -448,7 +468,8 @@ void LLToolBrushLand::render() spot.mdV[VX] = floor( spot.mdV[VX] + 0.5 ); spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 ); - mBrushIndex = gSavedSettings.getS32("RadioLandBrushSize"); + mBrushSize = gSavedSettings.getF32("LandBrushSize"); + region_list_t regions; determineAffectedRegions(regions, spot); @@ -500,7 +521,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region S32 i = (S32) pos_region.mV[VX]; S32 j = (S32) pos_region.mV[VY]; - S32 half_edge = llfloor(LAND_BRUSH_SIZE[mBrushIndex]); + S32 half_edge = llfloor(mBrushSize); S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction"); F32 force = gSavedSettings.getF32("LandBrushForce"); // .1 to 100? @@ -557,27 +578,27 @@ void LLToolBrushLand::determineAffectedRegions(region_list_t& regions, const LLVector3d& spot ) const { LLVector3d corner(spot); - corner.mdV[VX] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); - corner.mdV[VY] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); + corner.mdV[VX] -= (mBrushSize / 2); + corner.mdV[VY] -= (mBrushSize / 2); LLViewerRegion* region = NULL; region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } - corner.mdV[VY] += LAND_BRUSH_SIZE[mBrushIndex]; + corner.mdV[VY] += mBrushSize; region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } - corner.mdV[VX] += LAND_BRUSH_SIZE[mBrushIndex]; + corner.mdV[VX] += mBrushSize; region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } - corner.mdV[VY] -= LAND_BRUSH_SIZE[mBrushIndex]; + corner.mdV[VY] -= mBrushSize; region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h index 3165753804..fca275aa4d 100644 --- a/indra/newview/lltoolbrush.h +++ b/indra/newview/lltoolbrush.h @@ -96,11 +96,14 @@ protected: F32 mStartingZ; S32 mMouseX; S32 mMouseY; - S32 mBrushIndex; + F32 mBrushSize; BOOL mGotHover; BOOL mBrushSelected; // Order doesn't matter and we do check for existance of regions, so use a set region_list_t mLastAffectedRegions; + +private: + U8 getBrushIndex(); }; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index fcad86e498..156093a21a 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1547,7 +1547,7 @@ bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const // static void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, LLInventoryItem* item, - const LLUUID &im_session_id) + const LLUUID& im_session_id) { if(!item) return; std::string name; @@ -1597,7 +1597,9 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, } void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat) + LLInventoryCategory* cat, + const LLUUID& im_session_id) + { if(!cat) return; llinfos << "LLToolDragAndDrop::giveInventoryCategory() - " @@ -1648,12 +1650,12 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, { if(0 == giveable.countNoCopy()) { - LLToolDragAndDrop::commitGiveInventoryCategory(to_agent, cat); + LLToolDragAndDrop::commitGiveInventoryCategory(to_agent, cat, im_session_id); } else { LLGiveInventoryInfo* info = NULL; - info = new LLGiveInventoryInfo(to_agent, cat->getUUID()); + info = new LLGiveInventoryInfo(to_agent, cat->getUUID(), im_session_id); LLSD args; args["COUNT"] = llformat("%d",giveable.countNoCopy()); LLSD payload; @@ -1708,7 +1710,9 @@ bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, co // static void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat) + LLInventoryCategory* cat, + const LLUUID& im_session_id) + { if(!cat) return; llinfos << "LLToolDragAndDrop::commitGiveInventoryCategory() - " @@ -1799,6 +1803,13 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, gFloaterTools->dirty(); LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); + + // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat. + if (im_session_id != LLUUID::null) + { + LLSD args; + gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); + } } } @@ -1959,6 +1970,82 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL return ACCEPT_NO; } + +// function used as drag-and-drop handler for simple agent give inventory requests +//static +bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_id, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept) +{ + // check the type + switch(cargo_type) + { + case DAD_TEXTURE: + case DAD_SOUND: + case DAD_LANDMARK: + case DAD_SCRIPT: + case DAD_OBJECT: + case DAD_NOTECARD: + case DAD_CLOTHING: + case DAD_BODYPART: + case DAD_ANIMATION: + case DAD_GESTURE: + { + LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; + if(gInventory.getItem(inv_item->getUUID()) + && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) + { + // *TODO: get multiple object transfers working + *accept = ACCEPT_YES_COPY_SINGLE; + if(drop) + { + LLToolDragAndDrop::giveInventory(dest_agent, inv_item, session_id); + } + } + else + { + // It's not in the user's inventory (it's probably + // in an object's contents), so disallow dragging + // it here. You can't give something you don't + // yet have. + *accept = ACCEPT_NO; + } + break; + } + case DAD_CATEGORY: + { + LLViewerInventoryCategory* inv_cat = (LLViewerInventoryCategory*)cargo_data; + if( gInventory.getCategory( inv_cat->getUUID() ) ) + { + // *TODO: get multiple object transfers working + *accept = ACCEPT_YES_COPY_SINGLE; + if(drop) + { + LLToolDragAndDrop::giveInventoryCategory(dest_agent, inv_cat, session_id); + } + } + else + { + // It's not in the user's inventory (it's probably + // in an object's contents), so disallow dragging + // it here. You can't give something you don't + // yet have. + *accept = ACCEPT_NO; + } + break; + } + case DAD_CALLINGCARD: + default: + *accept = ACCEPT_NO; + break; + } + + return TRUE; +} + + + /// /// Methods called in the drag & drop array /// diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 83e1dc7905..f9e5bec143 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -218,7 +218,9 @@ protected: // give inventory category functionality static bool handleCopyProtectedCategory(const LLSD& notification, const LLSD& response); static void commitGiveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat); + LLInventoryCategory* cat, + const LLUUID &im_session_id = LLUUID::null); + public: // helper functions static BOOL isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); } @@ -257,7 +259,13 @@ public: LLInventoryItem* item, const LLUUID &session_id = LLUUID::null); static void giveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* item); + LLInventoryCategory* item, + const LLUUID &session_id = LLUUID::null); + + static bool handleGiveDragAndDrop(LLUUID agent, LLUUID session, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept); }; // utility functions diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 7640972d42..88fddd9336 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -608,7 +608,7 @@ void LLToolPlacerPanel::addButton( const std::string& up_state, const std::strin down_state, LLStringUtil::null, &LLToolPlacerPanel::setObjectType, pcode, - LLFontGL::sSansSerif); + LLFontGL::getFontSansSerif()); btn->setFollowsBottom(); btn->setFollowsLeft(); addChild(btn); diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index efa6dde6c8..9f6a77d245 100644 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -93,7 +93,7 @@ LLToolView::~LLToolView() // "", // &LLToolView::onClickToolButton, // contain, -// LLFontGL::sSansSerif); +// LLFontGL::getFontSansSerif()); // contain->mPanel = panel; // contain->mTool = tool; diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 63ce14229b..8e81152a89 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -567,7 +567,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, wstr += '\n'; wstr += utf8str_to_wstring(text); - hud_textp->setFont(LLFontGL::sSansSerif); + hud_textp->setFont(LLFontGL::getFontSansSerif()); hud_textp->setZCompare(FALSE); hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index c0d3466fab..2c487665d2 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -45,7 +45,6 @@ #include "llflexibleobject.h" #include "llfeaturemanager.h" #include "llviewershadermgr.h" -#include "llnetmap.h" #include "llpanelgeneral.h" #include "llpanelinput.h" #include "llsky.h" @@ -417,12 +416,6 @@ bool handleEffectColorChanged(const LLSD& newvalue) return true; } -bool handleRotateNetMapChanged(const LLSD& newvalue) -{ - LLNetMap::setRotateMap(newvalue.asBoolean()); - return true; -} - bool handleVectorizeChanged(const LLSD& newvalue) { LLViewerJointMesh::updateVectorize(); @@ -485,8 +478,8 @@ void settings_setup_listeners() gSavedSettings.getControl("UploadBakedTexOld")->getSignal()->connect(boost::bind(&handleUploadBakedTexOldChanged, _1)); gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _1)); gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); + gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); + gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); @@ -550,11 +543,10 @@ void settings_setup_listeners() gSavedSettings.getControl("BuildAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); gSavedSettings.getControl("BuildAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); gSavedSettings.getControl("BuildAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _1)); - gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _1)); + gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _1)); + gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _1)); gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _1)); gSavedSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _1)); - gSavedSettings.getControl("MiniMapRotate")->getSignal()->connect(boost::bind(handleRotateNetMapChanged, _1)); gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 47a887e909..50e5b4e90c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -102,13 +102,15 @@ #include "llfloatereditui.h" #include "llfloaterchatterbox.h" #include "llfloaterfriends.h" +#include "llfloaterfonttest.h" #include "llfloatergesture.h" #include "llfloatergodtools.h" #include "llfloatergroupinfo.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" #include "llfloaterhtml.h" -#include "llfloaterhtmlhelp.h" +#include "llfloaterhtmlcurrency.h" +#include "llfloaterhtmlhelp.h" // gViewerHtmlHelp #include "llfloaterhtmlsimple.h" #include "llfloaterhud.h" #include "llfloaterinspect.h" @@ -186,6 +188,7 @@ #include "llviewercamera.h" #include "llviewergenericmessage.h" #include "llviewergesture.h" +#include "llviewerimagelist.h" // gImageList #include "llviewerinventory.h" #include "llviewermenufile.h" // init_menu_file() #include "llviewermessage.h" @@ -418,7 +421,6 @@ void handle_force_delete(void*); void print_object_info(void*); void print_agent_nvpairs(void*); void toggle_debug_menus(void*); -void toggle_map( void* user_data ); void export_info_callback(LLAssetInfo *info, void **user_data, S32 result); void export_data_callback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void **user_data, S32 result); void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status); @@ -1057,6 +1059,7 @@ void init_debug_ui_menu(LLMenuGL* menu) void init_debug_xui_menu(LLMenuGL* menu) { menu->append(new LLMenuItemCallGL("Floater Test...", LLFloaterTest::show)); + menu->append(new LLMenuItemCallGL("Font Test...", LLFloaterFontTest::show)); menu->append(new LLMenuItemCallGL("Export Menus to XML...", handle_export_menus_to_xml)); menu->append(new LLMenuItemCallGL("Edit UI...", LLFloaterEditUI::show)); menu->append(new LLMenuItemCallGL("Load from XML...", handle_load_from_xml)); @@ -4580,22 +4583,6 @@ void toggle_debug_menus(void*) } -void toggle_map( void* user_data ) -{ - // Toggle the item - BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) ); - gSavedSettings.setBOOL( static_cast<char*>(user_data), !checked ); - if (checked) - { - gFloaterMap->close(); - } - else - { - gFloaterMap->open(); /* Flawfinder: ignore */ - } -} - - // LLUUID gExporterRequestID; // std::string gExportDirectory; @@ -5112,11 +5099,11 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "mini map") { - LLFloaterMap::toggle(NULL); + LLFloaterMap::toggleInstance(); } else if (floater_name == "stat bar") { - gDebugView->mFloaterStatsp->setVisible(!gDebugView->mFloaterStatsp->getVisible()); + LLFloaterStats::toggleInstance(); } else if (floater_name == "my land") { @@ -5248,7 +5235,7 @@ class LLFloaterVisible : public view_listener_t } else if (floater_name == "stat bar") { - new_value = gDebugView->mFloaterStatsp->getVisible(); + new_value = LLFloaterStats::instanceVisible(); } else if (floater_name == "active speakers") { @@ -7046,7 +7033,7 @@ void handle_buy_currency_test(void*) llinfos << "buy currency url " << url << llendl; - LLFloaterHtmlSimple* floater = LLFloaterHtmlSimple::showInstance(url); + LLFloaterHtmlCurrency* floater = LLFloaterHtmlCurrency::showInstance(url); // Needed so we can use secondlife:///app/floater/self/close SLURLs floater->setTrusted(true); floater->center(); @@ -7440,6 +7427,19 @@ void initialize_menus() F32 mVal; bool mMult; }; + + class LLAvatarReportAbuse : public view_listener_t + { + bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + { + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); + if(avatar) + { + LLFloaterReporter::showFromObject(avatar->getID()); + } + return true; + } + }; // File menu init_menu_file(); @@ -7574,6 +7574,7 @@ void initialize_menus() addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); addMenu(new LLAvatarEject(), "Avatar.Eject"); addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); + addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); addMenu(new LLObjectEnableMute(), "Avatar.EnableMute"); addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 77b69d0ad4..dae3529319 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -82,7 +82,6 @@ #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" -#include "llfloatermap.h" #include "llurldispatcher.h" #include "llfloatermute.h" #include "llfloaterpostcard.h" @@ -97,7 +96,6 @@ #include "llinventoryview.h" #include "llmenugl.h" #include "llmutelist.h" -#include "llnetmap.h" #include "llnotifications.h" #include "llnotify.h" #include "llpanelgrouplandmoney.h" diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 4a81c06efb..d7313c1653 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -66,7 +66,6 @@ #include "llface.h" #include "llfloaterproperties.h" #include "llfollowcam.h" -#include "llnetmap.h" #include "llselectmgr.h" #include "llrendersphere.h" #include "lltooldraganddrop.h" @@ -991,7 +990,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (!mText) { mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::sSansSerif); + mText->setFont(LLFontGL::getFontSansSerif()); mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); mText->setMaxLines(-1); mText->setSourceObject(this); @@ -1409,7 +1408,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (!mText && (value & 0x4)) { mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::sSansSerif); + mText->setFont(LLFontGL::getFontSansSerif()); mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); mText->setMaxLines(-1); // Set to match current agni behavior. mText->setSourceObject(this); @@ -4057,7 +4056,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text) if (!mText) { mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::sSansSerif); + mText->setFont(LLFontGL::getFontSansSerif()); mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); mText->setMaxLines(-1); mText->setSourceObject(this); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 2560ad95d8..e0741e7233 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1112,7 +1112,7 @@ void LLViewerObjectList::generatePickList(LLCamera &camera) std::vector<LLDrawable*> pick_drawables; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 1ee651ba37..194029398d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -833,7 +833,7 @@ void LLViewerParcelMgr::renderParcelCollision() mRenderCollision = FALSE; } - if (mRenderCollision) + if (mRenderCollision && gSavedSettings.getBOOL("ShowBanLines")) { LLViewerRegion* regionp = gAgent.getRegion(); BOOL use_pass = mCollisionParcel->getParcelFlag(PF_USE_PASS_LIST); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e822c81500..87b6652056 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -54,7 +54,6 @@ #include "llfloaterreporter.h" #include "llfloaterregioninfo.h" #include "llhttpnode.h" -#include "llnetmap.h" #include "llsdutil.h" #include "llstartup.h" #include "llviewerobjectlist.h" diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 587fa11de8..1fd31a013a 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -148,8 +148,8 @@ public: // return true if there are no embedded items. bool empty(); - void bindEmbeddedChars(LLFontGL* font) const; - void unbindEmbeddedChars(LLFontGL* font) const; + void bindEmbeddedChars(const LLFontGL* font) const; + void unbindEmbeddedChars(const LLFontGL* font) const; BOOL insertEmbeddedItem(LLInventoryItem* item, llwchar* value, bool is_new); BOOL removeEmbeddedItem( llwchar ext_char ); @@ -369,7 +369,7 @@ BOOL LLEmbeddedItems::hasEmbeddedItem(llwchar ext_char) return FALSE; } -void LLEmbeddedItems::bindEmbeddedChars( LLFontGL* font ) const +void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const { if( sEntries.empty() ) { @@ -439,7 +439,7 @@ void LLEmbeddedItems::bindEmbeddedChars( LLFontGL* font ) const } } -void LLEmbeddedItems::unbindEmbeddedChars( LLFontGL* font ) const +void LLEmbeddedItems::unbindEmbeddedChars( const LLFontGL* font ) const { if( sEntries.empty() ) { @@ -1286,12 +1286,12 @@ llwchar LLViewerTextEditor::pasteEmbeddedItem(llwchar ext_char) return LL_UNKNOWN_CHAR; // item not found or list full } -void LLViewerTextEditor::bindEmbeddedChars(LLFontGL* font) const +void LLViewerTextEditor::bindEmbeddedChars(const LLFontGL* font) const { mEmbeddedItemList->bindEmbeddedChars( font ); } -void LLViewerTextEditor::unbindEmbeddedChars(LLFontGL* font) const +void LLViewerTextEditor::unbindEmbeddedChars(const LLFontGL* font) const { mEmbeddedItemList->unbindEmbeddedChars( font ); } @@ -1589,6 +1589,7 @@ LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlF BOOL parse_html = text_editor->mParseHTML; node->getAttributeBOOL("allow_html", parse_html); text_editor->setParseHTML(parse_html); + text_editor->setParseHighlights(TRUE); text_editor->initFromXML(node, parent); diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 3aa47da580..0aa9164c90 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -98,8 +98,8 @@ public: private: // Embedded object operations virtual llwchar pasteEmbeddedItem(llwchar ext_char); - virtual void bindEmbeddedChars(LLFontGL* font) const; - virtual void unbindEmbeddedChars(LLFontGL* font) const; + virtual void bindEmbeddedChars(const LLFontGL* font) const; + virtual void unbindEmbeddedChars(const LLFontGL* font) const; BOOL getEmbeddedItemToolTipAtPos(S32 pos, LLWString &wmsg) const; BOOL openEmbeddedItemAtPos( S32 pos ); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cddca66220..44d9a72868 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -101,7 +101,6 @@ #include "llfloatereditui.h" // HACK JAMESDEBUG for ui editor #include "llfloaterland.h" #include "llfloaterinspect.h" -#include "llfloatermap.h" #include "llfloaternamedesc.h" #include "llfloaterpreference.h" #include "llfloatersnapshot.h" @@ -556,7 +555,7 @@ public: iter != mLineList.end(); ++iter) { const Line& line = *iter; - LLFontGL::sMonospace->renderUTF8(line.text, 0, (F32)line.x, (F32)line.y, mTextColor, + LLFontGL::getFontMonospace()->renderUTF8(line.text, 0, (F32)line.x, (F32)line.y, mTextColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE); } @@ -1664,7 +1663,9 @@ void LLViewerWindow::initBase() gFloaterView->setVisible(TRUE); gSnapshotFloaterView = new LLSnapshotFloaterView("Snapshot Floater View", full_window); - gSnapshotFloaterView->setVisible(TRUE); + // Snapshot floater must start invisible otherwise it eats all + // the tooltips. JC + gSnapshotFloaterView->setVisible(FALSE); // Console llassert( !gConsole ); @@ -1860,6 +1861,8 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) adjust_rect_bottom_left("FloaterDayCycleRect", window); + adjust_rect_top_right("FloaterStatisticsRect", window); + // bottom-right r = gSavedSettings.getRect("FloaterInventoryRect"); @@ -1914,16 +1917,6 @@ void LLViewerWindow::initWorldUI() gHoverView = new LLHoverView(std::string("gHoverView"), full_window); gHoverView->setVisible(TRUE); mRootView->addChild(gHoverView); - - // - // Map - // - // TODO: Move instance management into class - gFloaterMap = new LLFloaterMap(std::string("Map")); - gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); - - // keep onscreen - gFloaterView->adjustToFitScreen(gFloaterMap, FALSE); gIMMgr = LLIMMgr::getInstance(); @@ -2006,7 +1999,6 @@ void LLViewerWindow::shutdownViews() gFloaterView = NULL; gMorphView = NULL; - gFloaterMap = NULL; gHUDView = NULL; gNotifyBoxView = NULL; @@ -2383,7 +2375,7 @@ void LLViewerWindow::draw() { // Used for special titles such as "Second Life - Special E3 2003 Beta" const S32 DIST_FROM_TOP = 20; - LLFontGL::sSansSerifBig->renderUTF8( + LLFontGL::getFontSansSerifBig()->renderUTF8( mOverlayTitle, 0, llround( getWindowWidth() * 0.5f), getWindowHeight() - DIST_FROM_TOP, @@ -4645,7 +4637,7 @@ void LLViewerWindow::stopGL(BOOL save_state) gBumpImageList.destroyGL(); stop_glerror(); - LLFontGL::destroyGL(); + LLFontGL::destroyAllGL(); stop_glerror(); LLVOAvatar::destroyGL(); @@ -4732,23 +4724,12 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) void LLViewerWindow::initFonts(F32 zoom_factor) { - LLFontGL::destroyGL(); + LLFontGL::destroyAllGL(); LLFontGL::initDefaultFonts( gSavedSettings.getF32("FontScreenDPI"), - mDisplayScale.mV[VX] * zoom_factor, - mDisplayScale.mV[VY] * zoom_factor, - gSavedSettings.getString("FontMonospace"), - gSavedSettings.getF32("FontSizeMonospace"), - gSavedSettings.getString("FontSansSerif"), - gSavedSettings.getString("FontSansSerifFallback"), - gSavedSettings.getF32("FontSansSerifFallbackScale"), - gSavedSettings.getF32("FontSizeSmall"), - gSavedSettings.getF32("FontSizeMedium"), - gSavedSettings.getF32("FontSizeLarge"), - gSavedSettings.getF32("FontSizeHuge"), - gSavedSettings.getString("FontSansSerifBold"), - gSavedSettings.getF32("FontSizeMedium"), - gDirUtilp->getAppRODataDir() - ); + mDisplayScale.mV[VX] * zoom_factor, + mDisplayScale.mV[VY] * zoom_factor, + gDirUtilp->getAppRODataDir(), + LLUICtrlFactory::getXUIPaths()); } void LLViewerWindow::toggleFullscreen(BOOL show_progress) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8d20e4e91c..e5507dfacb 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -55,6 +55,10 @@ #include "llkeyframestandmotion.h" #include "llkeyframewalkmotion.h" #include "llmutelist.h" +#include "llnotify.h" +#include "llquantize.h" +#include "llregionhandle.h" +#include "llresmgr.h" #include "llselectmgr.h" #include "llsprite.h" #include "lltargetingmotion.h" @@ -3125,7 +3129,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (visible_chat) { mNameText->setDropShadow(TRUE); - mNameText->setFont(LLFontGL::sSansSerif); + mNameText->setFont(LLFontGL::getFontSansSerif()); mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); if (new_name) @@ -3202,11 +3206,11 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { if (gSavedSettings.getBOOL("SmallAvatarNames")) { - mNameText->setFont(LLFontGL::sSansSerif); + mNameText->setFont(LLFontGL::getFontSansSerif()); } else { - mNameText->setFont(LLFontGL::sSansSerifBig); + mNameText->setFont(LLFontGL::getFontSansSerifBig()); } mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 6dfe23ba98..82003daaf4 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -186,12 +186,13 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) S32 count=0; mDepth = 0.f; S32 i = 0 ; + LLVector3 camera_agent = getCameraPosition(); for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) { const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; LLVector3 part_pos_agent(part->mPosAgent); - LLVector3 at(part_pos_agent - LLViewerCamera::getInstance()->getOrigin()); + LLVector3 at(part_pos_agent - camera_agent); F32 camera_dist_squared = at.lengthSquared(); F32 inv_camera_dist_squared; @@ -314,7 +315,7 @@ void LLVOPartGroup::getGeometry(S32 idx, up *= 0.5f*part.mScale.mV[1]; - const LLVector3& normal = -LLViewerCamera::getInstance()->getXAxis(); + LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); *verticesp++ = part_pos_agent + up - right; *verticesp++ = part_pos_agent - up - right; @@ -500,12 +501,8 @@ F32 LLParticlePartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera) } U32 LLVOHUDPartGroup::getPartitionType() const -{ - // Commenting out and returning PARTITION_NONE because DEV-16909 - // (SVC-2396: Particles not handled properly as hud) didn't work completely - // so this disables HUD particles until they can be fixed properly. -MG - //return LLViewerRegion::PARTITION_HUD_PARTICLE; - return LLViewerRegion::PARTITION_NONE; +{ + return LLViewerRegion::PARTITION_HUD_PARTICLE; } LLDrawable* LLVOHUDPartGroup::createDrawable(LLPipeline *pipeline) @@ -520,3 +517,4 @@ LLVector3 LLVOHUDPartGroup::getCameraPosition() const { return LLVector3(-1,0,0); } + diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index f11ef97b55..c9cc86bbbc 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -947,7 +947,7 @@ void LLWorld::updateWaterObjects() void LLWorld::shiftRegions(const LLVector3& offset) { - for (region_list_t::iterator i = getRegionList().begin(); i != getRegionList().end(); ++i) + for (region_list_t::const_iterator i = getRegionList().begin(); i != getRegionList().end(); ++i) { LLViewerRegion* region = *i; region->updateRenderMatrix(); @@ -1133,8 +1133,8 @@ void send_agent_pause() gAgentPauseSerialNum++; gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; gMessageSystem->sendReliable(regionp->getHost()); @@ -1163,8 +1163,8 @@ void send_agent_resume() gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); - iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; gMessageSystem->sendReliable(regionp->getHost()); @@ -1176,6 +1176,62 @@ void send_agent_resume() LLAppViewer::instance()->resumeMainloopTimeout(); } +static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) +{ + LLVector3d pos_global; + LLVector3 pos_local; + U8 bits; + + bits = compact_local & 0xFF; + pos_local.mV[VZ] = F32(bits) * 4.f; + compact_local >>= 8; + + bits = compact_local & 0xFF; + pos_local.mV[VY] = (F32)bits; + compact_local >>= 8; + + bits = compact_local & 0xFF; + pos_local.mV[VX] = (F32)bits; + + pos_global.setVec( pos_local ); + pos_global += region_origin; + return pos_global; +} + +void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const +{ + if(avatar_ids != NULL) + { + avatar_ids->clear(); + } + if(positions != NULL) + { + positions->clear(); + } + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + const LLVector3d& origin_global = regionp->getOriginGlobal(); + S32 count = regionp->mMapAvatars.count(); + for (S32 i = 0; i < count; i++) + { + LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global); + if(dist_vec(pos_global, relative_to) <= radius) + { + if(positions != NULL) + { + positions->push_back(pos_global); + } + if(avatar_ids != NULL) + { + avatar_ids->push_back(regionp->mMapAvatarIDs.get(i)); + } + } + } + } +} + LLHTTPRegistration<LLEstablishAgentCommunication> gHTTPRegistrationEstablishAgentCommunication( diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 52188dd66e..ce83cbd97c 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -1,6 +1,11 @@ /** * @file llworld.h - * @brief Initial test structure to organize viewer regions + * @brief Collection of viewer regions in the vacinity of the user. + * + * Represents the whole world, so far as 3D functionality is conserned. + * Always contains the region that the user's avatar is in along with + * neighboring regions. As the user crosses region boundaries, new + * regions are added to the world and distant ones are rolled up. * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -147,12 +152,18 @@ public: public: typedef std::list<LLViewerRegion*> region_list_t; - - region_list_t mActiveRegionList; + const region_list_t& getRegionList() const { return mActiveRegionList; } - region_list_t& getRegionList() { return mActiveRegionList; } + // Returns lists of avatar IDs and their world-space positions within a given distance of a point. + // All arguments are optional. Given containers will be emptied and then filled. + // Not supplying origin or radius input returns data on all avatars in the known regions. + void getAvatars( + std::vector<LLUUID>* avatar_ids = NULL, + std::vector<LLVector3d>* positions = NULL, + const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; private: + region_list_t mActiveRegionList; region_list_t mRegionList; region_list_t mVisibleRegionList; region_list_t mCulledRegionList; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index db36fa0ffe..9ff94751d0 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -651,7 +651,7 @@ void LLWorldMapView::draw() } // Draw the region name in the lower left corner - LLFontGL* font = LLFontGL::sSansSerifSmall; + LLFontGL* font = LLFontGL::getFontSansSerifSmall(); std::string mesg; if (gMapScale < sThresholdA) @@ -763,7 +763,7 @@ void LLWorldMapView::draw() TRUE, "You are here", "", - llround(LLFontGL::sSansSerifSmall->getLineHeight())); // offset vertically by one line, to avoid overlap with target tracking + llround(LLFontGL::getFontSansSerifSmall()->getLineHeight())); // offset vertically by one line, to avoid overlap with target tracking } // Show your viewing angle @@ -893,6 +893,9 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i void LLWorldMapView::drawAgents() { F32 agents_scale = (gMapScale * 0.9f) / 256.f; + + LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); + // LLColor4 friend_color = gColors.getColor( "MapFriend" ); for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) { @@ -915,8 +918,8 @@ void LLWorldMapView::drawAgents() S32 agent_count = info.mExtra; sim_agent_count += info.mExtra; // Here's how we'd choose the color if info.mID were available but it's not being sent: - //LLColor4 color = (agent_count == 1 && is_agent_friend(info.mID)) ? gFriendMapColor : gAvatarMapColor; - drawImageStack(info.mPosGlobal, sAvatarSmallImage, agent_count, 3.f, gAvatarMapColor); + //LLColor4 color = (agent_count == 1 && is_agent_friend(info.mID)) ? friend_color : avatar_color; + drawImageStack(info.mPosGlobal, sAvatarSmallImage, agent_count, 3.f, avatar_color); } LLWorldMap::getInstance()->mNumAgents[handle] = sim_agent_count; // override mNumAgents for this sim } @@ -931,7 +934,7 @@ void LLWorldMapView::drawAgents() region_center[VY] += REGION_WIDTH_METERS / 2; // Reduce the stack size as you zoom out - always display at lease one agent where there is one or more S32 agent_count = (S32)(((num_agents-1) * agents_scale + (num_agents-1) * 0.1f)+.1f) + 1; - drawImageStack(region_center, sAvatarSmallImage, agent_count, 3.f, gAvatarMapColor); + drawImageStack(region_center, sAvatarSmallImage, agent_count, 3.f, avatar_color); } } } @@ -1045,7 +1048,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& LLVector3 pos_local = globalPosToView( pos_global ); S32 x = llround( pos_local.mV[VX] ); S32 y = llround( pos_local.mV[VY] ); - LLFontGL* font = LLFontGL::sSansSerifSmall; + LLFontGL* font = LLFontGL::getFontSansSerifSmall(); S32 text_x = x; S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight()); @@ -1278,7 +1281,7 @@ void LLWorldMapView::drawIconName(F32 x_pixels, - VERT_PAD); // render text - LLFontGL::sSansSerif->renderUTF8(first_line, 0, + LLFontGL::getFontSansSerif()->renderUTF8(first_line, 0, text_x, text_y, color, @@ -1286,10 +1289,10 @@ void LLWorldMapView::drawIconName(F32 x_pixels, LLFontGL::TOP, LLFontGL::DROP_SHADOW); - text_y -= llround(LLFontGL::sSansSerif->getLineHeight()); + text_y -= llround(LLFontGL::getFontSansSerif()->getLineHeight()); // render text - LLFontGL::sSansSerif->renderUTF8(second_line, 0, + LLFontGL::getFontSansSerif()->renderUTF8(second_line, 0, text_x, text_y, color, diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d90eaa9d9b..8dec9b9ba8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -646,7 +646,7 @@ void LLPipeline::restoreGL() LLViewerShaderMgr::instance()->setShaders(); } - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -797,7 +797,7 @@ void LLPipeline::dirtyPoolObjectTextures(const std::set<LLViewerImage*>& texture } LLOctreeDirtyTexture dirty(textures); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -1245,7 +1245,7 @@ void LLPipeline::updateMove() { LLFastTimer ot(LLFastTimer::FTM_OCTREE_BALANCE); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -1292,7 +1292,7 @@ void LLPipeline::grabReferences(LLCullResult& result) BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) { - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -1324,7 +1324,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& BOOL res = TRUE; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -1387,7 +1387,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLGLDepthTest depth(GL_TRUE, GL_FALSE); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -1775,7 +1775,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) } mShiftList.resize(0); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -3050,7 +3050,7 @@ void LLPipeline::renderDebug() gGL.setColorMask(true, false); // Debug stuff. - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -3067,7 +3067,7 @@ void LLPipeline::renderDebug() } } - for (LLCullResult::bridge_list_t::iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) + for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) { LLSpatialBridge* bridge = *i; if (!bridge->isDead() && !bridge->isState(LLSpatialGroup::OCCLUDED) && hasRenderType(bridge->mDrawableType)) @@ -3153,7 +3153,7 @@ void LLPipeline::renderDebug() gGL.end(); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -4628,7 +4628,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, sPickAvatar = FALSE; //LLToolMgr::getInstance()->inBuildMode() ? FALSE : TRUE; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -4685,7 +4685,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, //check against avatars sPickAvatar = TRUE; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -4762,7 +4762,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector3& start, co { LLDrawable* drawable = NULL; - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; @@ -4825,7 +4825,7 @@ void LLPipeline::resetVertexBuffers() { sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; diff --git a/indra/newview/skins/default/xui/fr/floater_font_test.xml b/indra/newview/skins/default/xui/fr/floater_font_test.xml new file mode 100644 index 0000000000..b469e08c81 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/floater_font_test.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
+ height="800" min_height="175" min_width="154" name="contents"
+ title="Font Test" width="500">
+
+<text name="linea" font="OverrideTest" follows="left|top|right" bottom_delta="-20" left="16" height="16">
+OverrideTest, should be timesbd, from default/xui/fr
+</text>
+
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/fonts.xml b/indra/newview/skins/default/xui/fr/fonts.xml new file mode 100644 index 0000000000..021372d6f2 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/fonts.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<fonts>
+
+ <font name="OverrideTest"
+ comment="Name of font to test overriding">
+ <file>timesbd.ttf</file>
+ </font>
+
+</fonts>
|