diff options
author | Jacek Antonelli | 2009-10-29 03:35:49 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-10-30 00:15:06 -0500 |
commit | 7510d9581320943aa33202c881b544b72ed6f401 (patch) | |
tree | 0d32b353d4053101a65045c34828cc7368c20711 /linden/indra | |
parent | Added PanelRadar class, refactored from LLFloaterMap. (diff) | |
download | meta-impy-7510d9581320943aa33202c881b544b72ed6f401.zip meta-impy-7510d9581320943aa33202c881b544b72ed6f401.tar.gz meta-impy-7510d9581320943aa33202c881b544b72ed6f401.tar.bz2 meta-impy-7510d9581320943aa33202c881b544b72ed6f401.tar.xz |
Added a button that will toggle the minimap radar.
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 48 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.h | 4 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | 6 |
4 files changed, 69 insertions, 0 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 15bb319..e1a6f1f 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -7534,6 +7534,17 @@ | |||
7534 | <key>Value</key> | 7534 | <key>Value</key> |
7535 | <integer>0</integer> | 7535 | <integer>0</integer> |
7536 | </map> | 7536 | </map> |
7537 | <key>ShowMiniMapRadar</key> | ||
7538 | <map> | ||
7539 | <key>Comment</key> | ||
7540 | <string>Reveal the minimap radar</string> | ||
7541 | <key>Persist</key> | ||
7542 | <integer>1</integer> | ||
7543 | <key>Type</key> | ||
7544 | <string>Boolean</string> | ||
7545 | <key>Value</key> | ||
7546 | <integer>1</integer> | ||
7547 | </map> | ||
7537 | <key>ShowMovementControls</key> | 7548 | <key>ShowMovementControls</key> |
7538 | <map> | 7549 | <map> |
7539 | <key>Comment</key> | 7550 | <key>Comment</key> |
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index b9dc80e..5aed515 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp | |||
@@ -82,6 +82,8 @@ BOOL LLFloaterMap::postBuild() | |||
82 | sendChildToFront(getChild<LLButton>("llfloater_minimize_btn")); | 82 | sendChildToFront(getChild<LLButton>("llfloater_minimize_btn")); |
83 | sendChildToFront(getChild<LLButton>("llfloater_close_btn")); | 83 | sendChildToFront(getChild<LLButton>("llfloater_close_btn")); |
84 | setIsChrome(TRUE); | 84 | setIsChrome(TRUE); |
85 | |||
86 | childSetAction("toggle_radar", onToggleRadar, this); | ||
85 | 87 | ||
86 | return TRUE; | 88 | return TRUE; |
87 | } | 89 | } |
@@ -98,6 +100,9 @@ void LLFloaterMap::onOpen() | |||
98 | gFloaterView->adjustToFitScreen(this, FALSE); | 100 | gFloaterView->adjustToFitScreen(this, FALSE); |
99 | 101 | ||
100 | gSavedSettings.setBOOL("ShowMiniMap", TRUE); | 102 | gSavedSettings.setBOOL("ShowMiniMap", TRUE); |
103 | |||
104 | bool showing_radar = gSavedSettings.getBOOL("ShowMiniMapRadar"); | ||
105 | setRadarVisible( showing_radar ); | ||
101 | } | 106 | } |
102 | 107 | ||
103 | 108 | ||
@@ -154,3 +159,46 @@ PanelRadar* LLFloaterMap::getRadar() | |||
154 | { | 159 | { |
155 | return mPanelRadar; | 160 | return mPanelRadar; |
156 | } | 161 | } |
162 | |||
163 | |||
164 | // static | ||
165 | void LLFloaterMap::onToggleRadar(void *user_data) | ||
166 | { | ||
167 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
168 | self->toggleRadarVisible(); | ||
169 | } | ||
170 | |||
171 | |||
172 | void LLFloaterMap::toggleRadarVisible() | ||
173 | { | ||
174 | bool show_radar = gSavedSettings.getBOOL("ShowMiniMapRadar"); | ||
175 | show_radar = !show_radar; | ||
176 | setRadarVisible( show_radar ); | ||
177 | } | ||
178 | |||
179 | |||
180 | void LLFloaterMap::setRadarVisible( bool show_radar ) | ||
181 | { | ||
182 | gSavedSettings.setBOOL("ShowMiniMapRadar", show_radar); | ||
183 | setRadarButtonState( show_radar ); | ||
184 | } | ||
185 | |||
186 | |||
187 | void LLFloaterMap::setRadarButtonState( bool showing_radar ) | ||
188 | { | ||
189 | LLButton* toggle = getChild<LLButton>("toggle_radar"); | ||
190 | if (toggle) | ||
191 | { | ||
192 | toggle->setToggleState(showing_radar); | ||
193 | if (showing_radar) | ||
194 | { | ||
195 | // Expanded, so show image to offer to collapse upwards. | ||
196 | toggle->setImageOverlay("arrow_up.tga"); | ||
197 | } | ||
198 | else | ||
199 | { | ||
200 | // Collapsed, so show image to offer to expand downwards. | ||
201 | toggle->setImageOverlay("arrow_down.tga"); | ||
202 | } | ||
203 | } | ||
204 | } | ||
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h index 7cde970..7937836 100644 --- a/linden/indra/newview/llfloatermap.h +++ b/linden/indra/newview/llfloatermap.h | |||
@@ -67,6 +67,10 @@ private: | |||
67 | LLNetMap* mPanelMap; | 67 | LLNetMap* mPanelMap; |
68 | PanelRadar* mPanelRadar; | 68 | PanelRadar* mPanelRadar; |
69 | 69 | ||
70 | static void onToggleRadar(void *user_data); | ||
71 | void toggleRadarVisible(); | ||
72 | void setRadarVisible( bool show_radar ); | ||
73 | void setRadarButtonState(bool showing_radar); | ||
70 | }; | 74 | }; |
71 | 75 | ||
72 | #endif // LL_LLFLOATERMAP_H | 76 | #endif // LL_LLFLOATERMAP_H |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml index b24004b..8dfd43c 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | |||
@@ -15,4 +15,10 @@ | |||
15 | left="2" top="196" right="196" height="120" | 15 | left="2" top="196" right="196" height="120" |
16 | follows="left|right|bottom" /> | 16 | follows="left|right|bottom" /> |
17 | 17 | ||
18 | <button name="toggle_radar" label="" | ||
19 | bottom="202" left="10" height="18" width="18" | ||
20 | follows="left|bottom" halign="center" | ||
21 | font="SansSerif" scale_image="true" | ||
22 | tool_tip="Show or hide the radar" /> | ||
23 | |||
18 | </floater> | 24 | </floater> |