1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

Merge branch 'modsel-cleanup'

This commit is contained in:
fgenesis 2013-07-27 00:43:07 +02:00
commit 3c0de8227c
18 changed files with 69 additions and 69 deletions

View file

@ -286,7 +286,8 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
<Package url="localhost/aq/jukebox.aqmod" saveAs="jukebox" size="1234" /> // -- saveAs is optional, and ".aqmod" appended to it
<Author name="Dolphin's Cry" /> //-- optional tag
<Confirm text="" /> //-- optional tag, pops up confirm dialog
<Properties type="patch" /> //-- optional tag, if not given, "mod" is assumed.
<Properties type="patch" /> //-- optional tag, if not given, "mod" is assumed. Can be "mod", "patch", or "weblink".
// if type=="weblink", <Package url> will be opened with the default web browser.
</AquariaMod>
<AquariaMod>
@ -320,17 +321,18 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
while(modx)
{
std::string namestr, descstr, iconurl, pkgurl, confirmStr, localname;
std::string sizestr;
bool isPatch = false;
std::string sizestr, weburl;
ModPackageType pkgtype = MPT_MOD;
int serverSize = 0;
int serverIconSize = 0;
TiXmlElement *fullname, *desc, *icon, *pkg, *confirm, *props;
TiXmlElement *fullname, *desc, *icon, *pkg, *confirm, *props, *web;
fullname = modx->FirstChildElement("Fullname");
desc = modx->FirstChildElement("Description");
icon = modx->FirstChildElement("Icon");
pkg = modx->FirstChildElement("Package");
confirm = modx->FirstChildElement("Confirm");
props = modx->FirstChildElement("Properties");
web = modx->FirstChildElement("Web");
if(fullname && fullname->Attribute("text"))
namestr = fullname->Attribute("text");
@ -347,7 +349,15 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
}
if(props && props->Attribute("type"))
isPatch = !strcmp(props->Attribute("type"), "patch");
{
const char *ty = props->Attribute("type");
if(!strcmp(ty, "patch"))
pkgtype = MPT_PATCH;
else if(!strcmp(ty, "mod"))
pkgtype = MPT_MOD;
else if(!strcmp(ty, "weblink"))
pkgtype = MPT_WEBLINK;
}
if(pkg)
{
@ -394,7 +404,7 @@ bool ModDL::ParseModXML(const std::string& fn, bool allowChaining)
ico->confirmStr = confirmStr;
ico->localname = localname;
ico->label = "--[ " + namestr + " ]--\n" + descstr;
ico->isPatch = isPatch;
ico->pkgtype = pkgtype;
if(serverSize && dsq->modIsKnown(localname))
{

View file

@ -273,8 +273,6 @@ void ModSelectorScreen::init()
dsq->toggleVersionLabel(false);
modsIcon->setFocus(true);
// TODO: keyboard/gamepad control
}
void ModSelectorScreen::initModAndPatchPanel()
@ -359,7 +357,6 @@ void ModSelectorScreen::setSubText(const std::string& s)
static void _FadeOutAll(RenderObject *r, float t)
{
//r->shareAlphaWithChildren = true;
r->alpha.interpolateTo(0, t);
for(RenderObject::Children::iterator it = r->children.begin(); it != r->children.end(); ++it)
_FadeOutAll(*it, t);
@ -369,7 +366,6 @@ void ModSelectorScreen::close()
{
const float t = 0.5f;
_FadeOutAll(this, t);
//panels[currentPanel]->scale.interpolateTo(Vector(0.9f, 0.9f), t); // HMM
dsq->user.save();
dsq->toggleVersionLabel(true);
}
@ -377,7 +373,6 @@ void ModSelectorScreen::close()
JuicyProgressBar::JuicyProgressBar() : Quad(), txt(&dsq->smallFont)
{
setTexture("modselect/tube");
//shareAlphaWithChildren = true;
followCamera = 1;
alpha = 1;
@ -570,8 +565,6 @@ void ModIcon::loadEntry(const ModEntry& entry)
if (desc->Attribute("text"))
{
ds = desc->Attribute("text");
//if (label.size() > 255)
// label.resize(255);
}
}
TiXmlElement *fullname = top->FirstChildElement("Fullname");
@ -618,7 +611,7 @@ void ModIcon::updateStatus()
ModIconOnline::ModIconOnline()
: SubtitleIcon(), pb(0), extraIcon(0), statusIcon(0), clickable(true), isPatch(false), hasUpdate(false)
: SubtitleIcon(), pb(0), extraIcon(0), statusIcon(0), clickable(true), pkgtype(MPT_MOD), hasUpdate(false)
{
label = desc;
}
@ -660,7 +653,7 @@ bool ModIconOnline::fixIcon()
quad->setWidthHeight(MOD_ICON_SIZE, MOD_ICON_SIZE);
quad->alpha.interpolateTo(1, 0.5f);
if(!extraIcon && isPatch)
if(!extraIcon && pkgtype == MPT_PATCH)
{
Vector pos(-MOD_ICON_SIZE/2 + MINI_ICON_SIZE/2, MOD_ICON_SIZE/2 - MINI_ICON_SIZE/2);
extraIcon = new Quad("modselect/ico_patch", pos);
@ -721,40 +714,53 @@ void ModIconOnline::onClick()
if(clickable && !packageUrl.empty())
{
bool proceed = true;
if(dsq->modIsKnown(localname))
if(pkgtype == MPT_MOD || pkgtype == MPT_PATCH)
{
mouseDown = false; // HACK: do this here else stack overflow!
if(hasPkgOnDisk())
if(dsq->modIsKnown(localname))
{
if(hasUpdate)
proceed = dsq->confirm(dsq->continuity.stringBank.get(2024));
mouseDown = false; // HACK: do this here else stack overflow!
if(hasPkgOnDisk())
{
if(hasUpdate)
proceed = dsq->confirm(dsq->continuity.stringBank.get(2024));
else
proceed = dsq->confirm(dsq->continuity.stringBank.get(2025));
}
else
proceed = dsq->confirm(dsq->continuity.stringBank.get(2025));
{
dsq->confirm(dsq->continuity.stringBank.get(2026), "", true);
proceed = false;
}
}
else
if(proceed && confirmStr.length())
{
dsq->confirm(dsq->continuity.stringBank.get(2026), "", true);
proceed = false;
mouseDown = false; // HACK: do this here else stack overflow!
dsq->sound->playSfx("spirit-beacon");
proceed = dsq->confirm(confirmStr);
}
if(proceed)
{
moddl.GetMod(packageUrl, localname);
setDownloadProgress(0);
success = true;
clickable = false;
}
else
success = true; // we didn't want, anyway
}
if(proceed && confirmStr.length())
{
mouseDown = false; // HACK: do this here else stack overflow!
dsq->sound->playSfx("spirit-beacon");
proceed = dsq->confirm(confirmStr);
}
if(proceed)
else if(pkgtype == MPT_WEBLINK)
{
moddl.GetMod(packageUrl, localname);
setDownloadProgress(0);
success = true;
clickable = false;
mouseDown = false;
proceed = dsq->confirm(dsq->continuity.stringBank.get(2034));
if(proceed)
{
openURL(packageUrl);
success = true;
}
}
else
success = true; // we didn't want, anyway
}
if(!success)
@ -816,7 +822,7 @@ void MenuIconBar::init()
ico = new MenuIcon(0);
ico->label = dsq->continuity.stringBank.get(2027);
ico->useQuad("modselect/hdd");
ico->useQuad("modselect/installed");
y += ico->quad->height;
ico->position = Vector(0, y);
add(ico);
@ -825,7 +831,7 @@ void MenuIconBar::init()
MenuIcon *prev = ico;
ico = new MenuIcon(1);
ico->label = dsq->continuity.stringBank.get(2028);
ico->useQuad("modselect/patch");
ico->useQuad("modselect/patches");
y += ico->quad->height;
ico->position = Vector(0, y);
ico->setDirMove(DIR_UP, prev);
@ -835,7 +841,7 @@ void MenuIconBar::init()
prev = ico;
ico = new MenuIcon(2);
ico->label = dsq->continuity.stringBank.get(2029);
ico->useQuad("modselect/globe");
ico->useQuad("modselect/download");
y += ico->quad->height;
ico->position = Vector(0, y);
ico->setDirMove(DIR_UP, prev);
@ -846,7 +852,7 @@ void MenuIconBar::init()
prev = ico;
ico = new MenuIcon(3);
ico->label = dsq->continuity.stringBank.get(2030);
ico->useQuad("gui/wok-drop");
ico->useQuad("modselect/exit");
ico->repeatTextureToFill(false);
y += ico->quad->height;
ico->position = Vector(0, y);
@ -863,11 +869,6 @@ void MenuIconBar::add(MenuIcon *ico)
addChild(ico, PM_POINTER);
}
void MenuArrowBar::init()
{
// TODO: up/down arrow
}
IconGridPanel::IconGridPanel()
: spacing(0), y(0), x(0)
{

View file

@ -4,6 +4,13 @@
#include "AquariaMenuItem.h"
#include "DSQ.h"
enum ModPackageType
{
MPT_MOD,
MPT_PATCH,
MPT_WEBLINK,
};
class JuicyProgressBar : public Quad
{
public:
@ -90,8 +97,8 @@ public:
JuicyProgressBar *pb; // visible if downloading
Quad *extraIcon; // installed or update available
Quad *statusIcon;
ModPackageType pkgtype;
bool clickable;
bool isPatch;
bool hasUpdate;
protected:
@ -118,13 +125,6 @@ protected:
void add(MenuIcon *ico);
};
class MenuArrowBar : public MenuBasicBar
{
public:
virtual void init();
};
class IconGridPanel : public Quad
{
public:
@ -168,7 +168,7 @@ public:
protected:
virtual void onUpdate(float dt);
MenuIconBar leftbar;
MenuArrowBar rightbar;
MenuBasicBar rightbar;
int currentPanel;
BitmapText subtext;
Quad subbox;

View file

@ -207,6 +207,7 @@
2031 Any
2032 [Achievements]
2033 Retrieving online mod list...
2034 Open URL in web browser?
2100 === for options menu ===
2101 Action
2102 Key 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1,12 +0,0 @@
http://www.mricons.com/icon/86682/128/text-patch-icon
http://www.mricons.com/icon/80837/128/drive-harddisk-icon
http://commons.wikimedia.org/wiki/File:Deer_Park_Globe.png
http://www.iconfinder.com/icondetails/3839/48/alert_arrow_download_exclamation_orange_update_icon
http://www.iconfinder.com/icondetails/52296/48/checkmark_tick_icon
http://www.mricons.com/icon/28252/32/patch-icon
http://www.iconfinder.com/icondetails/21179/32/cancel_dialog_error_gtk_icon

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB