diff options
author | McCabe Maxsted | 2010-03-30 23:39:25 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-03-30 23:39:25 -0700 |
commit | 7e458d1989ea06d06c64db4732619e03b59cf223 (patch) | |
tree | 2b4fc86591d3834baaea146d0b88b843d95ed9a2 /linden | |
parent | Ported clientside AO from Emerald r1633 (diff) | |
download | meta-impy-7e458d1989ea06d06c64db4732619e03b59cf223.zip meta-impy-7e458d1989ea06d06c64db4732619e03b59cf223.tar.gz meta-impy-7e458d1989ea06d06c64db4732619e03b59cf223.tar.bz2 meta-impy-7e458d1989ea06d06c64db4732619e03b59cf223.tar.xz |
Made the AO toggle and work like an actual menu check
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/floaterao.cpp | 22 | ||||
-rw-r--r-- | linden/indra/newview/floaterao.h | 2 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 15 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 3 |
4 files changed, 35 insertions, 7 deletions
diff --git a/linden/indra/newview/floaterao.cpp b/linden/indra/newview/floaterao.cpp index e3083d3..d8844d8 100644 --- a/linden/indra/newview/floaterao.cpp +++ b/linden/indra/newview/floaterao.cpp | |||
@@ -249,11 +249,25 @@ LLFloaterAO::~LLFloaterAO() | |||
249 | void LLFloaterAO::show(void*) | 249 | void LLFloaterAO::show(void*) |
250 | { | 250 | { |
251 | if (!sInstance) | 251 | if (!sInstance) |
252 | sInstance = new LLFloaterAO(); | 252 | { |
253 | updateLayout(sInstance); | 253 | sInstance = new LLFloaterAO(); |
254 | init(); | 254 | updateLayout(sInstance); |
255 | init(); | ||
256 | |||
257 | sInstance->open(); | ||
258 | } | ||
259 | else | ||
260 | { | ||
261 | sInstance->close(); | ||
262 | } | ||
263 | } | ||
255 | 264 | ||
256 | sInstance->open(); | 265 | bool LLFloaterAO::getInstance() |
266 | { | ||
267 | if (sInstance) | ||
268 | return true; | ||
269 | else | ||
270 | return false; | ||
257 | } | 271 | } |
258 | 272 | ||
259 | BOOL LLFloaterAO::postBuild() | 273 | BOOL LLFloaterAO::postBuild() |
diff --git a/linden/indra/newview/floaterao.h b/linden/indra/newview/floaterao.h index 3ab06e0..6b356cd 100644 --- a/linden/indra/newview/floaterao.h +++ b/linden/indra/newview/floaterao.h | |||
@@ -103,6 +103,8 @@ public: | |||
103 | 103 | ||
104 | static LLUUID invfolderid; | 104 | static LLUUID invfolderid; |
105 | static const LLUUID& getAssetIDByName(const std::string& name); | 105 | static const LLUUID& getAssetIDByName(const std::string& name); |
106 | |||
107 | static bool getInstance(); | ||
106 | 108 | ||
107 | private: | 109 | private: |
108 | 110 | ||
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 7a2cddf..7697f77 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -8598,7 +8598,7 @@ class LLAdvancedTogglePhantom: public view_listener_t | |||
8598 | }; | 8598 | }; |
8599 | 8599 | ||
8600 | 8600 | ||
8601 | class LLAO : public view_listener_t | 8601 | class LLViewToggleAO : public view_listener_t |
8602 | { | 8602 | { |
8603 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8603 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8604 | { | 8604 | { |
@@ -8607,6 +8607,16 @@ class LLAO : public view_listener_t | |||
8607 | } | 8607 | } |
8608 | }; | 8608 | }; |
8609 | 8609 | ||
8610 | class LLViewCheckAO: public view_listener_t | ||
8611 | { | ||
8612 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
8613 | { | ||
8614 | gMenuHolder->findControl(userdata["control"].asString())->setValue(LLFloaterAO::getInstance()); | ||
8615 | return true; | ||
8616 | } | ||
8617 | }; | ||
8618 | |||
8619 | |||
8610 | class LLAdvancedCheckPhantom: public view_listener_t | 8620 | class LLAdvancedCheckPhantom: public view_listener_t |
8611 | { | 8621 | { |
8612 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8622 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -10731,6 +10741,7 @@ void initialize_menus() | |||
10731 | addMenu(new LLZoomer(1/1.2f), "View.ZoomIn"); | 10741 | addMenu(new LLZoomer(1/1.2f), "View.ZoomIn"); |
10732 | addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault"); | 10742 | addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault"); |
10733 | addMenu(new LLViewFullscreen(), "View.Fullscreen"); | 10743 | addMenu(new LLViewFullscreen(), "View.Fullscreen"); |
10744 | addMenu(new LLViewToggleAO(), "View.ToggleAO"); | ||
10734 | addMenu(new LLViewToggleAdvanced(), "View.ToggleAdvanced"); | 10745 | addMenu(new LLViewToggleAdvanced(), "View.ToggleAdvanced"); |
10735 | 10746 | ||
10736 | addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); | 10747 | addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); |
@@ -10743,7 +10754,7 @@ void initialize_menus() | |||
10743 | addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); | 10754 | addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); |
10744 | addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); | 10755 | addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); |
10745 | addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); | 10756 | addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); |
10746 | addMenu(new LLAO(), "View.AO"); | 10757 | addMenu(new LLViewCheckAO(), "View.CheckAO"); |
10747 | addMenu(new LLViewCheckAdvanced(), "View.CheckAdvanced"); | 10758 | addMenu(new LLViewCheckAdvanced(), "View.CheckAdvanced"); |
10748 | 10759 | ||
10749 | // World menu | 10760 | // World menu |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 8f213c8..242cc8f 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | |||
@@ -348,7 +348,8 @@ | |||
348 | <menu_item_separator /> | 348 | <menu_item_separator /> |
349 | <menu_item_check label="AO" name="AO" | 349 | <menu_item_check label="AO" name="AO" |
350 | shortcut="control|shift|O"> | 350 | shortcut="control|shift|O"> |
351 | <on_click function="View.AO" userdata="" /> | 351 | <on_click function="View.ToggleAO" userdata="" /> |
352 | <on_check function="View.CheckAO" /> | ||
352 | </menu_item_check> | 353 | </menu_item_check> |
353 | <menu_item_separator /> | 354 | <menu_item_separator /> |
354 | <menu_item_check name="Statistics Bar" label="Statistics Bar" | 355 | <menu_item_check name="Statistics Bar" label="Statistics Bar" |