Some cleanup in KCWindlightInterface

Ansariel 2014-07-19 14:20:57 +02:00
parent b6b44c172c
commit b9d7531ba8
2 changed files with 16 additions and 23 deletions

View File

@ -29,23 +29,20 @@
#include "llagent.h"
#include "llcallingcard.h" // isBuddy
#include "lldaycyclemanager.h"
#include "llparcel.h"
#include "llslurl.h"
#include "llstartup.h"
#include "llstatusbar.h"
#include "llparcel.h"
#include "llviewercontrol.h" // gSavedSettings, gSavedPerAccountSettings
#include "llviewermenu.h" // is_agent_friend
#include "llviewerparcelmgr.h"
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "lldaycyclemanager.h"
#include "llwlparammanager.h"
#include "rlvhandler.h"
#include <boost/regex.hpp>
#include "llslurl.h"
#include "rlvhandler.h"
#include "rlvactions.h"
const F32 PARCEL_WL_CHECK_TIME = 5;
const F32 PARCEL_WL_CHECK_TIME = 5.f;
const S32 PARCEL_WL_MIN_ALT_CHANGE = 3;
KCWindlightInterface::KCWindlightInterface() :
@ -151,7 +148,7 @@ BOOL KCWindlightInterface::tick()
if (parcel)
{
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!LoadFromPacel(parcel) || !mCurrentSettings.has("sky"))
if (!LoadFromParcel(parcel) || !mCurrentSettings.has("sky"))
mEventTimer.stop();
}
@ -224,7 +221,7 @@ void KCWindlightInterface::ApplySkySettings(const LLSD& settings)
void KCWindlightInterface::ApplyWindLightPreset(const std::string& preset)
{
if (rlv_handler_t::isEnabled() && RlvActions::hasBehaviour(RLV_BHVR_SETENV))
if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV))
return;
LLWLParamManager* wlprammgr = LLWLParamManager::getInstance();
@ -246,7 +243,7 @@ void KCWindlightInterface::ApplyWindLightPreset(const std::string& preset)
void KCWindlightInterface::ResetToRegion(bool force)
{
if (rlv_handler_t::isEnabled() && RlvActions::hasBehaviour(RLV_BHVR_SETENV))
if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV))
return;
//TODO: clear per parcel
@ -325,13 +322,13 @@ bool KCWindlightInterface::ChatCommand(std::string message, std::string from_nam
}
#endif
bool KCWindlightInterface::LoadFromPacel(LLParcel *parcel)
bool KCWindlightInterface::LoadFromParcel(LLParcel *parcel)
{
if (!parcel)
return false;
LLSD payload;
if (ParsePacelForWLSettings(parcel->getDesc(), payload))
if (ParseParcelForWLSettings(parcel->getDesc(), payload))
{
const LLUUID owner_id = getOwnerID(parcel);
//basic auth for now
@ -359,7 +356,7 @@ bool KCWindlightInterface::LoadFromPacel(LLParcel *parcel)
return false;
}
bool KCWindlightInterface::ParsePacelForWLSettings(const std::string& desc, LLSD& settings)
bool KCWindlightInterface::ParseParcelForWLSettings(const std::string& desc, LLSD& settings)
{
bool found_settings = false;
try
@ -589,7 +586,7 @@ bool KCWindlightInterface::checkSettings()
static LLCachedControl<bool> sFSWLParcelEnabled(gSavedSettings, "FSWLParcelEnabled");
static LLCachedControl<bool> sUseEnvironmentFromRegionAlways(gSavedSettings, "UseEnvironmentFromRegionAlways");
if (!sFSWLParcelEnabled || !sUseEnvironmentFromRegionAlways ||
(rlv_handler_t::isEnabled() && RlvActions::hasBehaviour(RLV_BHVR_SETENV)))
(rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)))
{
// The setting changed, clear everything
if (!mDisabled)

View File

@ -26,19 +26,15 @@
#ifndef KC_WLINTERFACE_H
#define KC_WLINTERFACE_H
#include "llviewerprecompiledheaders.h"
#include "llsingleton.h"
#include "lleventtimer.h"
#include "llnotifications.h"
#include "lluuid.h"
#include <set>
#include <string>
class LLParcel;
class LLViewerRegion;
class LLEnvironmentSettings;
class KCWindlightInterface : public LLSingleton<KCWindlightInterface>,LLEventTimer
class KCWindlightInterface : public LLSingleton<KCWindlightInterface>, LLEventTimer
{
public:
KCWindlightInterface();
@ -49,8 +45,8 @@ public:
void ApplyWindLightPreset(const std::string& preset);
void ResetToRegion(bool force = false);
//bool ChatCommand(std::string message, std::string from_name, LLUUID source_id, LLUUID owner_id);
bool LoadFromPacel(LLParcel *parcel);
bool ParsePacelForWLSettings(const std::string& desc, LLSD& settings);
bool LoadFromParcel(LLParcel *parcel);
bool ParseParcelForWLSettings(const std::string& desc, LLSD& settings);
void onClickWLStatusButton();
void setTPing(bool value) { mTPing = value; }
bool haveParcelOverride(const LLEnvironmentSettings& new_settings);