From b732b85bbb2e1745f926e92d7e512973b8236826 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Fri, 15 Nov 2024 04:24:44 +0100 Subject: [PATCH] add some more variation for user-placeable minimap gems --- Aquaria/WorldMapRender.cpp | 87 +++++++++++++++++++++----------- Aquaria/WorldMapRender.h | 4 +- files/gfx/gems/pyramidblue.png | Bin 0 -> 1675 bytes files/gfx/gems/pyramidgreen.png | Bin 0 -> 1655 bytes files/gfx/gems/pyramidred.png | Bin 0 -> 1659 bytes 5 files changed, 60 insertions(+), 31 deletions(-) create mode 100644 files/gfx/gems/pyramidblue.png create mode 100644 files/gfx/gems/pyramidgreen.png create mode 100644 files/gfx/gems/pyramidred.png diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index d033895..77e9b06 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -358,6 +358,18 @@ protected: } }; +class HintGemQuad : public Quad +{ +public: + HintGemQuad(const std::string& gemtex, const Vector& pos) + : Quad("gems/" + gemtex, pos), gemTex(gemtex) + { + } + virtual ~HintGemQuad() {} + inline const std::string& getGemTex() const { return gemTex; } + const std::string gemTex; +}; + typedef std::vector GemMovers; GemMovers gemMovers; @@ -383,6 +395,15 @@ void WorldMapRender::setProperTileColor(WorldMapTileContainer& wt) } } +static HintGemQuad *addHintGem(const char *tex) +{ + HintGemQuad *q = new HintGemQuad(tex, Vector(0,0)); + q->followCamera = 1; + q->alpha = 0; + game->addRenderObject(q, LR_WORLDMAPHUD); + return q; +} + WorldMapRender::WorldMapRender(WorldMap& wm) : RenderObject(), ActionMapper() , worldmap(wm) { @@ -460,16 +481,11 @@ WorldMapRender::WorldMapRender(WorldMap& wm) : RenderObject(), ActionMapper() underlay->alpha = 0; game->addRenderObject(underlay, LR_HUDUNDERLAY); - addHintQuad1 = new Quad("gems/pyramidyellow", Vector(0,0)); - addHintQuad1->followCamera = 1; - addHintQuad1->alpha = 0; - game->addRenderObject(addHintQuad1, LR_WORLDMAPHUD); - - addHintQuad2 = new Quad("gems/pyramidpurple", Vector(0,0)); - addHintQuad2->followCamera = 1; - addHintQuad2->alpha = 0; - game->addRenderObject(addHintQuad2, LR_WORLDMAPHUD); - + addHintQuads[0] = addHintGem("pyramidyellow"); + addHintQuads[1] = addHintGem("pyramidpurple"); + addHintQuads[2] = addHintGem("pyramidgreen"); + addHintQuads[3] = addHintGem("pyramidred"); + addHintQuads[4] = addHintGem("pyramidblue"); helpButton = new AquariaMenuItem; helpButton->event.setActionMapperCallback(this, ACTION_TOGGLEHELPSCREEN, 0); @@ -607,12 +623,6 @@ void WorldMapRender::onUpdate(float dt) areaLabel3->alpha.x = this->alpha.x; tophud->alpha.x = this->alpha.x; - const float mmWidth = game->miniMapRender->getMiniMapWidth(); - const float mmHeight = game->miniMapRender->getMiniMapHeight(); - - addHintQuad1->position = game->miniMapRender->position + Vector(-mmWidth*3/22, -mmHeight/2-10); - addHintQuad2->position = game->miniMapRender->position + Vector(mmWidth*3/22, -mmHeight/2-10); - const int offset = 26; helpButton->position = Vector(core->getVirtualWidth()-core->getVirtualOffX()-offset, offset); @@ -629,6 +639,28 @@ void WorldMapRender::onUpdate(float dt) if (isOn()) { + // minimap marker gem placers + { + const float mmWidth = game->miniMapRender->getMiniMapWidth(); + const float mmHeight = game->miniMapRender->getMiniMapHeight(); + const Vector mmpos = game->miniMapRender->position; + + float yoffs = -mmHeight/2-32; + addHintQuads[0]->position = mmpos + Vector(-mmWidth*3/22, yoffs); + addHintQuads[1]->position = mmpos + Vector(mmWidth*3/22, yoffs); + + yoffs = -mmHeight/2-12; + addHintQuads[2]->position = mmpos + Vector(-mmWidth*6/22, yoffs); + addHintQuads[3]->position = mmpos + Vector(0, yoffs); + addHintQuads[4]->position = mmpos + Vector(mmWidth*6/22, yoffs); + + for(size_t i = 0; i < Countof(addHintQuads); ++i) + { + float s = addHintQuads[i]->isCoordinateInRadius(core->mouse.position, 10) ? 1.33f : 1.0f; + addHintQuads[i]->scale.interpolateTo(Vector(s, s), 0.1f); + } + } + if(!selectedTile) selectedTile = playerTile; @@ -1115,13 +1147,12 @@ void WorldMapRender::toggle(bool turnON) alpha.interpolateTo(1, 0.2f); - underlay->alpha.interpolateTo(WORLDMAP_UNDERLAY_ALPHA, 0.2f); - - addHintQuad1->alpha.interpolateTo(1.0f, 0.2f); - addHintQuad2->alpha.interpolateTo(1.0f, 0.2f); helpButton->alpha.interpolateTo(1.0f, 0.2f); + for(size_t i = 0; i < Countof(addHintQuads); ++i) + addHintQuads[i]->alpha.interpolateTo(1.0f, 0.2f); + assert(gemMovers.empty()); for (Continuity::Gems::iterator i = dsq->continuity.gems.begin(); i != dsq->continuity.gems.end(); i++) addGem(&(*i)); @@ -1154,10 +1185,11 @@ void WorldMapRender::toggle(bool turnON) game->togglePause(false); underlay->alpha.interpolateTo(0, 0.2f); - addHintQuad1->alpha.interpolateTo(0, 0.2f); - addHintQuad2->alpha.interpolateTo(0, 0.2f); helpButton->alpha.interpolateTo(0, 0.2f); + for(size_t i = 0; i < Countof(addHintQuads); ++i) + addHintQuads[i]->alpha.interpolateTo(0, 0.2f); + for (GemMovers::iterator i = gemMovers.begin(); i != gemMovers.end(); i++) { @@ -1239,14 +1271,9 @@ void WorldMapRender::action (int id, int state, int source, InputDevice device) if (id == ACTION_PRIMARY && state) { - if (addHintQuad1->isCoordinateInRadius(core->mouse.position, 10)) - { - createGemHint("pyramidyellow"); - } - if (addHintQuad2->isCoordinateInRadius(core->mouse.position, 10)) - { - createGemHint("pyramidpurple"); - } + for(size_t i = 0; i < Countof(addHintQuads); ++i) + if(addHintQuads[i]->isCoordinateInRadius(core->mouse.position, 10)) + createGemHint(addHintQuads[i]->getGemTex()); } if (id == ACTION_SECONDARY && !state) diff --git a/Aquaria/WorldMapRender.h b/Aquaria/WorldMapRender.h index f5e7f1f..d4c0846 100644 --- a/Aquaria/WorldMapRender.h +++ b/Aquaria/WorldMapRender.h @@ -12,6 +12,8 @@ class AquariaMenuItem; struct WorldMap; class Gradient; +class HintGemQuad; + // This is used for properly positioning the tile and gems on top of it. // Affected by scale2 -- gems also move with scale2. @@ -67,7 +69,7 @@ public: WorldMapTileContainer * setCurrentMap(const char *mapname); protected: - Quad *addHintQuad1, *addHintQuad2; + HintGemQuad *addHintQuads[5]; AquariaMenuItem *helpButton; float doubleClickTimer; float inputDelay; diff --git a/files/gfx/gems/pyramidblue.png b/files/gfx/gems/pyramidblue.png new file mode 100644 index 0000000000000000000000000000000000000000..d660b48bd0c2316dc3f0a55e353afd84c0598027 GIT binary patch literal 1675 zcmV;626Xv}P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1|Ug9K~#8N?U>tZ z99100f9K51Ub9KM+a}FLlD3$p4M|&}R!dPZRjafJ3fec{go=ole?U|e!B-!B6JMk+ zeegnkX;HBRtwC*Uz*^gqn3zkG&1QG!cKm(QJuoaSN;|VydOq;WIkPi!_I$tR_dBx_ zG8ha7gTY`h7z_r3!EnzZ8f~k=_v!#D5-p|G1~dzArsYPo%79x5*T>C*TV{mSXp`h- z;w49k?82z9oL&mO8Xwm=wBTl=5~CFcK&%#o_J;V>=4Z19-g`U0`@rG)waE(k>sR@6 z7@^VkB$@?D8=wUP-OupKA9Th(c-89LGnO45=(D@_mFm-{uTbdE@_8Q@H_#>|M$!f} zufEMOAUnp6RDWaW=! zM&5aS$It^Er7a!GDrQ728wjh=Gg|-c%&hXtm-)Iij^_O!5krzP0F%}MZlpe0BX<8& z$I@NL4?VbdKxEq-npq11>MKa{7Hydx>aJfpdzqB?Ctr_JNPJV&D-<_T@o16yJtEh4 z*xq*HcvshusJJ#2vWjGxq%E^#_3j{NU})Ix-hYsUJ=Hh~Kug{VSSNLA+2OxIw zAc+iUo+u3Hm2Err1%>fJUv|ptRiUI!N^yd#fdB9;6eqmMcmMT8+%4;%PI*R)m z_v4jmgZ6Ud`ZAVeL$|t!mc?Qr< z7I#8L!bu6abtk2IO8uE#M<3&RcJf*5A-`Tz4aVf?Y7M; zoKJh9A4pND3E~!MKq1cpr66q7L`b3CN%p`VksrAK8Ifu~#N)I##*2<03vnBu!MF}t zxj}o^o5y^yEiGjb7ILi7wgqb>hvm4O`X~qG@(qGJ8r+@U%(A!H)~4a@BvT#yNplv& zLJ|g`yS zCjrKT0ddZEgV+ab(3r4V^e?`DPPyf(7X~WuJeDn}<}0e!B~_|{a@l~5tDzpXfCG1p z{0rZO-t46-s=mbU2rjIOmOyM^(74cMVv<;`EZ1|2g7tuAJ`vP5TJ)XXe8#baQc`sC z@51`JORGg&g#C)b3cm=3Tnj7nR6GBbUzs>Hwf5tuU-PT-4?Gs$4|v-ozJPSCVC%eN zk~9Fn#a6H9tl5U(a~UpMN;v z&i?#8XT?uE#x;&I2Mq8y?g|4iE=+JZILQ^4wO^&`m1;QinFtHJbM>$ zi82_H zT<)qxv*+mg>5qS_O@H|dm%$`oi#NhKj=wpUIq-If{}^E}(8B+B20*A5k2X3{tQscI z4?Z?Qc`H=?qaqg0a#gQV`P|8AZ|=e*?-^5k4N@Ne7@6l-k*{|y!E8i?0ZRD5J?Gv{F7*7Y#ePlypL);Jz zBXS(b4t$Q)gjkpW;d<3|+H2uJ8xj5Nw$T%f6D>MAHu}+QfN+?BKFong?C=n+|3!{f z$0{c#9wcD^xRnVAy*D7xhcS^&awGJrYoW0V*F-0n1X^_Td(hW=Mf99r?Zj6-N_1jL z(JWMRv+r&enW%Vx6l?`i0sqDH#D!~GWq{`2jA)r~gTY`h7z_r3!C){L4EHKT{{X}G V80JdQRS*CG002ovPDHLkV1k6e8gl>u literal 0 HcmV?d00001 diff --git a/files/gfx/gems/pyramidgreen.png b/files/gfx/gems/pyramidgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..a2d6930a5e2efb175a77242f00e199ec9614413d GIT binary patch literal 1655 zcmV--28j8IP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1`J6=K~#8N?U-F? z990y@&z-rmU(@U+*(Pn$NE$<$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pPA7ZiGul52n5Ak&l%s%dzAzBNMn{mseX#mhm9%w`Kfmr0&!hyRw7=aeX;GBRs zm;k{Lj^BR0?=ka9@o4o~a9gBp0P^Vox{uY+JrKL1VMK`os{`+2HX#-!K)9ZDz3jDc zppA&XcgyHP(?pAo=SDxi8Xz2Ipbv8(5+^)F>wl4B)-lVOi3eF20B&XiLZ1x?^kK|D zhh#VOtZSjE3)jR8%mOVs{ypgHvm*YPp6$$MJx;u^tVjyg+~~WLA~O{aumt--T)=-Z zJ#*ojei@+oHzWEc++Z*m3W%;a002ovPDHLkV1n)} BAwvKF literal 0 HcmV?d00001 diff --git a/files/gfx/gems/pyramidred.png b/files/gfx/gems/pyramidred.png new file mode 100644 index 0000000000000000000000000000000000000000..ade1ee99d6ca97401cc2b1b9d1e8030405050936 GIT binary patch literal 1659 zcmV->288*EP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1`tU^K~#8N?U-F? zTtyVe&&>VUuOz$4#w2aGrnNQ=l{Qo;l_CnJVv!a>LHp*LP!aLt#Ya(51YdphO?;8Q z^hHHqDk7F58Wd{_Z6y_xv}rc!e((Jl&wtq|murjC-n&>jKYB8=yK`sH|37DD?=2Y& z27|$1Fc=I5gTY|9=MepN(BOM@02PUWGH3(h!s86wh(Q@}E8+TeT=2k*u=;J9+)TXW zC=UzT;|Q_YBWm;O4u=*TH!3v-VF1KxL1=s8$0a@ceku3PflT?(LZ{Ja5?$u^VT49s zlWG;DZGaXGbU({0fAGU`=heB;+B@xT-LlWN%3pVCi$2j3f6mPfvhTw zX64}*?=L+6(C#s7vRaXAQdC;qYV}+YTn>rWcuc^N`u+!L8W3N7d{?m`=kzDfI`Bt8>K9gH#OB2__Aa)`uh(;;P1J~_4TvU) z7Ris~cwZkMv7XxMD%av=C68}?EK4ZCLwW}IY=z{(k|s&2N@g1J&-Fbu}fyD?2cEC zWQU*Nk-K;vZvHWMA|z=5lG2Hx?Unv+M;v~;B%d3x$+jGuyi6g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