diff options
Diffstat (limited to 'linden/indra/newview/llfloatermap.cpp')
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
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 | } | ||