Hidden sector submission thread link button
This commit is contained in:
@@ -51,6 +51,8 @@ public class Vars implements Loadable{
|
||||
public static final int minModGameVersion = 136;
|
||||
/** Min game version for java mods specifically - this is higher, as Java mods have more breaking changes. */
|
||||
public static final int minJavaModGameVersion = 147;
|
||||
/** If true, a button to view sector submission threads is shown. */
|
||||
public static boolean showSectorSubmissions = true;
|
||||
/** If true, the BE server list is always used. */
|
||||
public static boolean forceBeServers = false;
|
||||
/** If true, mod code and scripts do not run. For internal testing only. This WILL break mods if enabled. */
|
||||
|
||||
73
core/src/mindustry/maps/SectorSubmissions.java
Normal file
73
core/src/mindustry/maps/SectorSubmissions.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package mindustry.maps;
|
||||
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
/** Class for temporarily (?) storing links to map submissions on Discord. */
|
||||
public class SectorSubmissions{
|
||||
private static IntMap<String> hiddenMap = new IntMap<>();
|
||||
|
||||
static{
|
||||
//autogenerated
|
||||
hiddenMap.put(0, "https://discord.com/channels/391020510269669376/1379926780860698784");
|
||||
hiddenMap.put(6, "https://discord.com/channels/391020510269669376/1379926782966497322");
|
||||
hiddenMap.put(13, "https://discord.com/channels/391020510269669376/1379926785164312810");
|
||||
hiddenMap.put(16, "https://discord.com/channels/391020510269669376/1379926788280680579");
|
||||
hiddenMap.put(19, "https://discord.com/channels/391020510269669376/1379926792479183019");
|
||||
hiddenMap.put(20, "https://discord.com/channels/391020510269669376/1379926794114961634");
|
||||
hiddenMap.put(24, "https://discord.com/channels/391020510269669376/1379926797042581716");
|
||||
hiddenMap.put(27, "https://discord.com/channels/391020510269669376/1379926798833287289");
|
||||
hiddenMap.put(30, "https://discord.com/channels/391020510269669376/1379926800854945823");
|
||||
hiddenMap.put(47, "https://discord.com/channels/391020510269669376/1379926802591645820");
|
||||
hiddenMap.put(55, "https://discord.com/channels/391020510269669376/1379926823277695189");
|
||||
hiddenMap.put(66, "https://discord.com/channels/391020510269669376/1379926825941078128");
|
||||
hiddenMap.put(67, "https://discord.com/channels/391020510269669376/1379926828696866898");
|
||||
hiddenMap.put(69, "https://discord.com/channels/391020510269669376/1379926831326822610");
|
||||
hiddenMap.put(76, "https://discord.com/channels/391020510269669376/1379926833411391580");
|
||||
hiddenMap.put(92, "https://discord.com/channels/391020510269669376/1379926835621527615");
|
||||
hiddenMap.put(94, "https://discord.com/channels/391020510269669376/1379926838079393802");
|
||||
hiddenMap.put(103, "https://discord.com/channels/391020510269669376/1379926839559979030");
|
||||
hiddenMap.put(111, "https://discord.com/channels/391020510269669376/1379926842659569864");
|
||||
hiddenMap.put(116, "https://discord.com/channels/391020510269669376/1379926845058711734");
|
||||
hiddenMap.put(127, "https://discord.com/channels/391020510269669376/1379926869465632829");
|
||||
hiddenMap.put(133, "https://discord.com/channels/391020510269669376/1379926871227240770");
|
||||
hiddenMap.put(138, "https://discord.com/channels/391020510269669376/1379926873152164004");
|
||||
hiddenMap.put(150, "https://discord.com/channels/391020510269669376/1379926876457537547");
|
||||
hiddenMap.put(157, "https://discord.com/channels/391020510269669376/1379926879502598155");
|
||||
hiddenMap.put(161, "https://discord.com/channels/391020510269669376/1379926882203730024");
|
||||
hiddenMap.put(162, "https://discord.com/channels/391020510269669376/1379926884606808247");
|
||||
hiddenMap.put(176, "https://discord.com/channels/391020510269669376/1379926887203213353");
|
||||
hiddenMap.put(180, "https://discord.com/channels/391020510269669376/1379926889648619580");
|
||||
hiddenMap.put(185, "https://discord.com/channels/391020510269669376/1379926892181983283");
|
||||
hiddenMap.put(191, "https://discord.com/channels/391020510269669376/1379926912004001914");
|
||||
hiddenMap.put(192, "https://discord.com/channels/391020510269669376/1379926914122256449");
|
||||
hiddenMap.put(197, "https://discord.com/channels/391020510269669376/1379926916911599676");
|
||||
hiddenMap.put(200, "https://discord.com/channels/391020510269669376/1379926918429806755");
|
||||
hiddenMap.put(204, "https://discord.com/channels/391020510269669376/1379926921130807447");
|
||||
hiddenMap.put(207, "https://discord.com/channels/391020510269669376/1379926923370827827");
|
||||
hiddenMap.put(225, "https://discord.com/channels/391020510269669376/1379926925719376152");
|
||||
hiddenMap.put(230, "https://discord.com/channels/391020510269669376/1379926927585841163");
|
||||
hiddenMap.put(237, "https://discord.com/channels/391020510269669376/1379926929636851812");
|
||||
hiddenMap.put(242, "https://discord.com/channels/391020510269669376/1379926931923013843");
|
||||
hiddenMap.put(243, "https://discord.com/channels/391020510269669376/1379926955423694978");
|
||||
hiddenMap.put(244, "https://discord.com/channels/391020510269669376/1379926957738954762");
|
||||
hiddenMap.put(245, "https://discord.com/channels/391020510269669376/1379926971286290584");
|
||||
hiddenMap.put(246, "https://discord.com/channels/391020510269669376/1379926973454745600");
|
||||
hiddenMap.put(247, "https://discord.com/channels/391020510269669376/1379926976361533752");
|
||||
hiddenMap.put(248, "https://discord.com/channels/391020510269669376/1379926979129774151");
|
||||
hiddenMap.put(251, "https://discord.com/channels/391020510269669376/1379928042637361382");
|
||||
hiddenMap.put(254, "https://discord.com/channels/391020510269669376/1379928045577703424");
|
||||
hiddenMap.put(259, "https://discord.com/channels/391020510269669376/1379928048245280871");
|
||||
hiddenMap.put(263, "https://discord.com/channels/391020510269669376/1379928050010951694");
|
||||
hiddenMap.put(265, "https://discord.com/channels/391020510269669376/1379928052921929891");
|
||||
}
|
||||
|
||||
/** @return the link to the Discord discussion thread of the specified hidden sector submission. */
|
||||
public static @Nullable String getSectorThread(Sector sector){
|
||||
if(sector.generateEnemyBase){
|
||||
return hiddenMap.get(sector.id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1299,6 +1299,15 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}
|
||||
|
||||
if((sector.hasBase() && mode == look) || canSelect(sector) || (sector.preset != null && sector.preset.alwaysUnlocked) || debugSelect){
|
||||
if(Vars.showSectorSubmissions){
|
||||
String link = SectorSubmissions.getSectorThread(sector);
|
||||
if(link != null){
|
||||
stable.button("@sectors.viewsubmission", Icon.link, () -> {
|
||||
Core.app.openURI(link);
|
||||
}).growX().height(54f).minWidth(170f).padTop(2f).row();
|
||||
}
|
||||
}
|
||||
|
||||
stable.button(
|
||||
mode == select ? "@sectors.select" :
|
||||
sector.isBeingPlayed() ? "@sectors.resume" :
|
||||
|
||||
Reference in New Issue
Block a user