aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt8
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llfloatermap.cpp48
-rw-r--r--linden/indra/newview/llfloatermap.h4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml6
5 files changed, 77 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 3bee18d..17baabc 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,5 +1,13 @@
12009-10-29 Jacek Antonelli <jacek.antonelli@gmail.com> 12009-10-29 Jacek Antonelli <jacek.antonelli@gmail.com>
2 2
3 * Added a button that will toggle the minimap radar.
4
5 modified: app_settings/settings.xml
6 modified: llfloatermap.cpp
7 modified: llfloatermap.h
8 modified: skins/default/xui/en-us/floater_mini_map.xml
9
10
3 * Added PanelRadar class, refactored from LLFloaterMap. 11 * Added PanelRadar class, refactored from LLFloaterMap.
4 12
5 modified: linden/indra/newview/CMakeLists.txt 13 modified: linden/indra/newview/CMakeLists.txt
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
165void LLFloaterMap::onToggleRadar(void *user_data)
166{
167 LLFloaterMap* self = (LLFloaterMap*) user_data;
168 self->toggleRadarVisible();
169}
170
171
172void LLFloaterMap::toggleRadarVisible()
173{
174 bool show_radar = gSavedSettings.getBOOL("ShowMiniMapRadar");
175 show_radar = !show_radar;
176 setRadarVisible( show_radar );
177}
178
179
180void LLFloaterMap::setRadarVisible( bool show_radar )
181{
182 gSavedSettings.setBOOL("ShowMiniMapRadar", show_radar);
183 setRadarButtonState( show_radar );
184}
185
186
187void 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>