XMLize the "Singularity" menu and add Rebake and Region Debug Console to it.

This commit is contained in:
Melanie
2013-05-01 00:23:10 +02:00
parent e1df1b98f7
commit ec266b895e
8 changed files with 328 additions and 85 deletions

View File

@@ -144,6 +144,14 @@ void JCFloaterAreaSearch::toggle()
}
}
// static
BOOL JCFloaterAreaSearch::visible()
{
if (sInstance)
return sInstance->getVisible();
return FALSE;
}
// static
void JCFloaterAreaSearch::onDoubleClick(void *userdata)
{

View File

@@ -60,6 +60,7 @@ public:
static void results();
static void toggle();
static BOOL visible();
static JCFloaterAreaSearch* getInstance() { return sInstance; }
static void processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data);

View File

@@ -43,6 +43,25 @@ void LLFloaterBlacklist::show()
sInstance->open();
}
}
// static
void LLFloaterBlacklist::toggle()
{
if (sInstance && sInstance->getVisible())
{
delete sInstance;
}
else
{
show();
}
}
// static
BOOL LLFloaterBlacklist::visible()
{
if (sInstance && sInstance->getVisible())
return TRUE;
return FALSE;
}
BOOL LLFloaterBlacklist::postBuild()
{
childSetAction("add_btn", onClickAdd, this);

View File

@@ -11,6 +11,8 @@ public:
LLFloaterBlacklist();
~LLFloaterBlacklist();
static void show();
static void toggle();
static BOOL visible();
BOOL postBuild();
void refresh();
static LLFloaterBlacklist* getInstance() { return sInstance; };

View File

@@ -68,6 +68,13 @@ void LLFloaterExploreSounds::toggle()
else LLFloaterExploreSounds::sInstance = new LLFloaterExploreSounds();
}
BOOL LLFloaterExploreSounds::visible()
{
if (LLFloaterExploreSounds::sInstance)
return TRUE;
return FALSE;
}
void LLFloaterExploreSounds::close(bool app_quitting)
{
LLFloater::close(app_quitting);

View File

@@ -36,6 +36,7 @@ public:
static LLFloaterExploreSounds* sInstance;
static void toggle();
static BOOL visible();
};
#endif

View File

@@ -358,7 +358,6 @@ void handle_singleton_toggle(void *)
// <edit>
void handle_fake_away_status(void*);
void handle_area_search(void*);
// <dogmode> for pose stand
LLUUID current_pose = LLUUID::null;
@@ -404,13 +403,8 @@ BOOL handle_check_pose(void* userdata) {
}
void handle_force_ground_sit(void*);
void handle_hide_typing_notification(void*);
void handle_close_all_notifications(void*);
void handle_open_message_log(void*);
void handle_edit_ao(void*);
void handle_sounds_explorer(void*);
void handle_blacklist(void*);
// </edit>
void handle_reset_view();
@@ -706,32 +700,6 @@ void init_menus()
// TomY TODO convert these two
LLMenuGL*menu;
menu = new LLMenuGL("Singularity");
menu->setCanTearOff(TRUE);
menu->addChild(new LLMenuItemCallGL( "Close All Dialogs",
&handle_close_all_notifications, NULL, NULL, 'D', MASK_CONTROL | MASK_ALT | MASK_SHIFT));
menu->addSeparator();
menu->addChild(new LLMenuItemCallGL( "Fake Away Status", &handle_fake_away_status, NULL));
menu->addChild(new LLMenuItemCallGL( "Force Ground Sit", &handle_force_ground_sit, NULL));
menu->addSeparator();
menu->addChild(new LLMenuItemCallGL( "Animation Override...",
&handle_edit_ao, NULL));
menu->addChild(new LLMenuItemCheckGL( "Nimble",
&menu_toggle_control,
NULL,
&menu_check_control,
(void*)"Nimble"));
menu->addSeparator();
menu->addChild(new LLMenuItemCallGL( "Object Area Search", &handle_area_search, NULL));
menu->addChild(new LLMenuItemCallGL( "Sound Explorer",
&handle_sounds_explorer, NULL));
menu->addChild(new LLMenuItemCallGL( "Asset Blacklist",
&handle_blacklist, NULL));
menu->addChild(new LLMenuItemCheckGL( "Streaming Audio Display",
&handle_ticker_toggle, &handle_ticker_enabled, &handle_singleton_check<SHFloaterMediaTicker>, NULL ));
// <dogmode>
// Add in the pose stand -------------------------------------------
/*LLMenuGL* sub = new LLMenuGL("Pose Stand...");
@@ -746,12 +714,6 @@ void init_menus()
sub->addChild(new LLMenuItemCallGL( "Stop Pose Stand", &handle_pose_stand_stop, NULL));
// </dogmode> ------------------------------------------------------*/
menu->addChild(new LLMenuItemCheckGL("Pose Stand",&handle_toggle_pose, NULL, &handle_check_pose, NULL));
//these should always be last in a sub menu
menu->createJumpKeys();
gMenuBarView->addChild( menu );
menu = new LLMenuGL(CLIENT_MENU_NAME);
menu->setCanTearOff(TRUE);
init_client_menu(menu);
@@ -1588,7 +1550,7 @@ void init_debug_avatar_menu(LLMenuGL* menu)
(void*)LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES));
menu->addChild(new LLMenuItemToggleGL( "Debug Rotation", &LLVOAvatar::sDebugAvatarRotation));
menu->addChild(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments));
menu->addChild(new LLMenuItemCallGL("Rebake Textures", handle_rebake_textures, NULL, NULL, 'R', MASK_ALT | MASK_CONTROL ));
menu->addChild(new LLMenuItemCallGL("Rebake Textures", handle_rebake_textures));
#ifndef LL_RELEASE_FOR_DOWNLOAD
menu->addChild(new LLMenuItemCallGL("Debug Avatar Textures", handle_debug_avatar_textures, NULL, NULL, 'A', MASK_SHIFT|MASK_CONTROL|MASK_ALT));
menu->addChild(new LLMenuItemCallGL("Dump Local Textures", handle_dump_avatar_local_textures, NULL, NULL, 'M', MASK_SHIFT|MASK_ALT ));
@@ -3739,37 +3701,6 @@ void handle_open_message_log(void*)
LLFloaterMessageLog::show();
}
void handle_edit_ao(void*)
{
LLFloaterAO::show(NULL);
}
void handle_sounds_explorer(void*)
{
LLFloaterExploreSounds::toggle();
}
void handle_blacklist(void*)
{
LLFloaterBlacklist::show();
}
void handle_close_all_notifications(void*)
{
LLView::child_list_t child_list(*(gNotifyBoxView->getChildList()));
for(LLView::child_list_iter_t iter = child_list.begin();
iter != child_list.end();
iter++)
{
gNotifyBoxView->removeChild(*iter);
}
}
void handle_area_search(void*)
{
JCFloaterAreaSearch::toggle();
}
void handle_fake_away_status(void*)
{
bool fake_away = gSavedSettings.getBOOL("FakeAway");
@@ -3777,21 +3708,6 @@ void handle_fake_away_status(void*)
gSavedSettings.setBOOL("FakeAway", !fake_away);
}
void handle_force_ground_sit(void*)
{
if (isAgentAvatarValid())
{
if (!gAgentAvatarp->isSitting())
{
gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
}
}
}
// </edit>
/*
@@ -6704,6 +6620,18 @@ class LLFloaterVisible : public view_listener_t
{
new_value = LLFloaterPathfindingCharacters::instanceVisible(LLSD());
}
else if (floater_name == "object_area_search")
{
new_value = JCFloaterAreaSearch::visible();
}
else if (floater_name == "sound_explorer")
{
new_value = LLFloaterExploreSounds::visible();
}
else if (floater_name == "asset_blacklist")
{
new_value = LLFloaterBlacklist::visible();
}
gMenuHolder->findControl(control_name)->setValue(new_value);
return true;
}
@@ -9269,6 +9197,192 @@ class LLWorldDayCycle : public view_listener_t
}
};
class SinguCloseAllDialogs : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLView::child_list_t child_list(*(gNotifyBoxView->getChildList()));
for(LLView::child_list_iter_t iter = child_list.begin();
iter != child_list.end();
iter++)
{
gNotifyBoxView->removeChild(*iter);
}
return true;
}
};
class SinguForceGroundSit : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
if (isAgentAvatarValid())
{
if (!gAgentAvatarp->isSitting())
{
gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
}
}
return true;
}
};
class SinguAnimationOverride : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterAO::show(NULL);
return true;
}
};
class SinguNimble : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL checked = gSavedSettings.getBOOL("Nimble");
gSavedSettings.setBOOL("Nimble", !checked);
return true;
}
};
class SinguCheckNimble : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL checked = gSavedSettings.getBOOL("Nimble");
gMenuHolder->findControl(userdata["control"].asString())->setValue(checked);
return true;
}
};
class SinguObjectAreaSearch : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
JCFloaterAreaSearch::toggle();
return true;
}
};
class SinguSoundExplorer : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterExploreSounds::toggle();
return true;
}
};
class SinguAssetBlacklist : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterBlacklist::toggle();
return true;
}
};
class SinguStreamingAudioDisplay : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
handle_ticker_toggle(NULL);
return true;
}
};
class SinguCheckStreamingAudioDisplay : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool checked = handle_singleton_check<SHFloaterMediaTicker>(NULL);
gMenuHolder->findControl(userdata["control"].asString())->setValue(checked);
return true;
}
};
class SinguEnableStreamingAudioDisplay : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
return handle_ticker_enabled(NULL);
}
};
class SinguPoseStand : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
handle_toggle_pose(NULL);
return true;
}
};
class SinguCheckPoseStand : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool checked = handle_check_pose(NULL);
gMenuHolder->findControl(userdata["control"].asString())->setValue(checked);
return true;
}
};
class SinguRebake : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
handle_rebake_textures(NULL);
return true;
}
};
class SinguDebugConsole : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
handle_singleton_toggle<LLFloaterRegionDebugConsole>(NULL);
return true;
}
};
class SinguCheckDebugConsole : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool checked = handle_singleton_check<LLFloaterRegionDebugConsole>(NULL);
gMenuHolder->findControl(userdata["control"].asString())->setValue(checked);
return true;
}
};
class SinguVisibleDebugConsole : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool visible = !(gAgent.getRegion()->getCapability("SimConsoleAsync").empty());
LLView* item = gMenuBarView->getChildView("Region Debug Console", true, false);
item->setVisible(visible);
return true;
}
};
void addMenu(view_listener_t *menu, const std::string& name)
{
sMenus.push_back(menu);
@@ -9544,6 +9658,26 @@ void initialize_menus()
addMenu(new LLEditableSelected(), "EditableSelected");
addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
// Singularity menu
addMenu(new SinguCloseAllDialogs(), "CloseAllDialogs");
// ---- Fake away handled elsewhere
addMenu(new SinguForceGroundSit(), "ForceGroundSit");
addMenu(new SinguAnimationOverride(), "AnimationOverride");
addMenu(new SinguNimble(), "Nimble");
addMenu(new SinguCheckNimble(), "CheckNimble");
addMenu(new SinguObjectAreaSearch(), "ObjectAreaSearch");
addMenu(new SinguSoundExplorer(), "SoundExplorer");
addMenu(new SinguAssetBlacklist(), "AssetBlacklist");
addMenu(new SinguStreamingAudioDisplay(), "StreamingAudioDisplay");
addMenu(new SinguEnableStreamingAudioDisplay(), "EnableStreamingAudioDisplay");
addMenu(new SinguCheckStreamingAudioDisplay(), "CheckStreamingAudioDisplay");
addMenu(new SinguPoseStand(), "PoseStand");
addMenu(new SinguCheckPoseStand(), "CheckPoseStand");
addMenu(new SinguRebake(), "Rebake");
addMenu(new SinguDebugConsole(), "RegionDebugConsole");
addMenu(new SinguCheckDebugConsole(), "CheckRegionDebugConsole");
addMenu(new SinguVisibleDebugConsole(), "VisibleRegionDebugConsole");
// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | OK
if (rlv_handler_t::isEnabled())
{

View File

@@ -979,4 +979,75 @@
<on_click function="ShowFloater" userdata="about" />
</menu_item_call>
</menu>
<menu create_jump_keys="true" drop_shadow="true" enabled="true"
label="Singularity" mouse_opaque="false" name="Singularity"
opaque="true" tear_off="true">
<menu_item_call enabled="true" label="Close All Dialogs"
mouse_opaque="true" name="Close All Dialogs"
shortcut="control|alt|shift|D">
<on_click function="CloseAllDialogs" userdata="" />
</menu_item_call>
<menu_item_separator enabled="true" label="-----------"
mouse_opaque="true" name="separators1" />
<menu_item_call enabled="true" label="Fake Away Status"
mouse_opaque="true" name="Fake Away Status">
<on_click function="World.FakeAway" userdata="" />
</menu_item_call>
<menu_item_call enabled="true" label="Force Ground Sit"
mouse_opaque="true" name="Force Ground Sit">
<on_click function="ForceGroundSit" userdata="" />
</menu_item_call>
<menu_item_separator enabled="true" label="-----------"
mouse_opaque="true" name="separators2" />
<menu_item_call enabled="true" label="Animation Override ..."
mouse_opaque="true" name="Animation Override ...">
<on_click function="AnimationOverride" userdata="" />
</menu_item_call>
<menu_item_check enabled="true" label="Nimble"
mouse_opaque="true" name="Nimble">
<on_click function="Nimble" userdata="" />
<on_check function="CheckNimble" userdata="" />
</menu_item_check>
<menu_item_separator enabled="true" label="-----------"
mouse_opaque="true" name="separators3" />
<menu_item_check enabled="true" label="Object Area Search"
mouse_opaque="true" name="Object Area Search">
<on_click function="ObjectAreaSearch" userdata="" />
<on_check function="FloaterVisible" userdata="object_area_search" />
</menu_item_check>
<menu_item_check enabled="true" label="Sound Explorer"
mouse_opaque="true" name="Sound Explorer">
<on_click function="SoundExplorer" userdata="" />
<on_check function="FloaterVisible" userdata="sound_explorer" />
</menu_item_check>
<menu_item_check enabled="true" label="Asset Blacklist"
mouse_opaque="true" name="Asset Blacklist">
<on_click function="AssetBlacklist" userdata="" />
<on_check function="FloaterVisible" userdata="asset_blacklist" />
</menu_item_check>
<menu_item_check enabled="true" label="Streaming Audio Display"
mouse_opaque="true" name="Streaming Audio Display">
<on_click function="StreamingAudioDisplay" userdata="" />
<on_check function="CheckStreamingAudioDisplay" userdata="" />
<on_enable function="EnableStreamingAudioDisplay" />
</menu_item_check>
<menu_item_check enabled="true" label="Pose Stand"
mouse_opaque="true" name="Pose Stand">
<on_click function="PoseStand" userdata="" />
<on_check function="CheckPoseStand" userdata="" />
</menu_item_check>
<menu_item_check enabled="true" label="Region Debug Console"
mouse_opaque="true" name="Region Debug Console">
<on_click function="RegionDebugConsole" userdata="" />
<on_check function="CheckRegionDebugConsole" userdata="" />
<on_visible function="VisibleRegionDebugConsole" userdata="" />
</menu_item_check>
<menu_item_separator enabled="true" label="-----------"
mouse_opaque="true" name="separators3" />
<menu_item_call enabled="true" label="Rebake"
mouse_opaque="true" name="Pose Stand"
shortcut="control|alt|R">
<on_click function="Rebake" userdata="" />
</menu_item_call>
</menu>
</menu_bar>