From b9b2892f28a56f6d1e5d58058d7845f4002cd434 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Mon, 5 May 2014 09:39:03 +0200 Subject: [PATCH] Add waypoints support (requires current minetest from git) --- datastorage.lua | 83 +++++++++++ init.lua | 2 + textures/ui_1_icon.png | Bin 0 -> 321 bytes textures/ui_2_icon.png | Bin 0 -> 567 bytes textures/ui_3_icon.png | Bin 0 -> 647 bytes textures/ui_4_icon.png | Bin 0 -> 420 bytes textures/ui_5_icon.png | Bin 0 -> 554 bytes textures/ui_circular_arrows_icon.png | Bin 0 -> 3116 bytes textures/ui_pencil_icon.png | Bin 0 -> 1258 bytes textures/ui_red_icon_background.png | Bin 0 -> 2591 bytes textures/ui_waypoint_set_icon.png | Bin 0 -> 2036 bytes textures/ui_xyz_icon.png | Bin 0 -> 753 bytes textures/ui_xyz_off_icon.png | Bin 0 -> 6092 bytes textures/ui_xyz_on_icon.png | Bin 0 -> 817 bytes waypoints.lua | 215 +++++++++++++++++++++++++++ 15 files changed, 300 insertions(+) create mode 100644 datastorage.lua create mode 100644 textures/ui_1_icon.png create mode 100644 textures/ui_2_icon.png create mode 100644 textures/ui_3_icon.png create mode 100644 textures/ui_4_icon.png create mode 100644 textures/ui_5_icon.png create mode 100644 textures/ui_circular_arrows_icon.png create mode 100644 textures/ui_pencil_icon.png create mode 100644 textures/ui_red_icon_background.png create mode 100644 textures/ui_waypoint_set_icon.png create mode 100644 textures/ui_xyz_icon.png create mode 100644 textures/ui_xyz_off_icon.png create mode 100644 textures/ui_xyz_on_icon.png create mode 100644 waypoints.lua diff --git a/datastorage.lua b/datastorage.lua new file mode 100644 index 0000000..096e35e --- /dev/null +++ b/datastorage.lua @@ -0,0 +1,83 @@ +datastorage={} +datastorage["!registered_players"]={} + +datastorage.save_data = function(table_pointer) + local data = minetest.serialize( datastorage[table_pointer] ) + local path = minetest.get_worldpath().."/datastorage_"..table_pointer..".data" + local file = io.open( path, "w" ) + if( file ) then + file:write( data ) + file:close() + return true + else return nil + end +end + +datastorage.load_data = function(table_pointer) + local path = minetest.get_worldpath().."/datastorage_"..table_pointer..".data" + local file = io.open( path, "r" ) + if( file ) then + local data = file:read("*all") + datastorage[table_pointer] = minetest.deserialize( data ) + file:close() + return true + else return nil + end +end + +datastorage.get_container = function (player, key) + local player_name = player:get_player_name() + local container = datastorage[player_name] + if container[key] == nil then + container[key] = {} + end + datastorage.save_data(player_name) + return container[key] +end + +-- forced save of all player's data +datastorage.save_container = function (player) + local player_name = player:get_player_name() + datastorage.save_data(player_name) +end + + +-- Init +if datastorage.load_data("!registered_players") == nil then + datastorage["!registered_players"]={} + datastorage.save_data("!registered_players") +end + +minetest.register_on_joinplayer(function(player) + local player_name = player:get_player_name() + local registered = nil + for __,tab in ipairs(datastorage["!registered_players"]) do + if tab["player_name"] == player_name then registered = true break end + end + if registered == nil then + local new={} + new["player_name"]=player_name + table.insert(datastorage["!registered_players"],new) + datastorage[player_name]={} + datastorage.save_data("!registered_players") + datastorage.save_data(player_name) + else + datastorage.load_data(player_name) + end +end +) + +minetest.register_on_leaveplayer(function(player) + local player_name = player:get_player_name() + datastorage.save_data(player_name) + datastorage[player_name] = nil +end +) + +minetest.register_on_shutdown(function() + for __,tab in ipairs(datastorage["!registered_players"]) do + if datastorage[tab["player_name"]] == nil then break end + datastorage.save_data(tab["player_name"]) + end +end +) diff --git a/init.lua b/init.lua index 058583d..fb8636b 100644 --- a/init.lua +++ b/init.lua @@ -38,8 +38,10 @@ if creative_inventory then end end +dofile(modpath.."/datastorage.lua") dofile(modpath.."/api.lua") dofile(modpath.."/internal.lua") dofile(modpath.."/callbacks.lua") dofile(modpath.."/register.lua") dofile(modpath.."/bags.lua") +dofile(modpath.."/waypoints.lua") diff --git a/textures/ui_1_icon.png b/textures/ui_1_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9cf95f57e220a4b16efb49e22f6720be54a35834 GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QK$!8;-MT+OLG}_)Usv{fj51srYK|Q{Kspb4x;TbZ+NPHBZ@OiV@^Y=VITrV5c;9C%$ilr)$c+m1ADJSTbVMOj=`XZfFrTSHYn zC#e9@UzQE5^R_JF-OnCZ;v%_+jW5MTqK-92GT_q#?guyOpLFvxtZ8JcNO`u`oufc< z$4&JFImH9(%pXhMC^^^7AHcl*+v@#i=KObUFiBj{zcAQqa?EL+U-By%c@h|yB@QsK w88pC|9qCte&zOhBCg*q6uxf#=Uy^XIzd}1``r~i^fu3RTboFyt=akR{0PYKKh5!Hn literal 0 HcmV?d00001 diff --git a/textures/ui_2_icon.png b/textures/ui_2_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8b6c783cf8b3d890692bbbf0ea011e0ca0846fb3 GIT binary patch literal 567 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QK$!8;-MT+OLG}_)Usv{fj51sr)=GU>41lI=_jGX#skrs_ zrmuHMqQtR}ua|r=;!Y3lUZ%jr8Pk%qTA@iGOYxlF-7l;;_t`n3I#@1+%~-ml8U)4O*MA<73G)9m&kf*PqOof(&$S1eJDh12lp9f*?;HsALs_`=6JZg!PYOGbw#-4 zAD#c}YQrAy4LM}IzN9kO_ma2g;YqJ1>3Q$cT&bD4@$_%^M)lCSjMp2k9?mb~uHX}? z-;uuPbev)M(^LbFEsfIZJD&S$9H?6LSwez?^~c1u4B^g<-&XD7oEK*E%WSjggUlUq zr%e7})%>HfpWychI7D0u%6Z_obg!Jd)E z`QK{IPdPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2i^f3 z3Mm@^`^C8c00IX|L_t(|+U?oDOO;U^$MN?O#eN`3MA03>MJULSY6wH6T3Uh@8-%E# zf1%MeXlQO~YzlO8s3mGL!-kBO0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t^)6_cYGj6E5wcd{BxVfnE7jrYT}rQ(0ow=<~SwzVybV(_2zD^~A(o$IBn z=JO9?G{c)Fr8TBL(ET9ygQtesui?Ifd;se^X5#}k1^PG7ntd=(`Zw)kpWWrJGTv1o z&!*kmbL{AQ&s9_Z_FoWxu;pZ~UxVlaN0*!_by8D8G?(qwOkk3D{@?zPRsoxg*!-RS mM{oZNb&*Mg2H~}&{|q_r7$$X1Hd6*hB!j1`pUXO@geCyEvG0@s literal 0 HcmV?d00001 diff --git a/textures/ui_circular_arrows_icon.png b/textures/ui_circular_arrows_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b69d6987e91c6721661853425dc53466ffe074cd GIT binary patch literal 3116 zcmV+{4Ab+8P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2i^f3 z3II6f+AAOc01K>1L_t(|+U=TqkW|&3$3N%Z+uhT{^t_mnW_SGrIjbaKTDOrgWNR-+{iB+*8;xe%W0umgU;U&W` z%=Eq8eZTuhcMptgc5&^Q$;SD1-Rjfb_ndRT-}8Ija~nF*iB5E)6P;*RsG{Ox`}ya; zp(6a`C#bTrzxwqn`9`k31`fPQUAp{QFyfm>e%P=H3We$f`vv_kJMZ0h{|?FDGcWZ% zdh`SZ0`&q3YGlkZRaVZ^?YG~dg$oB>)^FLe|DS}99n)ps`HL3ct5B#ZOKivS5fi#OUO%>B?W_0ZmyJ{FLmwe>#D1y?%kyxJ)}{iq{)-lYURoyy6L7six^9m zWbL|5HU`Ce3uFj|ps?^SM5C)% zw{E>LCZXq^!z@_PaROYr^1FBIX^97Hn@D<5W!t0|8Ug|Bb|Pj=;m03+T=2cg-y@N@ z2g~}DqM|B>3^~TJV_|H&grcJB@w{(SUw<{pBm{#Q%SZ{4o9oi6*A}y8&1?WY_84aQ z^7a?t@L^G2p6b49m$oMoOtNk4G;tg!MLrznotzw&8N3~nQvmTpW(VU z0ymqQnonB%d+pjBcI^t2pI^cG^N(}#Az`=uJ;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fK5NYMnd#Kni@3{n9 z1FYdGmeRVzu5d8sd)8AF?_iVg_)Y@ktTejwQfkJw0EPJJ8`nQ^hWs(#bKa8pg-1&; z8^5dFI&WJE>F^_tfG_56_Lsz`63cLJA`YOco$YUTPTCSckFWE4y8_P#4B@B8CPB^R z4k7%v(sE|wS7IH0xXxGK72FmC94mqUD+Bk&<7@aU8Xi3Z8yi56=RACOpe1Ask48SH zD2I*Us}ewm|Cp_JcL%o%KwwHye0nasGV-hV%SP~)2Y3q4yL&_1!-nu$&F5tKNI7^* z1L*KWjLX>@dI90_vhZJ&gSRYz4u6hzIZlV#BF6Aq*~s#-O7NBh(BTJZN8K5rtpP~1 zt1OD27xQ>Y((s>Gf;SyNhaaFET%XWh8o&5NLJ#buhCglwZz_Ne-%oLDzt9$4*%Ft+ zPmkROMU+k={6#bPiUa8IeI&;Y2pv(Ns1o?(fAFJb@f8Ko;m?pPGZ=2y@L&Kxso_sq zg)cjR4u6_p=yQUGr;Fp47UVoWD{A=jR^iJ!6YKEZ1WgTvI~svzFk>U16??44mldD@ z-$hW=u+Ux>{!}&aWd&HpzmHSoi1xrT9By>BsT#hl00@5+C&^E>sgmJ{l8cl!&s#a$ zmi=Xn*sdV-e!aFB?HV}>$w(u z>z)0Od;pwy-{`LLnAz=tCF{V<_a_{xBJT6;ISW+eMG*Zj7d=VYfiJ$0Vc1zFxFds+ zEbzNe0v6~1k@c*5hDG?p8;vhoLO992$wqcL@?mgbBQL>nHVK)W0(5pBoXnH_PahQ= z1FIeYl}{r^aV?amX{9eF5Hd3ll&={i3-*e*!s{I=uQFCm;d$TqyfuHohMEXb*ujGTT9sv^hJ@mqz>%07*qoM6N<$g3H2L@c;k- literal 0 HcmV?d00001 diff --git a/textures/ui_red_icon_background.png b/textures/ui_red_icon_background.png new file mode 100644 index 0000000000000000000000000000000000000000..985b37764122737b23be057f507cd613d9ac636d GIT binary patch literal 2591 zcmV+)3gGpLP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01F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khSHc!q&aDIDSbZp z%+?N-@fSbt3VA;qSmRe+z_A-L*=p8q5JAH*b$7EOr!pPRmgmwBh3apc{CP$w1;F9h zG$>0_#5m6QBoV2@la<|u#f1w526pD_0z9|Alt154sk!lRi~>9nUWEV`Bbs4=&Q@kb zEQ;1*KR|->DeZ+VJ4-V7ao>+@ql8!r)W_5TK7B#1zP$I78%&!br9A<$FTmw5!3UP} zLps(A1MqFNyfIRAh4ji@KrfsM6$x;O*`D3_G^F%?>d955x0j%KgT;?a@Jpo6bAJ>g zbe}WW9$jHo0r|^c#kdBnH9$1Q2vuopIOtwfZ~46&S?#gC!ctM>nDx2u`-&@ug(OsC z0Aan8o4+7$M)X_aE1BP z8Cil#DYOjKt{_utY%`6vw=ybCOwH=G2d5->kIe_CB8v~$wBboLWti$A0uGQMmfAI4F*QgO=Ws3d-_-? zvcxliv*WV&9}d_ev$g!~0ObHYssPBVQ>r+g-c}aNsxB75N`IH6L>91lZ@`v1#sypi z0#AiZs;{>KGjph&<^f%p#ap$7hX4xA~Xl?;4tkG(pX zQcLm17YLOdohuM{%l^IvhFjpHTi{P$0{-!cw+u5Qi}rmX@J$1#FW@Zi(fSSX=ew)+&t_}WyeyI6=97XW3l z9s&5#+1c>ftE<=Z5W)SrU-#>N-LLy~zy2rJe*uM9hjW2F5Z3?z002ovPDHLkV1hzE B!T$gN literal 0 HcmV?d00001 diff --git a/textures/ui_waypoint_set_icon.png b/textures/ui_waypoint_set_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6eb46e34f1d9b55c37b156b26f1c1c8927702497 GIT binary patch literal 2036 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^f2 z04EawQS|DAH2S~; zkj8{~V}d;RV2BbQBvI1`gT`-dG!oRngOpxAtOU_&qXET_Xs}{5k|=~y+qAdzdQ0!z z_RgJ|bIx8LKFpaixw+g@+R~{z*_qk%anAp@_J6It_W}Oj+mG(sdHFr}-biJ6(AX_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2_no7Z((i&vLmcrny|j z0lVGrlx3$ZiZVE7nqjCJT~9|9C3-B880?5d`reO3diTZS1Ign@Vv?qJx9$P{A3rrV zQEN)DkRI!~L7U}n^8&I%5JUh->$;u-6m1Mx?pU1l++gmUfjUul=YNX;PV6#|2}78G z^-XkgG)J~hc5?KrAEW&w&knN*@`6ceH%>fL@UczslfKvl&oog6`v2D_aQ!#MX^r3D SQ22KM0000QK$!8;-MT+OLG}_)Usv{fjIyjcs{Fh>{0t0C8$DedLn>~) zo#E{f8Yt3swR-cc6v;j*Rl(S^Zho`AsHn5uQsCm6#^F(f1e` zaX9eTXUb zHf0arkF3Xs9dc9l1dEmCHSJvIo#!r?ZL9L@T+uw%>Lnjmp16@Id3&yVv@%;CBX{z% z2&K|{jF*|O?+}tO|7*Ko)f_e-X0{YzU$Oj6`!{~f>4|&a^lrwS)sr@x7SwKT{Ju<< z@tOKZmk4d{J*gYxI=B9Fx8|0ZbSJd(U-gN^*}O5gRWIiIf7)0PtY)Qo-JI*fy9s}m z*PC&MF#a{VCbnZ)*~M>+Q$3|FXl%FnG&w`ZVK(Eu&b;YI%e~f^7uaq+upo0kGxw#8 zK0g;83%Lckf_KvsHrhu1vy5hX6+5M>`tmD2X(hHNOkeLV`m1)`o%!{au5X1~(mgIU zd=_NZV|n%5)r{|h;0n$ahQbxew+a_nu06ZHb&i3(ziu>N;QW&b6cAG30uau{#g?0?>< zWLMK7bs_N0z_zaIN#zkWX7BhQkG q{qwgU-PKHNKuI*f1mq)I$9!X3pGRSSniw!WGkCiCxvX unified_inventory.hud_colors_max then + color = 1 + end + waypoints[i].color = color + update_hud = true + update_formspec = true + end + + if fields["confirm_rename"..i] then + waypoints[i].edit = false + waypoints[i].name = fields["rename_box"..i] + update_hud = true + update_formspec = true + end + + if update_hud then + unified_inventory.update_hud (player, waypoints[i]) + end + + if update_formspec then + unified_inventory.set_inventory_formspec(player, "waypoints") + end + + end +end) + +minetest.register_on_joinplayer(function(player) + local waypoints = datastorage.get_container (player, "waypoints") + local need_save = false + -- Create new waypoints data + for i = 1, 5, 1 do + if waypoints[i] == nil then + need_save = true + waypoints[i] = { + edit = false, + active = false, + display_pos = true, + color = 1, + name = "Waypoint ".. i, + world_pos = {x = 0, y = 0, z = 0}, + } + end + end + if need_save then datastorage.save_container (player) end + + -- Initialize waypoints + minetest.after(0.5, function() + waypoints.selected = 1 + for i = 1, 5, 1 do + waypoints[i].edit = false + unified_inventory.update_hud (player, waypoints[i]) + end + end) +end)