From 0ab96c93ebb2f1b87f6476929ecb14d6f6fb4a49 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Wed, 3 Jul 2024 21:45:24 +0530 Subject: [PATCH] marble reflection things and platform icons --- data/ui/mp/play/platform_android.png | Bin 0 -> 300 bytes data/ui/mp/play/platform_android_white.png | Bin 0 -> 314 bytes data/ui/mp/play/platform_desktop.png | Bin 0 -> 275 bytes data/ui/mp/play/platform_desktop_white.png | Bin 0 -> 289 bytes data/ui/mp/play/platform_mac.png | Bin 0 -> 256 bytes data/ui/mp/play/platform_mac_white.png | Bin 0 -> 268 bytes data/ui/mp/play/platform_unknown.png | Bin 0 -> 349 bytes data/ui/mp/play/platform_unknown_white.png | Bin 0 -> 363 bytes data/ui/mp/play/platform_web.png | Bin 0 -> 388 bytes data/ui/mp/play/platform_web_white.png | Bin 0 -> 450 bytes data/ui/mp/play/spectator.png | Bin 0 -> 889 bytes src/Marble.hx | 24 ++++++++-------- src/Settings.hx | 2 +- src/gui/GuiMLTextListCtrl.hx | 2 ++ src/gui/JoinServerGui.hx | 28 +++++++++++++++++-- src/gui/MPPlayMissionGui.hx | 31 +++++++++++++++++++-- src/shaders/CubemapRenderer.hx | 10 +++++-- 17 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 data/ui/mp/play/platform_android.png create mode 100644 data/ui/mp/play/platform_android_white.png create mode 100644 data/ui/mp/play/platform_desktop.png create mode 100644 data/ui/mp/play/platform_desktop_white.png create mode 100644 data/ui/mp/play/platform_mac.png create mode 100644 data/ui/mp/play/platform_mac_white.png create mode 100644 data/ui/mp/play/platform_unknown.png create mode 100644 data/ui/mp/play/platform_unknown_white.png create mode 100644 data/ui/mp/play/platform_web.png create mode 100644 data/ui/mp/play/platform_web_white.png create mode 100644 data/ui/mp/play/spectator.png diff --git a/data/ui/mp/play/platform_android.png b/data/ui/mp/play/platform_android.png new file mode 100644 index 0000000000000000000000000000000000000000..4f78b698e5c7c43c7dc063c02ac7310844802767 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r)EAj~ML;ne^XJm~4-7-Hf7cFIFuMn{3xey$e{d@mf>y#l&~ zE-;D)Fo|AZw7S6fzV~Lz&bc>xZ_nTN6^-^E z`QP|`Js>i-E@$=Eybmf<&&q6i-W{bs&n)rR1<81gHQmwrZL)>ol||yOPcc_aIHfkn s%zEFCheAeIn$_FVdQ&MBb@0Jo=c82|tP literal 0 HcmV?d00001 diff --git a/data/ui/mp/play/platform_android_white.png b/data/ui/mp/play/platform_android_white.png new file mode 100644 index 0000000000000000000000000000000000000000..342dd87b69c7ec6acf7c2743d470ecbd26883779 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r)^Ak4U9V)k30;CW9M#}Etuw^I^%4;cuwa&tK_K46e}z`z-C zfKe!c&w+x`#4X+Q@LNS%G}c0*}aI1_r)EAj~ML;ne^XT;b{B7-Hd{EK%7Y=+)f7C~&^rz>|r;p+ZSO zo}q98Zw&ttE(e}z3XB#Eh9@pK81QqxVNWWGxxs(rxuOpno0^8NsX>;)(}q`UO3R%C zHVHC3YE6*)ctF0x@fXiQ8x;nx1q;4>k>maEe&|J!!5oGoF3b~>W;C)YFxE6kdOc=h zbdcdYB9$P=%*-y(-1L%ZMmwuOmq@Jw+td6Bj0!wl+SLkjtOf@TFfc4hmUnkF5O4>& OnZeW5&t;ucLK6V`tWB^0 literal 0 HcmV?d00001 diff --git a/data/ui/mp/play/platform_desktop_white.png b/data/ui/mp/play/platform_desktop_white.png new file mode 100644 index 0000000000000000000000000000000000000000..319801d0e645ddfe4ffc096a1cb9b6a2cfa9e5b4 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r)^Ak4U9V)k30;5JVe#}EtuEk%IIN`3^^+&IGxS3xJF^sV0kN z`ye;oB{B=tr5P3CIGzde|7nz1!apZx0x!!_)qq({s(C34K|IXz3rwsuSRSz|ux)DG z;lLztc$139V-^l!YXy-uMhBixLOcyO6u1kRoY-D58)|UqIT)V!{mr3ASm1H$qyq{5 c?L0gTnOYiOWzT#m0Q!Kz)78&qol`;+06TeAVE_OC literal 0 HcmV?d00001 diff --git a/data/ui/mp/play/platform_mac.png b/data/ui/mp/play/platform_mac.png new file mode 100644 index 0000000000000000000000000000000000000000..009915ee8e6cd2a6a6dc668c70d768f56ab2cb9d GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r)EAj~ML;ne^Xoa*V~7-Hd{EK%7Y=+)f7C~&^rz>|r;p+ZSO zo}q98Zw&ttE{7V%Gsgv65qQVWU zfJJ@`kN6Yhv=}-$9cDxvWK-~CF?3*KW7ufh!OWt-yfIUUC27LK8%07MGARlj`#6jQ urieSNS%G}c0*}aI1_r)^Ak4U9V)k30;6hIq#}EtuW||`((l9#0hd0@0gxWVNl5Bf7qnTs^B9Mz;Q&rK_WVi zy)(bzlDH#V(NS%G}c0*}aI1_r)EAj~ML;ne^X{N(B47-HeSc1k}lqoIsjKj#bvX#+;-4UIEg zd>S|n7}XB2ZMz<~c~|C*Z9egOpYtXxk2$@0rOvto zd*7Uzz4DKN0Z&eL0c%{UVO7UUl`ZM37+CfR?LEyuYun#6)!TyGH#O-CM3{ZDHNQ5o zHY`F>ghRJ-lDPIl$E3zHO;0~^Mkp~GB(!Vnb%HVNW?&GrbV>U>0)9(%lkbb-NC`8wy0 rxcEI5(>KOG<#@Z~^Q0A>I@QdM3$42kiM1F2eb3gTe~DWM4fjn#t2 literal 0 HcmV?d00001 diff --git a/data/ui/mp/play/platform_unknown_white.png b/data/ui/mp/play/platform_unknown_white.png new file mode 100644 index 0000000000000000000000000000000000000000..07f54b8fb3843332fc5f3d306b6d89daab8f7223 GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r)^Ak4U9V)k301_nZa=-(Ryj5va zcHcRfA71Iy=>Ai&J~q|)xWPAnca0D3*Y+Nt;qBDE?o&i#>3hw*O@cSRp5LF7YX5M0 zP9iJQWw&d^@8|w1->RF`cww@5=#j>9CwoUNsQ53m7R^umMdo!7BSC!wPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TocH#>^EXC1*z| zH$j;29HkH`hqz26&x}naIEXdVFcRI^0--Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940ar;xK~y+Tt(1XH z!!Qs<(@ww$WrCIoC>ziXV1qINumKy;4GI%bCIBX&QU)j+z<-WyU9Q(4M4$BK*m1t^ z&UQv^+cw8!oZF)@6yb?9%Q|O3yi2drCiMai8DjF7+X#%WbK4_Ic`3a}hs;*eR(g}J z7_j&VF~N*w!nOX;C;fT%!|nENg^VQtQp)$ z6X`Pbgg5jbu=1jN3}GQOO+8@^IT}R6ss+D51V^ZDpf%)U>i8fP)1CC~MBO}f6Rjbk zml|4APpwx5v%1UH@I&GyMTQ~M0&@w1+mrC;ki$yqoV5aJ*OUx*65~Y7Sxoh|5du5P zinpoPL8K8Fa;vz4b@RL-btFwDb7M&9UW#^`F&69nD7+ysi4-vVl%lIxehzyz9{PO& s_2JN#-N)!Tw^7u;8vdCm<$usLKQ{|mi>YjnLI3~&07*qoM6N<$f{P)!=l}o! literal 0 HcmV?d00001 diff --git a/data/ui/mp/play/spectator.png b/data/ui/mp/play/spectator.png new file mode 100644 index 0000000000000000000000000000000000000000..678aaaec4321264a0d59e003202dd2f5344c94bc GIT binary patch literal 889 zcmeAS@N?(olHy`uVBq!ia0y~yVAKP$D>&GIq|XC+Ss*1@;u=vBoS#-wo>-L1;Fyx1 zl&avFo0y&&l$w}QS$HzlhJk@u+SA1`q~g|_+xxwu17!|;yfgcViBw>SOpu01j10@d zyGzB~=O0+;?NY-q{}6jYdGRO3O;%RZ9!+!77P+Oc_1f*^y@w9|_deVCx8}j|y^-%Z z(DC$95ft?O>vHV3<0zx_^r>k8$-Jx1N#6F#yW+*J_gSNL{c#Tli( z_Lb8If5;GrLAKfl-o7DxTv(M%vCns;x=-Pjf zE8PF-N^!;Af1)Qoue|uStX@V&X3mt2yJlQA*nes#*Uh;fSGBVKc`%X5|EiKR4E!n4)S=e6w`0?ZSuU}Q=_4WU=e^dx=n1Au&$7A1a zY!r~#@$%)%k9Y6hE%)~Jp8PO*ana9LtD<&3j$Kl~=$WxK>g?RPbIntCJo;ZIpr;V~ z`SWM}>({O=TO@mZ?MER!1L5H$RVx}!*GaIAqLC_5+F8E096u0 z0J~~j+7A>@xgB7iW?!%;2fz=k7Qn;$c^x$VBY&h_J_$4r;D zZ`fcUrFV5xp!p-!7>A;;u&`x^mWKJs7(8UUv}MnpJABjKW=u5rYLxIZ^gs)@$GJz3 z9=&xy2{U(YbN&Ufu3pyKZ$IDivKn3mAD)($du%w{QP$cV@Lw#8soX zuWK~Abo)6xBKP0_f9dsCJ6SooIy);XtKZ587&5Dyr|+A)WCAcRF?hQAxvX = []; var curSelection = -1; - var serverList = new GuiTextListCtrl(markerFelt18, [], 0xFFFFFF); + var serverList = new GuiMLTextListCtrl(markerFelt18, [], imgLoader); serverList.position = new Vector(0, 0); serverList.extent = new Vector(475, 63); serverList.scrollable = true; @@ -172,7 +196,7 @@ class JoinServerGui extends GuiImage { var platformToString = ["unknown", "pc", "mac", "web", "android"]; function updateServerListDisplay() { - serverDisplays = ourServerList.map(x -> '${x.name}'); + serverDisplays = ourServerList.map(x -> '${x.name}'); serverList.setTexts(serverDisplays); } diff --git a/src/gui/MPPlayMissionGui.hx b/src/gui/MPPlayMissionGui.hx index 1189aed9..ba99bcaa 100644 --- a/src/gui/MPPlayMissionGui.hx +++ b/src/gui/MPPlayMissionGui.hx @@ -48,7 +48,7 @@ class MPPlayMissionGui extends GuiImage { var previewToken:Int = 0; #end - var playerListCtrl:GuiTextListCtrl; + var playerListCtrl:GuiMLTextListCtrl; var chatInput:GuiTextInput; var chatScroll:GuiScrollCtrl; var chatBox:GuiMLText; @@ -341,12 +341,36 @@ class MPPlayMissionGui extends GuiImage { parTime.text.lineSpacing = -1; window.addChild(parTime); + function imgLoader(path:String) { + var t = switch (path) { + case "ready": + ResourceLoader.getResource("data/ui/mp/play/Ready.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "notready": + ResourceLoader.getResource("data/ui/mp/play/NotReady.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "pc": + ResourceLoader.getResource("data/ui/mp/play/platform_desktop_white.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "mac": + ResourceLoader.getResource("data/ui/mp/play/platform_mac_white.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "web": + ResourceLoader.getResource("data/ui/mp/play/platform_web_white.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "android": + ResourceLoader.getResource("data/ui/mp/play/platform_android_white.png", ResourceLoader.getImage, this.imageResources).toTile(); + case "unknown": + ResourceLoader.getResource("data/ui/mp/play/platform_unknown_white.png", ResourceLoader.getImage, this.imageResources).toTile(); + case _: + return null; + }; + if (t != null) + t.scaleToSize(t.width * (Settings.uiScale), t.height * (Settings.uiScale)); + return t; + } + var playersBox = new GuiControl(); playersBox.position = new Vector(463, 279); playersBox.extent = new Vector(305, 229); window.addChild(playersBox); - playerListCtrl = new GuiTextListCtrl(markerFelt18, [], 0xFFFFFF); + playerListCtrl = new GuiMLTextListCtrl(markerFelt18, [], imgLoader); playerListCtrl.position = new Vector(0, 26); playerListCtrl.extent = new Vector(305, 203); playerListCtrl.scrollable = true; @@ -671,7 +695,8 @@ class MPPlayMissionGui extends GuiImage { } } - var playerListCompiled = playerListArr.map(player -> player.name); + var playerListCompiled = playerListArr.map(player -> + '${player.name}'); playerListCtrl.setTexts(playerListCompiled); // if (!showingCustoms) diff --git a/src/shaders/CubemapRenderer.hx b/src/shaders/CubemapRenderer.hx index b49dfdb9..726d16dc 100644 --- a/src/shaders/CubemapRenderer.hx +++ b/src/shaders/CubemapRenderer.hx @@ -21,11 +21,15 @@ class CubemapRenderer { var lastRenderTime:Float = 0; var usingSky:Bool = false; - public function new(scene:Scene, sky:Sky) { + public function new(scene:Scene, sky:Sky, useSky = false) { this.scene = scene; this.sky = sky; - this.cubemap = new Texture(128, 128, [Cube, Dynamic, Target], h3d.mat.Data.TextureFormat.RGB8); - this.cubemap.depthBuffer = new h3d.mat.DepthBuffer(128, 128, h3d.mat.DepthBuffer.DepthFormat.Depth16); + if (useSky) + this.cubemap = sky.cubemap; + else { + this.cubemap = new Texture(128, 128, [Cube, Dynamic, Target], h3d.mat.Data.TextureFormat.RGBA); + this.cubemap.depthBuffer = new h3d.mat.DepthBuffer(128, 128, h3d.mat.DepthBuffer.DepthFormat.Depth16); + } this.camera = new Camera(90, 1, 1, 0.02, scene.camera.zFar); this.position = new Vector(); this.nextFaceToRender = 0;