aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewermenu.cpp528
1 files changed, 169 insertions, 359 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index c2a8055..9782d4b 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -85,6 +85,7 @@
85#include "llfloateranimpreview.h" 85#include "llfloateranimpreview.h"
86#include "llfloateravatarinfo.h" 86#include "llfloateravatarinfo.h"
87#include "llfloateravatartextures.h" 87#include "llfloateravatartextures.h"
88#include "llfloaterbeacons.h"
88#include "llfloaterbuildoptions.h" 89#include "llfloaterbuildoptions.h"
89#include "llfloaterbump.h" 90#include "llfloaterbump.h"
90#include "llfloaterbuy.h" 91#include "llfloaterbuy.h"
@@ -323,13 +324,6 @@ void handle_talk_to(void *userdata);
323// Debug menu 324// Debug menu
324void show_permissions_control(void*); 325void show_permissions_control(void*);
325void toggle_build_options(void* user_data); 326void toggle_build_options(void* user_data);
326#if 0 // Unused
327void handle_audio_status_1(void*);
328void handle_audio_status_2(void*);
329void handle_audio_status_3(void*);
330void handle_audio_status_4(void*);
331#endif
332void manage_landmarks(void*);
333void reload_ui(void*); 327void reload_ui(void*);
334void handle_agent_stop_moving(void*); 328void handle_agent_stop_moving(void*);
335void print_packets_lost(void*); 329void print_packets_lost(void*);
@@ -795,12 +789,6 @@ void init_client_menu(LLMenuGL* menu)
795 &menu_check_control, 789 &menu_check_control,
796 (void*)"QuietSnapshotsToDisk")); 790 (void*)"QuietSnapshotsToDisk"));
797 791
798 menu->append(new LLMenuItemCheckGL( "Compress Snapshots to Disk",
799 &menu_toggle_control,
800 NULL,
801 &menu_check_control,
802 (void*)"CompressSnapshotsToDisk"));
803
804 menu->append(new LLMenuItemCheckGL("Show Mouselook Crosshairs", 792 menu->append(new LLMenuItemCheckGL("Show Mouselook Crosshairs",
805 &menu_toggle_control, 793 &menu_toggle_control,
806 NULL, 794 NULL,
@@ -948,6 +936,7 @@ void init_client_menu(LLMenuGL* menu)
948 sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror)); 936 sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror));
949 sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access)); 937 sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access));
950 sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop)); 938 sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop));
939 sub->append(new LLMenuItemCallGL("Force Disconnect Viewer", &handle_disconnect_viewer));
951 // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception)); 940 // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception));
952 sub->createJumpKeys(); 941 sub->createJumpKeys();
953 menu->appendMenu(sub); 942 menu->appendMenu(sub);
@@ -1162,10 +1151,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1162 &LLPipeline::toggleRenderDebugFeature, NULL, 1151 &LLPipeline::toggleRenderDebugFeature, NULL,
1163 &LLPipeline::toggleRenderDebugFeatureControl, 1152 &LLPipeline::toggleRenderDebugFeatureControl,
1164 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL)); 1153 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL));
1165 sub_menu->append(new LLMenuItemCheckGL("Palletized Textures",
1166 &LLPipeline::toggleRenderDebugFeature, NULL,
1167 &LLPipeline::toggleRenderDebugFeatureControl,
1168 (void*)LLPipeline::RENDER_DEBUG_FEATURE_PALETTE, KEY_F7, MASK_ALT|MASK_CONTROL));
1169 sub_menu->append(new LLMenuItemCheckGL("Test FRInfo", 1154 sub_menu->append(new LLMenuItemCheckGL("Test FRInfo",
1170 &LLPipeline::toggleRenderDebugFeature, NULL, 1155 &LLPipeline::toggleRenderDebugFeature, NULL,
1171 &LLPipeline::toggleRenderDebugFeatureControl, 1156 &LLPipeline::toggleRenderDebugFeatureControl,
@@ -1216,9 +1201,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1216 sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL, 1201 sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL,
1217 &LLPipeline::toggleRenderDebugControl, 1202 &LLPipeline::toggleRenderDebugControl,
1218 (void*)LLPipeline::RENDER_DEBUG_FACE_AREA)); 1203 (void*)LLPipeline::RENDER_DEBUG_FACE_AREA));
1219 sub_menu->append(new LLMenuItemCheckGL("Pick Render", &LLPipeline::toggleRenderDebug, NULL,
1220 &LLPipeline::toggleRenderDebugControl,
1221 (void*)LLPipeline::RENDER_DEBUG_PICKING));
1222 sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL, 1204 sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL,
1223 &LLPipeline::toggleRenderDebugControl, 1205 &LLPipeline::toggleRenderDebugControl,
1224 (void*)LLPipeline::RENDER_DEBUG_LIGHTS)); 1206 (void*)LLPipeline::RENDER_DEBUG_LIGHTS));
@@ -1237,9 +1219,7 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1237 sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, 1219 sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL,
1238 &LLPipeline::toggleRenderDebugControl, 1220 &LLPipeline::toggleRenderDebugControl,
1239 (void*)LLPipeline::RENDER_DEBUG_SCULPTED)); 1221 (void*)LLPipeline::RENDER_DEBUG_SCULPTED));
1240 1222
1241 sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect));
1242
1243 sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); 1223 sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test));
1244 1224
1245 sub_menu = new LLMenuGL("Render Tests"); 1225 sub_menu = new LLMenuGL("Render Tests");
@@ -1757,6 +1737,24 @@ class LLViewCheckJoystickFlycam : public view_listener_t
1757 } 1737 }
1758}; 1738};
1759 1739
1740class LLViewCommunicate : public view_listener_t
1741{
1742 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1743 {
1744 if (LLFloaterChatterBox::getInstance()->getFloaterCount() == 0)
1745 {
1746 LLFloaterMyFriends::toggleInstance();
1747 }
1748 else
1749 {
1750 LLFloaterChatterBox::toggleInstance();
1751 }
1752
1753 return true;
1754 }
1755};
1756
1757
1760void handle_toggle_flycam() 1758void handle_toggle_flycam()
1761{ 1759{
1762 LLViewerJoystick::getInstance()->toggleFlycam(); 1760 LLViewerJoystick::getInstance()->toggleFlycam();
@@ -2225,37 +2223,71 @@ class LLAvatarDebug : public view_listener_t
2225 } 2223 }
2226}; 2224};
2227 2225
2226struct MenuCallbackData
2227{
2228 bool ban_enabled;
2229 LLUUID avatar_id;
2230};
2231
2228void callback_eject(S32 option, void* data) 2232void callback_eject(S32 option, void* data)
2229{ 2233{
2230 LLUUID* avatar_id = (LLUUID*) data; 2234 MenuCallbackData *callback_data = (MenuCallbackData*)data;
2235 if (!callback_data)
2236 {
2237 return;
2238 }
2239 if (2 == option)
2240 {
2241 // Cancle button.
2242 return;
2243 }
2244 LLUUID avatar_id = callback_data->avatar_id;
2245 bool ban_enabled = callback_data->ban_enabled;
2231 2246
2232 if (0 == option || 1 == option) 2247 if (0 == option)
2233 { 2248 {
2249 // Eject button
2234 LLMessageSystem* msg = gMessageSystem; 2250 LLMessageSystem* msg = gMessageSystem;
2235 LLViewerObject* avatar = gObjectList.findObject(*avatar_id); 2251 LLViewerObject* avatar = gObjectList.findObject(avatar_id);
2236 2252
2237 if (avatar) 2253 if (avatar)
2238 { 2254 {
2239 U32 flags = 0x0; 2255 U32 flags = 0x0;
2240 if (1 == option) 2256 msg->newMessage("EjectUser");
2241 { 2257 msg->nextBlock("AgentData");
2242 // eject and add to ban list 2258 msg->addUUID("AgentID", gAgent.getID() );
2243 flags |= 0x1; 2259 msg->addUUID("SessionID", gAgent.getSessionID() );
2244 } 2260 msg->nextBlock("Data");
2261 msg->addUUID("TargetID", avatar_id );
2262 msg->addU32("Flags", flags );
2263 msg->sendReliable( avatar->getRegion()->getHost() );
2264 }
2265 }
2266 else if (ban_enabled)
2267 {
2268 // This is tricky. It is similar to say if it is not an 'Eject' button,
2269 // and it is also not an 'Cancle' button, and ban_enabled==ture,
2270 // it should be the 'Eject and Ban' button.
2271 LLMessageSystem* msg = gMessageSystem;
2272 LLViewerObject* avatar = gObjectList.findObject(avatar_id);
2245 2273
2274 if (avatar)
2275 {
2276 U32 flags = 0x1;
2246 msg->newMessage("EjectUser"); 2277 msg->newMessage("EjectUser");
2247 msg->nextBlock("AgentData"); 2278 msg->nextBlock("AgentData");
2248 msg->addUUID("AgentID", gAgent.getID() ); 2279 msg->addUUID("AgentID", gAgent.getID() );
2249 msg->addUUID("SessionID", gAgent.getSessionID() ); 2280 msg->addUUID("SessionID", gAgent.getSessionID() );
2250 msg->nextBlock("Data"); 2281 msg->nextBlock("Data");
2251 msg->addUUID("TargetID", *avatar_id ); 2282 msg->addUUID("TargetID", avatar_id );
2252 msg->addU32("Flags", flags ); 2283 msg->addU32("Flags", flags );
2253 msg->sendReliable( avatar->getRegion()->getHost() ); 2284 msg->sendReliable( avatar->getRegion()->getHost() );
2254 } 2285 }
2255 } 2286 }
2256 2287
2257 delete avatar_id; 2288
2258 avatar_id = NULL; 2289 delete callback_data;
2290 callback_data = NULL;
2259} 2291}
2260 2292
2261class LLAvatarEject : public view_listener_t 2293class LLAvatarEject : public view_listener_t
@@ -2265,23 +2297,50 @@ class LLAvatarEject : public view_listener_t
2265 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 2297 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
2266 if( avatar ) 2298 if( avatar )
2267 { 2299 {
2268 LLUUID* avatar_id = new LLUUID( avatar->getID() ); 2300 MenuCallbackData *data = new MenuCallbackData;
2301 (*data).avatar_id = avatar->getID();
2269 std::string fullname = avatar->getFullname(); 2302 std::string fullname = avatar->getFullname();
2270 2303
2271 if (!fullname.empty()) 2304 const LLVector3d& pos = avatar->getPositionGlobal();
2305 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel();
2306
2307 if (LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED))
2272 { 2308 {
2273 LLStringUtil::format_map_t args; 2309 (*data).ban_enabled = true;
2274 args["[AVATAR_NAME]"] = fullname; 2310 if (!fullname.empty())
2275 gViewerWindow->alertXml("EjectAvatarFullname", 2311 {
2276 args, 2312 LLStringUtil::format_map_t args;
2277 callback_eject, 2313 args["[AVATAR_NAME]"] = fullname;
2278 (void*)avatar_id); 2314 gViewerWindow->alertXml("EjectAvatarFullname",
2315 args,
2316 callback_eject,
2317 (void*)data);
2318 }
2319 else
2320 {
2321 gViewerWindow->alertXml("EjectAvatar",
2322 callback_eject,
2323 (void*)data);
2324 }
2279 } 2325 }
2280 else 2326 else
2281 { 2327 {
2282 gViewerWindow->alertXml("EjectAvatar", 2328 (*data).ban_enabled = false;
2283 callback_eject, 2329 if (!fullname.empty())
2284 (void*)avatar_id); 2330 {
2331 LLStringUtil::format_map_t args;
2332 args["[AVATAR_NAME]"] = fullname;
2333 gViewerWindow->alertXml("EjectAvatarFullnameNoBan",
2334 args,
2335 callback_eject,
2336 (void*)data);
2337 }
2338 else
2339 {
2340 gViewerWindow->alertXml("EjectAvatarNoBan",
2341 callback_eject,
2342 (void*)data);
2343 }
2285 } 2344 }
2286 } 2345 }
2287 return true; 2346 return true;
@@ -2298,12 +2357,18 @@ class LLAvatarEnableFreezeEject : public view_listener_t
2298 if (new_value) 2357 if (new_value)
2299 { 2358 {
2300 const LLVector3& pos = avatar->getPositionRegion(); 2359 const LLVector3& pos = avatar->getPositionRegion();
2360 const LLVector3d& pos_global = avatar->getPositionGlobal();
2361 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel();
2301 LLViewerRegion* region = avatar->getRegion(); 2362 LLViewerRegion* region = avatar->getRegion();
2302 new_value = (region != NULL); 2363 new_value = (region != NULL);
2303 2364
2304 if (new_value) 2365 if (new_value)
2305 { 2366 {
2306 new_value = (region->isOwnedSelf(pos) || region->isOwnedGroup(pos)); 2367 new_value = region->isOwnedSelf(pos);
2368 if (!new_value || region->isOwnedGroup(pos))
2369 {
2370 new_value = LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_ADMIN);
2371 }
2307 } 2372 }
2308 } 2373 }
2309 2374
@@ -2674,33 +2739,6 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**)
2674 } 2739 }
2675} 2740}
2676 2741
2677void load_url_local_file(const std::string& file_name)
2678{
2679 if( gAgent.cameraMouselook() )
2680 {
2681 gAgent.changeCameraToDefault();
2682 }
2683
2684#if LL_DARWIN || LL_LINUX || LL_SOLARIS
2685 // MBW -- If the Mac client is in fullscreen mode, it needs to go windowed so the browser will be visible.
2686 if(gViewerWindow->mWindow->getFullscreen())
2687 {
2688 gViewerWindow->toggleFullscreen(TRUE);
2689 }
2690#endif
2691
2692 // JC - system() blocks until IE has launched.
2693 // spawn() runs asynchronously, but opens a command prompt.
2694 // ShellExecute() just opens the damn file with the default
2695 // web browser.
2696 std::string full_path = "file:///";
2697 full_path.append(gDirUtilp->getAppRODataDir());
2698 full_path.append(gDirUtilp->getDirDelimiter());
2699 full_path.append(file_name);
2700
2701 LLWeb::loadURL(full_path);
2702}
2703
2704/* 2742/*
2705class LLHaveCallingcard : public LLInventoryCollectFunctor 2743class LLHaveCallingcard : public LLInventoryCollectFunctor
2706{ 2744{
@@ -2908,63 +2946,16 @@ void show_permissions_control(void*)
2908 floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0); 2946 floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0);
2909} 2947}
2910 2948
2911#if 0 // Unused (these just modify AudioInfoPage which is not used anywhere in the code
2912void handle_audio_status_1(void*)
2913{
2914 S32 page = gSavedSettings.getS32("AudioInfoPage");
2915 if (1 == page)
2916 {
2917 page = 0;
2918 }
2919 else
2920 {
2921 page = 1;
2922 }
2923 gSavedSettings.setS32("AudioInfoPage", page);
2924}
2925
2926void handle_audio_status_2(void*)
2927{
2928 S32 page = gSavedSettings.getS32("AudioInfoPage");
2929 if (2 == page)
2930 {
2931 page = 0;
2932 }
2933 else
2934 {
2935 page = 2;
2936 }
2937 gSavedSettings.setS32("AudioInfoPage", page);
2938}
2939
2940void handle_audio_status_3(void*)
2941{
2942 S32 page = gSavedSettings.getS32("AudioInfoPage");
2943 if (3 == page)
2944 {
2945 page = 0;
2946 }
2947 else
2948 {
2949 page = 3;
2950 }
2951 gSavedSettings.setS32("AudioInfoPage", page);
2952}
2953 2949
2954void handle_audio_status_4(void*) 2950class LLCreateLandmarkCallback : public LLInventoryCallback
2955{ 2951{
2956 S32 page = gSavedSettings.getS32("AudioInfoPage"); 2952public:
2957 if (4 == page) 2953 /*virtual*/ void fire(const LLUUID& inv_item)
2958 {
2959 page = 0;
2960 }
2961 else
2962 { 2954 {
2963 page = 4; 2955 llinfos << "Created landmark with inventory id " << inv_item
2956 << llendl;
2964 } 2957 }
2965 gSavedSettings.setS32("AudioInfoPage", page); 2958};
2966}
2967#endif
2968 2959
2969void reload_ui(void *) 2960void reload_ui(void *)
2970{ 2961{
@@ -3197,26 +3188,7 @@ void reset_view_final( BOOL proceed, void* )
3197 return; 3188 return;
3198 } 3189 }
3199 3190
3200 gAgent.changeCameraToDefault(); 3191 gAgent.resetView(TRUE, TRUE);
3201
3202 if (LLViewerJoystick::getInstance()->getOverrideCamera())
3203 {
3204 handle_toggle_flycam();
3205 }
3206
3207 // reset avatar mode from eventual residual motion
3208 if (LLToolMgr::getInstance()->inBuildMode())
3209 {
3210 LLViewerJoystick::getInstance()->moveAvatar(true);
3211 }
3212
3213 gAgent.resetView(!gFloaterTools->getVisible());
3214 gFloaterTools->close();
3215
3216 gViewerWindow->showCursor();
3217
3218 // Switch back to basic toolset
3219 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
3220} 3192}
3221 3193
3222class LLViewLookAtLastChatter : public view_listener_t 3194class LLViewLookAtLastChatter : public view_listener_t
@@ -4881,7 +4853,7 @@ class LLWorldCreateLandmark : public view_listener_t
4881 LLAssetType::AT_LANDMARK, 4853 LLAssetType::AT_LANDMARK,
4882 LLInventoryType::IT_LANDMARK, 4854 LLInventoryType::IT_LANDMARK,
4883 NOT_WEARABLE, PERM_ALL, 4855 NOT_WEARABLE, PERM_ALL,
4884 NULL); 4856 new LLCreateLandmarkCallback);
4885 return true; 4857 return true;
4886 } 4858 }
4887}; 4859};
@@ -5301,6 +5273,10 @@ class LLShowFloater : public view_listener_t
5301 { 5273 {
5302 LLFloaterActiveSpeakers::toggleInstance(LLSD()); 5274 LLFloaterActiveSpeakers::toggleInstance(LLSD());
5303 } 5275 }
5276 else if (floater_name == "beacons")
5277 {
5278 LLFloaterBeacons::toggleInstance(LLSD());
5279 }
5304 return true; 5280 return true;
5305 } 5281 }
5306}; 5282};
@@ -5348,6 +5324,10 @@ class LLFloaterVisible : public view_listener_t
5348 { 5324 {
5349 new_value = LLFloaterActiveSpeakers::instanceVisible(LLSD()); 5325 new_value = LLFloaterActiveSpeakers::instanceVisible(LLSD());
5350 } 5326 }
5327 else if (floater_name == "beacons")
5328 {
5329 new_value = LLFloaterBeacons::instanceVisible(LLSD());
5330 }
5351 gMenuHolder->findControl(control_name)->setValue(new_value); 5331 gMenuHolder->findControl(control_name)->setValue(new_value);
5352 return true; 5332 return true;
5353 } 5333 }
@@ -5384,37 +5364,6 @@ class LLPromptShowURL : public view_listener_t
5384 } 5364 }
5385}; 5365};
5386 5366
5387void callback_show_file(S32 option, void* data)
5388{
5389 std::string* filenamep = (std::string*)data;
5390 if (0 == option)
5391 {
5392 load_url_local_file(*filenamep);
5393 }
5394 delete filenamep;
5395}
5396
5397class LLPromptShowFile : public view_listener_t
5398{
5399 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5400 {
5401 std::string param = userdata.asString();
5402 std::string::size_type offset = param.find(",");
5403 if (offset != param.npos)
5404 {
5405 std::string alert = param.substr(0, offset);
5406 std::string file = param.substr(offset+1);
5407 std::string* file_copy = new std::string(file);
5408 gViewerWindow->alertXml(alert, callback_show_file, file_copy);
5409 }
5410 else
5411 {
5412 llinfos << "PromptShowFile invalid parameters! Expecting \"ALERT,FILE\"." << llendl;
5413 }
5414 return true;
5415 }
5416};
5417
5418class LLShowAgentProfile : public view_listener_t 5367class LLShowAgentProfile : public view_listener_t
5419{ 5368{
5420 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5369 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -6038,10 +5987,10 @@ namespace
6038 5987
6039void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, const std::string& nomodmsg) 5988void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, const std::string& nomodmsg)
6040{ 5989{
6041 // Apply until an object fails
6042 QueueObjects func(q); 5990 QueueObjects func(q);
6043 const bool firstonly = true; 5991 LLSelectMgr *mgr = LLSelectMgr::getInstance();
6044 bool fail = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func, firstonly); 5992 LLObjectSelectionHandle selectHandle = mgr->getSelection();
5993 bool fail = selectHandle->applyToObjects(&func);
6045 if(fail) 5994 if(fail)
6046 { 5995 {
6047 if ( !func.scripted ) 5996 if ( !func.scripted )
@@ -6066,61 +6015,67 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons
6066 } 6015 }
6067} 6016}
6068 6017
6018void handle_compile_queue(std::string to_lang)
6019{
6020 LLFloaterCompileQueue* queue;
6021 if (to_lang == "mono")
6022 {
6023 queue = LLFloaterCompileQueue::create(TRUE);
6024 }
6025 else
6026 {
6027 queue = LLFloaterCompileQueue::create(FALSE);
6028 }
6029 queue_actions(queue, "CannotRecompileSelectObjectsNoScripts", "CannotRecompileSelectObjectsNoPermission");
6030}
6031
6032void handle_reset_selection(void)
6033{
6034 LLFloaterResetQueue* queue = LLFloaterResetQueue::create();
6035 queue_actions(queue, "CannotResetSelectObjectsNoScripts", "CannotResetSelectObjectsNoPermission");
6036}
6037
6038void handle_set_run_selection(void)
6039{
6040 LLFloaterRunQueue* queue = LLFloaterRunQueue::create();
6041 queue_actions(queue, "CannotSetRunningSelectObjectsNoScripts", "CannotSerRunningSelectObjectsNoPermission");
6042}
6043
6044void handle_set_not_run_selection(void)
6045{
6046 LLFloaterNotRunQueue* queue = LLFloaterNotRunQueue::create();
6047 queue_actions(queue, "CannotSetRunningNotSelectObjectsNoScripts", "CannotSerRunningNotSelectObjectsNoPermission");
6048}
6049
6069class LLToolsSelectedScriptAction : public view_listener_t 6050class LLToolsSelectedScriptAction : public view_listener_t
6070{ 6051{
6071 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6052 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6072 { 6053 {
6073 std::string action = userdata.asString(); 6054 std::string action = userdata.asString();
6074 LLFloaterScriptQueue* queue = NULL;
6075 if (action == "compile mono") 6055 if (action == "compile mono")
6076 { 6056 {
6077 queue = LLFloaterCompileQueue::create(TRUE); 6057 handle_compile_queue("mono");
6078 } 6058 }
6079 if (action == "compile lsl") 6059 if (action == "compile lsl")
6080 { 6060 {
6081 queue = LLFloaterCompileQueue::create(FALSE); 6061 handle_compile_queue("lsl");
6082 } 6062 }
6083 else if (action == "reset") 6063 else if (action == "reset")
6084 { 6064 {
6085 queue = LLFloaterResetQueue::create(); 6065 handle_reset_selection();
6086 } 6066 }
6087 else if (action == "start") 6067 else if (action == "start")
6088 { 6068 {
6089 queue = LLFloaterRunQueue::create(); 6069 handle_set_run_selection();
6090 } 6070 }
6091 else if (action == "stop") 6071 else if (action == "stop")
6092 { 6072 {
6093 queue = LLFloaterNotRunQueue::create(); 6073 handle_set_not_run_selection();
6094 }
6095 if (!queue)
6096 {
6097 return true;
6098 } 6074 }
6099
6100 queue_actions(queue, "CannotRecompileSelectObjectsNoScripts", "CannotRecompileSelectObjectsNoPermission");
6101
6102 return true; 6075 return true;
6103 } 6076 }
6104}; 6077};
6105 6078
6106void handle_reset_selection(void*)
6107{
6108 LLFloaterResetQueue* queue = LLFloaterResetQueue::create();
6109 queue_actions(queue, "CannotResetSelectObjectsNoScripts", "CannotResetSelectObjectsNoPermission");
6110}
6111
6112void handle_set_run_selection(void*)
6113{
6114 LLFloaterRunQueue* queue = LLFloaterRunQueue::create();
6115 queue_actions(queue, "CannotSetRunningSelectObjectsNoScripts", "CannotSerRunningSelectObjectsNoPermission");
6116}
6117
6118void handle_set_not_run_selection(void*)
6119{
6120 LLFloaterNotRunQueue* queue = LLFloaterNotRunQueue::create();
6121 queue_actions(queue, "CannotSetRunningNotSelectObjectsNoScripts", "CannotSerRunningNotSelectObjectsNoPermission");
6122}
6123
6124void handle_selected_texture_info(void*) 6079void handle_selected_texture_info(void*)
6125{ 6080{
6126 for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin(); 6081 for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin();
@@ -7139,148 +7094,6 @@ class LLViewCheckHighlightTransparent : public view_listener_t
7139 } 7094 }
7140}; 7095};
7141 7096
7142class LLViewBeaconWidth : public view_listener_t
7143{
7144 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7145 {
7146 std::string width = userdata.asString();
7147 if(width == "1")
7148 {
7149 gSavedSettings.setS32("DebugBeaconLineWidth", 1);
7150 }
7151 else if(width == "4")
7152 {
7153 gSavedSettings.setS32("DebugBeaconLineWidth", 4);
7154 }
7155 else if(width == "16")
7156 {
7157 gSavedSettings.setS32("DebugBeaconLineWidth", 16);
7158 }
7159 else if(width == "32")
7160 {
7161 gSavedSettings.setS32("DebugBeaconLineWidth", 32);
7162 }
7163
7164 return true;
7165 }
7166};
7167
7168
7169class LLViewToggleBeacon : public view_listener_t
7170{
7171 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7172 {
7173 std::string beacon = userdata.asString();
7174 if (beacon == "scriptsbeacon")
7175 {
7176 LLPipeline::toggleRenderScriptedBeacons(NULL);
7177 gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) );
7178 // toggle the other one off if it's on
7179 if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL))
7180 {
7181 LLPipeline::toggleRenderScriptedTouchBeacons(NULL);
7182 gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) );
7183 }
7184 }
7185 else if (beacon == "physicalbeacon")
7186 {
7187 LLPipeline::toggleRenderPhysicalBeacons(NULL);
7188 gSavedSettings.setBOOL( "physicalbeacon", LLPipeline::getRenderPhysicalBeacons(NULL) );
7189 }
7190 else if (beacon == "soundsbeacon")
7191 {
7192 LLPipeline::toggleRenderSoundBeacons(NULL);
7193 gSavedSettings.setBOOL( "soundsbeacon", LLPipeline::getRenderSoundBeacons(NULL) );
7194 }
7195 else if (beacon == "particlesbeacon")
7196 {
7197 LLPipeline::toggleRenderParticleBeacons(NULL);
7198 gSavedSettings.setBOOL( "particlesbeacon", LLPipeline::getRenderParticleBeacons(NULL) );
7199 }
7200 else if (beacon == "scripttouchbeacon")
7201 {
7202 LLPipeline::toggleRenderScriptedTouchBeacons(NULL);
7203 gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) );
7204 // toggle the other one off if it's on
7205 if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL))
7206 {
7207 LLPipeline::toggleRenderScriptedBeacons(NULL);
7208 gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) );
7209 }
7210 }
7211 else if (beacon == "renderbeacons")
7212 {
7213 LLPipeline::toggleRenderBeacons(NULL);
7214 gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) );
7215 // toggle the other one on if it's not
7216 if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL))
7217 {
7218 LLPipeline::toggleRenderHighlights(NULL);
7219 gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) );
7220 }
7221 }
7222 else if (beacon == "renderhighlights")
7223 {
7224 LLPipeline::toggleRenderHighlights(NULL);
7225 gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) );
7226 // toggle the other one on if it's not
7227 if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL))
7228 {
7229 LLPipeline::toggleRenderBeacons(NULL);
7230 gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) );
7231 }
7232 }
7233
7234 return true;
7235 }
7236};
7237
7238class LLViewCheckBeaconEnabled : public view_listener_t
7239{
7240 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7241 {
7242 std::string beacon = userdata["data"].asString();
7243 bool new_value = false;
7244 if (beacon == "scriptsbeacon")
7245 {
7246 new_value = gSavedSettings.getBOOL( "scriptsbeacon");
7247 LLPipeline::setRenderScriptedBeacons(new_value);
7248 }
7249 else if (beacon == "physicalbeacon")
7250 {
7251 new_value = gSavedSettings.getBOOL( "physicalbeacon");
7252 LLPipeline::setRenderPhysicalBeacons(new_value);
7253 }
7254 else if (beacon == "soundsbeacon")
7255 {
7256 new_value = gSavedSettings.getBOOL( "soundsbeacon");
7257 LLPipeline::setRenderSoundBeacons(new_value);
7258 }
7259 else if (beacon == "particlesbeacon")
7260 {
7261 new_value = gSavedSettings.getBOOL( "particlesbeacon");
7262 LLPipeline::setRenderParticleBeacons(new_value);
7263 }
7264 else if (beacon == "scripttouchbeacon")
7265 {
7266 new_value = gSavedSettings.getBOOL( "scripttouchbeacon");
7267 LLPipeline::setRenderScriptedTouchBeacons(new_value);
7268 }
7269 else if (beacon == "renderbeacons")
7270 {
7271 new_value = gSavedSettings.getBOOL( "renderbeacons");
7272 LLPipeline::setRenderBeacons(new_value);
7273 }
7274 else if (beacon == "renderhighlights")
7275 {
7276 new_value = gSavedSettings.getBOOL( "renderhighlights");
7277 LLPipeline::setRenderHighlights(new_value);
7278 }
7279 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7280 return true;
7281 }
7282};
7283
7284class LLViewToggleRenderType : public view_listener_t 7097class LLViewToggleRenderType : public view_listener_t
7285{ 7098{
7286 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7099 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -7622,12 +7435,11 @@ void initialize_menus()
7622 addMenu(new LLViewMouselook(), "View.Mouselook"); 7435 addMenu(new LLViewMouselook(), "View.Mouselook");
7623 addMenu(new LLViewBuildMode(), "View.BuildMode"); 7436 addMenu(new LLViewBuildMode(), "View.BuildMode");
7624 addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam"); 7437 addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam");
7438 addMenu(new LLViewCommunicate(), "View.Communicate");
7625 addMenu(new LLViewResetView(), "View.ResetView"); 7439 addMenu(new LLViewResetView(), "View.ResetView");
7626 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); 7440 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter");
7627 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); 7441 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips");
7628 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); 7442 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent");
7629 addMenu(new LLViewToggleBeacon(), "View.ToggleBeacon");
7630 addMenu(new LLViewBeaconWidth(), "View.BeaconWidth");
7631 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); 7443 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType");
7632 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); 7444 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments");
7633 addMenu(new LLViewZoomOut(), "View.ZoomOut"); 7445 addMenu(new LLViewZoomOut(), "View.ZoomOut");
@@ -7643,7 +7455,6 @@ void initialize_menus()
7643 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam"); 7455 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
7644 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips"); 7456 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips");
7645 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); 7457 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent");
7646 addMenu(new LLViewCheckBeaconEnabled(), "View.CheckBeaconEnabled");
7647 addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); 7458 addMenu(new LLViewCheckRenderType(), "View.CheckRenderType");
7648 addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); 7459 addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments");
7649 7460
@@ -7777,7 +7588,6 @@ void initialize_menus()
7777 // Generic actions 7588 // Generic actions
7778 addMenu(new LLShowFloater(), "ShowFloater"); 7589 addMenu(new LLShowFloater(), "ShowFloater");
7779 addMenu(new LLPromptShowURL(), "PromptShowURL"); 7590 addMenu(new LLPromptShowURL(), "PromptShowURL");
7780 addMenu(new LLPromptShowFile(), "PromptShowFile");
7781 addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); 7591 addMenu(new LLShowAgentProfile(), "ShowAgentProfile");
7782 addMenu(new LLShowAgentGroups(), "ShowAgentGroups"); 7592 addMenu(new LLShowAgentGroups(), "ShowAgentGroups");
7783 addMenu(new LLToggleControl(), "ToggleControl"); 7593 addMenu(new LLToggleControl(), "ToggleControl");