From 89326baa37d728f2b95e3e5e98c8c9fce496f71e Mon Sep 17 00:00:00 2001 From: UnBuiltTree Date: Wed, 5 Mar 2025 21:29:19 -0600 Subject: [PATCH] Updated StructureLayer and GameMap for Remake of Icons, added extra building png icons resources. --- resources/images/buildings/city1.png | Bin 0 -> 159 bytes resources/images/buildings/city2.png | Bin 0 -> 168 bytes resources/images/buildings/city3.png | Bin 0 -> 199 bytes resources/images/buildings/city4.png | Bin 0 -> 199 bytes resources/images/buildings/city5.png | Bin 0 -> 178 bytes resources/images/buildings/fort0.png | Bin 0 -> 134 bytes resources/images/buildings/fort1.png | Bin 0 -> 137 bytes resources/images/buildings/fort2.png | Bin 0 -> 149 bytes resources/images/buildings/fort3.png | Bin 0 -> 147 bytes resources/images/buildings/fort4.png | Bin 0 -> 173 bytes resources/images/buildings/fort5.png | Bin 0 -> 173 bytes resources/images/buildings/fort6.png | Bin 0 -> 158 bytes resources/images/buildings/port1.png | Bin 0 -> 149 bytes resources/images/buildings/port2.png | Bin 0 -> 160 bytes resources/images/buildings/port3.png | Bin 0 -> 167 bytes resources/images/buildings/port4.png | Bin 0 -> 180 bytes resources/images/buildings/port5.png | Bin 0 -> 180 bytes resources/images/buildings/silo1.png | Bin 0 -> 139 bytes resources/images/buildings/silo2.png | Bin 0 -> 148 bytes resources/images/buildings/silo3.png | Bin 0 -> 166 bytes resources/images/buildings/silo4.png | Bin 0 -> 158 bytes resources/images/buildings/silo5.png | Bin 0 -> 168 bytes resources/images/buildings/silo6.png | Bin 0 -> 167 bytes resources/images/buildings/siloA45.png | Bin 0 -> 192 bytes src/client/graphics/layers/StructureLayer.ts | 22 +++++++++---------- src/core/game/GameMap.ts | 11 +++++++++- 26 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 resources/images/buildings/city1.png create mode 100644 resources/images/buildings/city2.png create mode 100644 resources/images/buildings/city3.png create mode 100644 resources/images/buildings/city4.png create mode 100644 resources/images/buildings/city5.png create mode 100644 resources/images/buildings/fort0.png create mode 100644 resources/images/buildings/fort1.png create mode 100644 resources/images/buildings/fort2.png create mode 100644 resources/images/buildings/fort3.png create mode 100644 resources/images/buildings/fort4.png create mode 100644 resources/images/buildings/fort5.png create mode 100644 resources/images/buildings/fort6.png create mode 100644 resources/images/buildings/port1.png create mode 100644 resources/images/buildings/port2.png create mode 100644 resources/images/buildings/port3.png create mode 100644 resources/images/buildings/port4.png create mode 100644 resources/images/buildings/port5.png create mode 100644 resources/images/buildings/silo1.png create mode 100644 resources/images/buildings/silo2.png create mode 100644 resources/images/buildings/silo3.png create mode 100644 resources/images/buildings/silo4.png create mode 100644 resources/images/buildings/silo5.png create mode 100644 resources/images/buildings/silo6.png create mode 100644 resources/images/buildings/siloA45.png diff --git a/resources/images/buildings/city1.png b/resources/images/buildings/city1.png new file mode 100644 index 0000000000000000000000000000000000000000..fa8c8bdca7fd890434fcccc86ac1e4004f8057b8 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|B0XIkLo9ml zPBP?UP~c!*`SE}JF<0S5x{7(H*u-|MN;}UUaq;flF2+^*yaCSDYEeIL?Rj2Q?6zUP z>C5D<HqP7E=Cp4Yb63n?ZppLhh73zPllN=v7rOwogu&C*&t;uc GLK6V9s5W;1 literal 0 HcmV?d00001 diff --git a/resources/images/buildings/city2.png b/resources/images/buildings/city2.png new file mode 100644 index 0000000000000000000000000000000000000000..86b81895fd8ff4457748f21f50410da54eecb508 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|l001;Lo9mF z208K_P~cd6?0Xj{j(V!sHhz~QYN6R5g0#lPv5yc z(FVdQ&MBb@0D!qY7XSbN literal 0 HcmV?d00001 diff --git a/resources/images/buildings/city3.png b/resources/images/buildings/city3.png new file mode 100644 index 0000000000000000000000000000000000000000..b0e97050371095760e8a5697f8ebd58b47aa27ab GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|8a-VcLo9li zPWI$$FyLW+yz2k|q8(c_Ov_l5mTOf=ZtIxe+|hC7Of};I;|*n6$)d8k*{jmD7Ah4k z)Jkd@V$ZOgDBC10pjLo?N(26Z*ZRW vJ+{nwYY0>Nw)jQP+Z%QM{W31S6<*9J=T)H5T>L8+=oki1S3j3^P6kd@V$ZOgDBC10pjLo?N(26Z*ZRW vJ+{nwYY0>Nw)jQP+Z%QM{W31S6<*9J=T)H5T>L8+=oki1S3j3^P6sd?4k8|ne`8#y$qhNelF{r5}E*cWI|g2 literal 0 HcmV?d00001 diff --git a/resources/images/buildings/fort0.png b/resources/images/buildings/fort0.png new file mode 100644 index 0000000000000000000000000000000000000000..5214224df61bbf443c9237adf174d9d74e1b0e26 GIT binary patch literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|96VhdLo9le z6C_w84*my%!x<@NW?OrH@Eiy@bE0G6yv~|(A%+v{4m?%5wUc3X?~a(p>#RTK@G*-V fKctb6z`&r;p#Ai-V!Z literal 0 HcmV?d00001 diff --git a/resources/images/buildings/fort2.png b/resources/images/buildings/fort2.png new file mode 100644 index 0000000000000000000000000000000000000000..37d1da28bbced2cd86232d71121a799fc3deda74 GIT binary patch literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|{5@S9Lo9le z6C_L?*o#b9%NHqd%q^_PcU~h92u|0%aYRy5((sD0V3E;HhUt@6zGJ#o!8m(zVI}i= u?ha4!E8NT_w>PM&?a^Cop~)}7z~HzmdEK_&BD)z4*}Q$iB}lVL7G literal 0 HcmV?d00001 diff --git a/resources/images/buildings/fort4.png b/resources/images/buildings/fort4.png new file mode 100644 index 0000000000000000000000000000000000000000..e0e5ef5d1b1dc6e579f644f23d62afce5c83c3fc GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|(mh=qLo9li zPWI+Ipupjh?(@Drb=RQr5T>t~yrqi=DFy*ZX|@}}vz%+0rg&oo~P&s}%v*Tg5nmVZ*!R@AL9)1S>= Vet4OXMm5k%22WQ%mvv4FO#trNK|}xm literal 0 HcmV?d00001 diff --git a/resources/images/buildings/fort5.png b/resources/images/buildings/fort5.png new file mode 100644 index 0000000000000000000000000000000000000000..fbc513313926dd3aa57f3c6842a332868d3d50e5 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|(mh=qLo9li zPWI+wP~>p#p7}d|=Vpm^iK+cJ<|@_(bR1a9!r-wfMNBY+asTp4*Ro3AZ4Eac_}*yH zKkdmg>B^rl@%*Nbxo#(3NiFD_mUi_nr%`vP!#APNtn*e>v)pBxCOw~FmHg^8;?v?J}CeI literal 0 HcmV?d00001 diff --git a/resources/images/buildings/fort6.png b/resources/images/buildings/fort6.png new file mode 100644 index 0000000000000000000000000000000000000000..8d5e37699e2a58b5140cd7184a998020d336acc4 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|B0OCjLo9le z6Belb;Aeeu%J{+5BMaL&=PRX17fSYBWhmkO5z}^=VH1O1^v9iTN#Yldao=F#oh}n6 zE-+b7;~NvV;%&~IOsg4tfZ)h3hQr(~M#3A}gn1cesU+__@22Spw1dIZ)z4*}Q$iB} DAW||a literal 0 HcmV?d00001 diff --git a/resources/images/buildings/port1.png b/resources/images/buildings/port1.png new file mode 100644 index 0000000000000000000000000000000000000000..e8e2bf1b2448e26f589761d4b6e305085d5b9a89 GIT binary patch literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|{5@S9Lo9le z6C|!Yuorm{e7M8kxXa1SZB7=aRKs~uAC;M1tQ!Pgb1h=n#g^09aqjpBCcEg3Clh&@ vbGQm6eF_zlj_4k2X`UvRF?~WC9|J>#fc+hj&4C3#qZvG1{an^LB{Ts53A8Ro literal 0 HcmV?d00001 diff --git a/resources/images/buildings/port2.png b/resources/images/buildings/port2.png new file mode 100644 index 0000000000000000000000000000000000000000..6a951a03728182f4553c204c945184084476b8b3 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|qC8z3Lo9le z6C_L?*o#ciI@Y3d^2CV~9cu)nr6YMA#S@bkGpof29bpnniggrGFcX;gQzGs_y0)3+ zn#2ZQMZIQCK9?Q~RgnUV%Z%$7RMZp#O$3UJHokhn&JZM4zGTTZA5Nex44$rjF6*2U FngA*3E)D)W^xh>rAZ1u8_q9(g}&$RFU?atJ3N6P(NM5Cm;hOVo~%9iD8 zLJ~@rXDEJl%-kj#68_EIHsR2k4;wopI#2C*+py`#JH?a1VZN6<>yC3d2tDnm{r-UW|CsIJ0 literal 0 HcmV?d00001 diff --git a/resources/images/buildings/port4.png b/resources/images/buildings/port4.png new file mode 100644 index 0000000000000000000000000000000000000000..ea18e9b068f9e9262f57471fbf60cbaa5f2f7bbc GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|@;qG}Lo9ly z20QW{P~ga({`ddsikm_rD=tiSIv6xnBO&eCca_LO=ZBGN9!I=ldS!cy&c*dewrMeA5{T*#T#xDw$Qbe-J)a|M1tf-Fsf9 dYo(UDN3{C%Z(L<)Tn4n6!PC{xWt~$(699k%OF3;Ysn7+2Q&q=-rL!+RL>) zg04M0C!&(+>dJQG{=^?z3#CHSysJNCy>evu5F;SW^5DdQtFNkpmsvzDS)TaF*jBB2 d(cR*IjLTkaZpnQVISFVpgQu&X%Q~loCIDW3Mpgg- literal 0 HcmV?d00001 diff --git a/resources/images/buildings/silo1.png b/resources/images/buildings/silo1.png new file mode 100644 index 0000000000000000000000000000000000000000..01019f0f868c377de7a9665f99f2df2b27ec1854 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Ts>VJLo9le z6C_xBj%fV)|Nnpe4mLM85nG=l8E)5IOdPgJO3N=-lUT4mErt2Sr5;~lGvEP((3 literal 0 HcmV?d00001 diff --git a/resources/images/buildings/silo2.png b/resources/images/buildings/silo2.png new file mode 100644 index 0000000000000000000000000000000000000000..1625e6555f521fa1a6bcf039bc125bc65ba4f856 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|{5)M8Lo9le z6C_L?*o#b9+b41M#ucMUYZ@mCy7CJf&bnwS$a`V0>lE|<%8b9V+{_wu&fYK)oNQLm urnhf}GuwxZBdNk>XDx!2Ts{us?UrfqyZ^kB;VvnO)nF zuk2E$tRBn~wudL-sA5T2{@z)urf-*z`W^W|xim^}7{)d}(uozs~>C^Z{rW NgQu&X%Q~loCIBt(I-vjn literal 0 HcmV?d00001 diff --git a/resources/images/buildings/silo4.png b/resources/images/buildings/silo4.png new file mode 100644 index 0000000000000000000000000000000000000000..fc37c4694a6c16ebf075e3eeb899f9617dd75275 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|B0OCjLo9mN z1{n%5C~%xw_rHGTG_kiAERuCxT#jcPy1~w1u}JdiG^Riwt#vNTmaHi|?)a?9s^YAI z>_I-GbHUfo_*x&Sk6v*pJvoN&is`x^3-0X^o{;~K-Han3eV@tJRc=5#7(8A5T-G@y GGywq0c{k<& literal 0 HcmV?d00001 diff --git a/resources/images/buildings/silo5.png b/resources/images/buildings/silo5.png new file mode 100644 index 0000000000000000000000000000000000000000..d3d473c626b610b24fa47bad9e8b9aaa8f0e6b68 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|l001;Lo9la zPVnSwFyLX9?)+b0xuZdZHCuut^Di8gx$|DI#4VpZ?ajA! R!a&;?JYD@<);T3K0RSUaKORcP4R0tMJCU+zs%5M+&%a51C}13 OWelFKelF{r5}E*b?m3(Q literal 0 HcmV?d00001 diff --git a/resources/images/buildings/siloA45.png b/resources/images/buildings/siloA45.png new file mode 100644 index 0000000000000000000000000000000000000000..595ea88953802d1716638267cacabff37049af4c GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|#^NA%Cx&(BWL^R}Rh}-6Ar`%J zCp!uqP~c!*`v1SN?ahUTNlNB|WkMGWTTYy@x!S_q*^&Eqv4fgJpqrwf^3*ObgY)mi zvSpXdzQ~kVW?+8)$}aAM^X{A7C|f0)_I|aiYUH9|x7aI3OrMx^%Ssf#wYs^c?EK=t pN?J#_zMsC}#+r2gg;j{PzWd$B3F;5#Mgd*H;OXk;vd$@?2>?v?NB{r; literal 0 HcmV?d00001 diff --git a/src/client/graphics/layers/StructureLayer.ts b/src/client/graphics/layers/StructureLayer.ts index 1d6ee47df..62dd2efc2 100644 --- a/src/client/graphics/layers/StructureLayer.ts +++ b/src/client/graphics/layers/StructureLayer.ts @@ -3,10 +3,10 @@ import { Theme } from "../../../core/configuration/Config"; import { Layer } from "./Layer"; import { EventBus } from "../../../core/EventBus"; -import anchorIcon from "../../../../resources/images/AnchorIcon.png"; -import missileSiloIcon from "../../../../resources/images/MissileSiloUnit.png"; -import shieldIcon from "../../../../resources/images/ShieldIcon.png"; -import cityIcon from "../../../../resources/images/CityIcon.png"; +import anchorIcon from "../../../../resources/images/buildings/port1.png"; +import missileSiloIcon from "../../../../resources/images/buildings/silo1.png"; +import shieldIcon from "../../../../resources/images/buildings/fort0.png"; +import cityIcon from "../../../../resources/images/buildings/city1.png"; import { GameView, UnitView } from "../../../core/game/GameView"; import { Cell, UnitType } from "../../../core/game/Game"; import { GameUpdateType } from "../../../core/game/GameUpdates"; @@ -30,8 +30,13 @@ export class StructureLayer implements Layer { private readonly unitConfigs: Partial> = { [UnitType.Port]: { icon: anchorIcon, - borderRadius: 8, - territoryRadius: 6, + borderRadius: 8.525, + territoryRadius: 6.525, + }, + [UnitType.City]: { + icon: cityIcon, + borderRadius: 8.525, + territoryRadius: 6.525, }, [UnitType.MissileSilo]: { icon: missileSiloIcon, @@ -43,11 +48,6 @@ export class StructureLayer implements Layer { borderRadius: 8, territoryRadius: 6, }, - [UnitType.City]: { - icon: cityIcon, - borderRadius: 8, - territoryRadius: 6, - }, }; constructor( diff --git a/src/core/game/GameMap.ts b/src/core/game/GameMap.ts index 8bf1b8ce2..206532d5d 100644 --- a/src/core/game/GameMap.ts +++ b/src/core/game/GameMap.ts @@ -321,7 +321,16 @@ export function euclDistFN( root: TileRef, dist: number, ): (gm: GameMap, tile: TileRef) => boolean { - return (gm: GameMap, n: TileRef) => gm.euclideanDist(root, n) <= dist; + return (gm: GameMap, n: TileRef) => { + // shifts the root tile’s coordinates by -0.5 so that its “center” + // center becomes the corner of four pixels rather than the middle of one pixel. + // just makes things based off even pixels instead of odd. Used to use 9x9 icons now 10x10 icons etc... + const rootX = gm.x(root) - 0.5; + const rootY = gm.y(root) - 0.5; + const dx = gm.x(n) - rootX; + const dy = gm.y(n) - rootY; + return Math.sqrt(dx * dx + dy * dy) <= dist; + }; } export function manhattanDistFN(