From ffa7256e5ad6741a8cd4ca292ae9541573ca4eb4 Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Mon, 14 Dec 2020 04:43:27 +0000 Subject: [PATCH 1/7] add ContentInitEvent (#3951) * add ContentInit(ialized)Event * a * a --- core/assets/scripts/global.js | 1 + core/src/mindustry/core/ContentLoader.java | 4 ++++ core/src/mindustry/core/Control.java | 2 +- core/src/mindustry/core/Renderer.java | 5 ++++- core/src/mindustry/game/EventType.java | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/assets/scripts/global.js b/core/assets/scripts/global.js index 549bcb9b54..92a7fd5562 100755 --- a/core/assets/scripts/global.js +++ b/core/assets/scripts/global.js @@ -165,6 +165,7 @@ const SectorInvasionEvent = Packages.mindustry.game.EventType.SectorInvasionEven const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent const ClientLoadEvent = Packages.mindustry.game.EventType.ClientLoadEvent +const ContentInitEvent = Packages.mindustry.game.EventType.ContentInitEvent const BlockInfoEvent = Packages.mindustry.game.EventType.BlockInfoEvent const CoreItemDeliverEvent = Packages.mindustry.game.EventType.CoreItemDeliverEvent const TurretAmmoDeliverEvent = Packages.mindustry.game.EventType.TurretAmmoDeliverEvent diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index c3c0918d44..2696639240 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -1,5 +1,6 @@ package mindustry.core; +import arc.*; import arc.files.*; import arc.func.*; import arc.graphics.*; @@ -7,8 +8,10 @@ import arc.struct.*; import arc.util.*; import mindustry.content.*; import mindustry.ctype.*; +import mindustry.game.EventType.*; import mindustry.entities.bullet.*; import mindustry.mod.Mods.*; +import mindustry.net.*; import mindustry.type.*; import mindustry.world.*; @@ -97,6 +100,7 @@ public class ContentLoader{ public void init(){ initialize(Content::init); if(constants != null) constants.init(); + Events.fire(new ContentInitEvent()); } /** Calls Content#load() on everything. Use only after all modules have been created on the client.*/ diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 00d4096e78..f4f3dc75df 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -424,7 +424,7 @@ public class Control implements ApplicationListener, Loadable{ net.dispose(); Musics.dispose(); Sounds.dispose(); - ui.editor.dispose(); + if(ui != null && ui.editor != null) ui.editor.dispose(); } @Override diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 7d6ed8c373..ea9e22a3ce 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -111,7 +111,10 @@ public class Renderer implements ApplicationListener{ minimap.dispose(); effectBuffer.dispose(); blocks.dispose(); - planets.dispose(); + if(planets != null){ + planets.dispose(); + planets = null; + } if(bloom != null){ bloom.dispose(); bloom = null; diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 3fd2826cb5..3efe48932e 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -64,6 +64,8 @@ public class EventType{ public static class CoreItemDeliverEvent{} /** Called when the player opens info for a specific block.*/ public static class BlockInfoEvent{} + /** Called *after* all content has been initialized. */ + public static class ContentInitEvent{} /** Called when the client game is first loaded. */ public static class ClientLoadEvent{} /** Called when a game begins and the world is loaded. */ From df1f8b8bb4a5daae76376ced58704b075d030c56 Mon Sep 17 00:00:00 2001 From: GamyGamer <49346764+GamyGamer@users.noreply.github.com> Date: Mon, 14 Dec 2020 05:46:39 +0100 Subject: [PATCH 2/7] Update bundle_pl.properties (#3964) Added missing lines and fixed typo --- core/assets/bundles/bundle_pl.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle_pl.properties b/core/assets/bundles/bundle_pl.properties index ed9bad9cd0..251c887c84 100644 --- a/core/assets/bundles/bundle_pl.properties +++ b/core/assets/bundles/bundle_pl.properties @@ -13,6 +13,7 @@ link.google-play.description = Strona w sklepie Google Play link.f-droid.description = Wykaz Katalogu F-Droid link.wiki.description = Oficjana Wiki Mindustry link.suggestions.description = Zaproponuj nowe funkcje +link.bug.description = Znalazłeś błąd? Zgłoś go tutaj linkfail = Nie udało się otworzyć linku!\nURL został skopiowany. screenshot = Zapisano zrzut ekranu w {0} screenshot.invalid = Zrzut ekranu jest zbyt duży. Najprawdopodobniej brakuje miejsca w pamięci urządzenia. @@ -511,7 +512,7 @@ resources = Zasoby bannedblocks = Zabronione bloki addall = Dodaj wszystkie launch.from = Wstrzelony Z: [accent]{0} -launch.destination = Cell: {0} +launch.destination = Cel: {0} configure.invalid = Ilość musi być liczbą pomiędzy 0 a {0}. add = Dodaj... boss.health = Zdrowie Strażnika @@ -832,6 +833,7 @@ setting.chatopacity.name = Przezroczystość czatu setting.lasersopacity.name = Przezroczystość laserów zasilających setting.bridgeopacity.name = Przezroczystość mostów setting.playerchat.name = Wyświetlaj czat w grze +setting.showweather.name = Pokaż pogodę public.confirm = Czy chcesz ustawić swoją grę jako publiczną?\n[accent]Każdy będzie mógł dołączyć do Twojej gry.\n[lightgray]Można to później zmienić w Ustawienia->Gra->Widoczność Gry Publicznej. public.beta = Wersje beta gry nie mogą tworzyć publicznych pokoi. uiscale.reset = Skala interfejsu uległa zmianie.\nNaciśnij "OK" by potwierdzić zmiany.\n[scarlet]Cofanie zmian i wyjście z gry za[accent] {0}[] From 5b11dbc0856258173741c515d016c85470d853ed Mon Sep 17 00:00:00 2001 From: YellOw139 <70975516+YellOw139@users.noreply.github.com> Date: Mon, 14 Dec 2020 06:46:50 +0200 Subject: [PATCH 3/7] [Bundle][RO] Translation Update (#3957) This PR was tested in-game and is _**ready to merge at any time**_ (unless marked as draft). Changelog: - New strings/changes up to commit 98c4ee6e74dcb0faba8ba943468cf7b20913325a - Typo fixes & various other improvements --- core/assets/bundles/bundle_ro.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/assets/bundles/bundle_ro.properties b/core/assets/bundles/bundle_ro.properties index 2d914ec648..794403c272 100644 --- a/core/assets/bundles/bundle_ro.properties +++ b/core/assets/bundles/bundle_ro.properties @@ -13,6 +13,7 @@ link.google-play.description = Google Play link.f-droid.description = Catalogul F-Droid link.wiki.description = Wikiul oficial al Mindustry link.suggestions.description = Sugerează noi funcții +link.bug.description = Ai găsit vreunul? Raportează-l aici linkfail = Linkul nu a putut fi deschis!\nAdresa URL a fost copiată. screenshot = Captură de ecran salvată la {0} screenshot.invalid = Harta e prea mare. Se poate să nu existe suficientă memorie pentru captura de ecran. @@ -832,6 +833,7 @@ setting.chatopacity.name = Opacitate Chat setting.lasersopacity.name = Opacitate Laser Electric setting.bridgeopacity.name = Opacitate Poduri setting.playerchat.name = Vezi Chat Temporar +setting.showweather.name = Vezi Vremea public.confirm = Vrei să îți faci jocul public?\n[accent]Oricine va putea intra în jocurile tale.\n[lightgray]Asta se poate schimba mai târziu în Setări->Joc->Vizibilitatea Jocurilor Publice. public.beta = De reținut că versiunile beta ale jocului nu poate face servere publice. uiscale.reset = Scara interfeței a fost schimbată.\nApasă "OK" pt a confirma această scară.\n[scarlet]Revin setările și se iese în [accent] {0}[] secunde... From 5223a89bf1cd6587b43bbe14f27e9c3e6a187f81 Mon Sep 17 00:00:00 2001 From: Sharlotte <60801210+sharlotte-mobile@users.noreply.github.com> Date: Mon, 14 Dec 2020 13:47:00 +0900 Subject: [PATCH 4/7] Update bundle_ko.properties (#3953) fix some miss-translation add translated values --- core/assets/bundles/bundle_ko.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle_ko.properties b/core/assets/bundles/bundle_ko.properties index 4989495103..89c1a49aab 100644 --- a/core/assets/bundles/bundle_ko.properties +++ b/core/assets/bundles/bundle_ko.properties @@ -13,6 +13,7 @@ link.google-play.description = Google Play 스토어 목록 link.f-droid.description = F-Droid 카탈로그 목록 link.wiki.description = 공식 Mindustry 위키 link.suggestions.description = 새 기능 제안하기 +link.bug.description = 버그 제보하기 linkfail = 링크를 열지 못했습니다!\nURL이 클립보드에 복사되었습니다. screenshot = 스크린 캡처가 {0} 에 저장되었습니다. screenshot.invalid = 맵이 너무 커서 스크린 캡처에 사용될 메모리가 부족합니다. @@ -299,7 +300,7 @@ cancelbuilding = [accent][[{0}][] 를 눌러 건설 계획을 초기화 selectschematic = [accent][[{0}][] 를 눌러 선택+복사 pausebuilding = [accent][[{0}][] 를 눌러 건설을 일시중지 resumebuilding = [scarlet][[{0}][] 를 눌러 건설을 재개 -showui = UI를 .\n[accent][[{0}][] 키를 눌러 UI를 활성화 +showui = [accent][[{0}][] 키를 눌러 UI를 활성화 wave = [accent]{0} 단계 wave.cap = [accent]단계 {0}/{1} wave.waiting = 다음 단계까지[lightgray] {0}초 @@ -832,6 +833,7 @@ setting.chatopacity.name = 채팅창 투명도 setting.lasersopacity.name = 전선 투명도 setting.bridgeopacity.name = 터널 투명도 setting.playerchat.name = 채팅 말풍선 표시 +setting.showweather.name = 날씨 그래픽 표시 public.confirm = 게임을 모두에게 공개하시겠습니까?\n[accent]모든 플레이어가 게임에 참여할 수 있습니다.\n[lightgray]설정->게임->멀티플레이 공용 서버로 표시에서 나중에 변경할 수 있습니다.\n\n[sky]번역자 추가[]\n[accent]친구끼리 하려고 이 기능을 활성화 한 뒤에, 친구 외에 다른 플레이어가 들어왔을 때\n해당 플레이어를 차단하는 행위는 비매너를 넘어서는 얌체 행위 그 자체입니다.\n정말로 [scarlet]많은 다른 플레이어들이 오길 원한다[]면 확인하세요. public.beta = 베타 버전의 게임은 공개 서버를 만들 수 없습니다. uiscale.reset = UI 스케일이 변경되었습니다.\n"확인"버튼을 눌러 저장하세요.\n[accent] {0}[][scarlet]초 후에 예전 설정으로 되돌리고 게임을 종료합니다... From 6286b0b275d05f97540c5ffdf145c01b6f657d7e Mon Sep 17 00:00:00 2001 From: alex <67626131+alexpvpmindustry@users.noreply.github.com> Date: Mon, 14 Dec 2020 12:52:15 +0800 Subject: [PATCH 5/7] Add ALEX v6 servers to servers_v6.json (#3927) --- servers_v6.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers_v6.json b/servers_v6.json index 6bb4aae595..65c00516f1 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -54,5 +54,9 @@ { "name": "MindustryBR", "address": ["mindustryptbr.ddns.net", "mindustryptbr.ddns.net:4444", "mindustryptbr.myddns.me:6666", "mindustryptbr.myddns.me:5555"] + }, + { + "name": "ALEX", + "address": ["alexmindustry.ddns.net:6568", "alexmindustry.ddns.net:6569"] } ] From aee5d46dfa0c675d7e01e97be1424899ee33e0fb Mon Sep 17 00:00:00 2001 From: Skat <55407440+skykatik@users.noreply.github.com> Date: Mon, 14 Dec 2020 08:56:13 +0400 Subject: [PATCH 6/7] Code formatting (#3904) --- core/src/mindustry/core/NetServer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index cb5a7fcdee..cb83a7c400 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -284,7 +284,7 @@ public class NetServer implements ApplicationListener{ } StringBuilder result = new StringBuilder(); - result.append(Strings.format("[orange]-- Commands Page[lightgray] @[gray]/[lightgray]@[orange] --\n\n", (page+1), pages)); + result.append(Strings.format("[orange]-- Commands Page[lightgray] @[gray]/[lightgray]@[orange] --\n\n", (page + 1), pages)); for(int i = commandsPerPage * page; i < Math.min(commandsPerPage * (page + 1), clientCommands.getCommandList().size); i++){ Command command = clientCommands.getCommandList().get(i); @@ -347,8 +347,8 @@ public class NetServer implements ApplicationListener{ boolean checkPass(){ if(votes >= votesRequired()){ - Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] @[orange] will be banned from the server for @ minutes.", target.name, (kickDuration/60))); - target.getInfo().lastKicked = Time.millis() + kickDuration*1000; + Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] @[orange] will be banned from the server for @ minutes.", target.name, (kickDuration / 60))); + target.getInfo().lastKicked = Time.millis() + kickDuration * 1000; Groups.player.each(p -> p.uuid().equals(target.uuid()), p -> p.kick(KickReason.vote)); map[0] = null; task.cancel(); From 889c53dc1bf97da9adf4fcc38e425248ebe73313 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 14 Dec 2020 13:26:42 -0500 Subject: [PATCH 7/7] Update SERVERLIST.md --- SERVERLIST.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SERVERLIST.md b/SERVERLIST.md index e4d2b6a284..83aa15a3d7 100644 --- a/SERVERLIST.md +++ b/SERVERLIST.md @@ -1,7 +1,7 @@ ### Adding a server to the list Mindustry now has a public list of servers that everyone can see and connect to. -This is done by letting clients `GET` a [JSON list of servers](https://github.com/Anuken/Mindustry/blob/master/servers.json) in this repository. +This is done by letting clients `GET` a [JSON list of servers](https://github.com/Anuken/Mindustry/blob/master/servers_v6.json) in this repository. You may want to add your server to this list. The steps for getting this done are as follows: @@ -16,7 +16,7 @@ You'll need to either hire some moderators, or make use of (currently non-existe 3. **Get some good maps.** *(optional, but highly recommended)*. Add some maps to your server and set the map rotation to custom-only. You can get maps from the Steam workshop by subscribing and exporting them; using the `#maps` channel on Discord is also an option. 4. **Check your server configuration.** *(optional)* I would recommend adding a message rate limit of 1 second (`config messageRateLimit 1`), and disabling connect/disconnect messages to reduce spam (`config showConnectMessages false`). 5. Finally, **submit a pull request** to add your server's IP to the list. -This should be fairly straightforward: Press the edit button on the [server file](https://github.com/Anuken/Mindustry/blob/master/servers.json), then add a JSON object with a single key, indicating your server address. +This should be fairly straightforward: Press the edit button on the [server file](https://github.com/Anuken/Mindustry/blob/master/servers_v6.json), then add a JSON object with a single key, indicating your server address. For example, if your server address is `google.com`, you would add a comma after the last entry and insert: ```json {