diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-02-12 12:34:41 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-02-12 12:34:41 +0200 |
commit | 7e291bb4689c45d6f470d2a1958339728c52d8ce (patch) | |
tree | 8344ceaf346db3938ef2a3f12c892db8b9383ef8 /indra | |
parent | 52fe6676716daab90b00f4d3696b081608f07f6c (diff) |
MAINT-3465 FIXED Add check mark to selected entry.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 40 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_viewer.xml | 45 |
2 files changed, 70 insertions, 15 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c7c8da27f3..59e98fc882 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8235,6 +8235,45 @@ class LLWorldEnvSettings : public view_listener_t } }; +class LLWorldEnableEnvSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool result = false; + std::string tod = userdata.asString(); + + if (tod == "region") + { + return LLEnvManagerNew::instance().getUseRegionSettings(); + } + + if (LLEnvManagerNew::instance().getUseFixedSky()) + { + if (tod == "sunrise") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunrise"); + } + else if (tod == "noon") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midday"); + } + else if (tod == "sunset") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunset"); + } + else if (tod == "midnight") + { + result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midnight"); + } + else + { + llwarns << "Unknown item" << llendl; + } + } + return result; + } +}; + class LLWorldEnvPreset : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8573,6 +8612,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); + view_listener_t::addMenu(new LLWorldEnableEnvSettings(), "World.EnableEnvSettings"); view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 636096f54b..d91b4243b2 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -606,44 +606,59 @@ label="Sun" name="Sun" tear_off="true"> - <menu_item_call + <menu_item_check label="Sunrise" name="Sunrise"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="sunrise" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="sunrise" /> + </menu_item_check> + <menu_item_check label="Midday" name="Noon" shortcut="control|shift|Y"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="noon" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="noon" /> + </menu_item_check> + <menu_item_check label="Sunset" name="Sunset" shortcut="control|shift|N"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="sunset" /> - </menu_item_call> - <menu_item_call + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="sunset" /> + </menu_item_check> + <menu_item_check label="Midnight" name="Midnight"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="midnight" /> - </menu_item_call> + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="midnight" /> + </menu_item_check> <menu_item_separator/> - <menu_item_call + <menu_item_check label="Use Region Settings" name="Use Region Settings"> - <menu_item_call.on_click + <menu_item_check.on_click function="World.EnvSettings" parameter="region" /> - </menu_item_call> + <menu_item_check.on_check + function="World.EnableEnvSettings" + parameter="region" /> + </menu_item_check> </menu> |