From b1afaa8f9702876c2ea1d677c931bc1468860200 Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Fri, 20 Aug 2010 20:04:27 -0700
Subject: Updated artwork package to include latest windows installer (and
added a little easter egg while I was there ;)
---
linden/indra/newview/llgesturemgr.cpp | 25 ++++++++++++++++-
linden/indra/newview/llpreviewtexture.cpp | 45 ++++++++++++++++++++++++++++---
linden/indra/newview/llpreviewtexture.h | 1 +
linden/install.xml | 16 +++++------
4 files changed, 74 insertions(+), 13 deletions(-)
(limited to 'linden')
diff --git a/linden/indra/newview/llgesturemgr.cpp b/linden/indra/newview/llgesturemgr.cpp
index a341154..d344630 100644
--- a/linden/indra/newview/llgesturemgr.cpp
+++ b/linden/indra/newview/llgesturemgr.cpp
@@ -55,8 +55,10 @@
#include "llfloaterchat.h"
#include "llinventorymodel.h"
#include "llnotify.h"
+#include "llpreviewtexture.h"
#include "llviewermessage.h"
#include "llvoavatar.h"
+#include "llviewerimagelist.h"
#include "llviewerstats.h"
LLGestureManager gGestureManager;
@@ -561,7 +563,28 @@ BOOL LLGestureManager::triggerAndReviseString(const std::string &utf8str, std::s
found_gestures = TRUE;
}
}
- else if (LLStringUtil::compareInsensitive("/icanhascookie", cur_token) == 0)
+ else if (LLStringUtil::compareInsensitive("/icanhaseasteregg", cur_token) == 0 ||
+ LLStringUtil::compareInsensitive("/icanhaseastereggs", cur_token) == 0)
+ {
+ LLViewerImage* kitteh = gImageList.getImageFromFile("easteregg.png", TRUE, TRUE);
+ if (kitteh)
+ {
+ S32 left, top;
+ gFloaterView->getNewFloaterPosition(&left, &top);
+ LLRect rect = gSavedSettings.getRect("PreviewTextureRect");
+ rect.translate(left - rect.mLeft, top - rect.mTop);
+
+ LLPreviewTexture* preview;
+ preview = new LLPreviewTexture(rect, "Easter Egg!", kitteh);
+ preview->setSourceID(LLUUID::generateNewID());
+ preview->setFocus(TRUE);
+ preview->center();
+ gFloaterView->adjustToFitScreen(preview, FALSE);
+ }
+ return TRUE;
+ }
+ else if (LLStringUtil::compareInsensitive("/icanhascookie", cur_token) == 0 ||
+ LLStringUtil::compareInsensitive("/icanhascookies", cur_token) == 0)
{
LLChat chat;
chat.mText = "I made you a cookie but I eated it";
diff --git a/linden/indra/newview/llpreviewtexture.cpp b/linden/indra/newview/llpreviewtexture.cpp
index 381cb58..822b4d0 100644
--- a/linden/indra/newview/llpreviewtexture.cpp
+++ b/linden/indra/newview/llpreviewtexture.cpp
@@ -64,6 +64,7 @@ LLPreviewTexture::LLPreviewTexture(const std::string& name,
const LLUUID& object_id,
BOOL show_keep_discard)
: LLPreview(name, rect, title, item_uuid, object_id, TRUE, PREVIEW_TEXTURE_MIN_WIDTH, PREVIEW_TEXTURE_MIN_HEIGHT ),
+ mImage(NULL),
mLoadingFullImage( FALSE ),
mShowKeepDiscard(show_keep_discard),
mCopyToInv(FALSE),
@@ -125,6 +126,7 @@ LLPreviewTexture::LLPreviewTexture(
PREVIEW_TEXTURE_MIN_WIDTH,
PREVIEW_TEXTURE_MIN_HEIGHT ),
mImageID(asset_id),
+ mImage(NULL),
mLoadingFullImage( FALSE ),
mShowKeepDiscard(FALSE),
mCopyToInv(copy_to_inv),
@@ -142,6 +144,38 @@ LLPreviewTexture::LLPreviewTexture(
}
+// ctor for just previewing images
+LLPreviewTexture::LLPreviewTexture(const LLRect& rect, const std::string& title, LLViewerImage* imagep)
+ :
+ LLPreview(
+ "preview texture",
+ rect,
+ title,
+ LLUUID::null,
+ LLUUID::null,
+ FALSE,
+ PREVIEW_TEXTURE_MIN_WIDTH,
+ PREVIEW_TEXTURE_MIN_HEIGHT ),
+ mImageID(LLUUID::null),
+ mImage(imagep),
+ mLoadingFullImage( FALSE ),
+ mShowKeepDiscard(FALSE),
+ mCopyToInv(false),
+ mIsCopyable(TRUE),
+ mLastHeight(0),
+ mLastWidth(0)
+{
+
+ init();
+
+ setTitle(title);
+
+ LLRect curRect = getRect();
+ translate(curRect.mLeft - rect.mLeft, curRect.mTop - rect.mTop);
+
+}
+
+
LLPreviewTexture::~LLPreviewTexture()
{
@@ -159,9 +193,7 @@ LLPreviewTexture::~LLPreviewTexture()
void LLPreviewTexture::init()
-{
-
-
+{
if (mCopyToInv)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_embedded_texture.xml");
@@ -496,7 +528,12 @@ void LLPreviewTexture::updateDimensions()
void LLPreviewTexture::loadAsset()
{
- mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE);
+ // Rather kludgy, I admit -- MC
+ if (mImageID.notNull() && !mImage)
+ {
+ mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE);
+ }
+
mImage->setBoostLevel(LLViewerImageBoostLevel::BOOST_PREVIEW);
mImage->forceToSaveRawImage(0) ;
mAssetStatus = PREVIEW_ASSET_LOADING;
diff --git a/linden/indra/newview/llpreviewtexture.h b/linden/indra/newview/llpreviewtexture.h
index 75fd39e..ba04515 100644
--- a/linden/indra/newview/llpreviewtexture.h
+++ b/linden/indra/newview/llpreviewtexture.h
@@ -56,6 +56,7 @@ public:
const std::string& title,
const LLUUID& asset_id,
BOOL copy_to_inv = FALSE);
+ LLPreviewTexture(const LLRect& rect, const std::string& title, LLViewerImage* imagep);
~LLPreviewTexture();
virtual void draw();
diff --git a/linden/install.xml b/linden/install.xml
index 73422f4..c5e6274 100755
--- a/linden/install.xml
+++ b/linden/install.xml
@@ -179,30 +179,30 @@
darwin
linux
linux64
windows
--
cgit v1.1