Skip to content

Commit

Permalink
Merge pull request #10 from Tranquiliti/dev
Browse files Browse the repository at this point in the history
Update v2.1.1
  • Loading branch information
Tranquiliti authored Aug 24, 2024
2 parents fdeaca9 + a660911 commit 82410db
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 89 deletions.
17 changes: 17 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Version 2.1.1

* Added "numAsteroids" option for "asteroid_field" and "asteroid_belt" entities
* Added "hyperspaceCenter" setting to settings.json
- Used to determine the closest constellations for the normal "setLocation" option
* Added "systemSpacing" setting to settings.json
- Adds to the minimum distance a custom star system generates away from other star systems when using the normal "setLocation" option
- Increased default spacing to 150 units (from 100)
* Added "marketMemoryKeys" option for planets and stations
- Similar to "memoryKeys", but for the market of any planet or station (including uninhabited planets and abandoned stations)
* Added String support for "memoryKeys" and "marketMemoryKeys"
* "station" entities can now use the "condition" option regardless of "marketSize"
- I.e. abandoned stations can now have custom conditions
* Some code refactors



Version 2.1.0

* Added "teleportUponGeneration" option for custom star systems
Expand Down
4 changes: 2 additions & 2 deletions customizablestarsystems.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{
"major":2,
"minor":1,
"patch":0
"patch":1
},
"starsectorVersion":"0.97a-RC11",
"directDownloadURL":"https://github.com/Tranquiliti/CustomizableStarSystems/releases/download/v2.1.0/CustomizableStarSystems-v2.1.0.zip",
"directDownloadURL":"https://github.com/Tranquiliti/CustomizableStarSystems/releases/download/v2.1.1/CustomizableStarSystems-v2.1.1.zip",
"changelogURL":"https://raw.githubusercontent.com/Tranquiliti/CustomizableStarSystems/main/changelog.txt"
}
29 changes: 24 additions & 5 deletions data/config/referenceStarSystem.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@
"orbitDays":0,

# For ADVANCED users only!
# A map of memory keys and values added to this entity's memory
# Only Boolean values are currently supported for each memory key
# A map of memory keys and values to add or replace in the memory of this entity
# Only Boolean and String values are currently supported for each memory key
# Defaults to not applying any additional memory keys if this entry is ommitted
"memoryKeys":{
"$example_mem_key":true,
"$example_mem_key_2":false,
"$example_mem_key_2":"example_value",
}
},
{ # A star, made as part of the system center
Expand Down Expand Up @@ -365,6 +365,16 @@
# Defaults to 0, or uninhabited, if this entry is omitted
"marketSize":0,

# For ADVANCED users only!
# A map of memory keys and values to add or replace in the memory of this planet's market
# (Note that uninhabited planets and abandoned stations also generate with a market)
# Only Boolean and String values are currently supported for each memory key
# Defaults to not applying any additional memory keys if this entry is ommitted
"marketMemoryKeys":{
"$example_mem_key":true,
"$example_mem_key_2":"example_value",
},

#------------------------------------------------------------#
# Planet entries below require "marketSize" to be at least 1 #
#------------------------------------------------------------#
Expand Down Expand Up @@ -459,7 +469,9 @@
"orbitClockwise":true,
"name":"Placeholder Station",
"customDescriptionId":"station_chupi_orco",
"conditions":[],
"memoryKeys":{},
"marketMemoryKeys":{},

# Type of station graphic to use
# Station graphics are found in starsector-core/graphics/stations
Expand All @@ -479,7 +491,6 @@
#-------------------------------------------------------------#
"freePort":false,
"aiCoreAdmin":false,
"conditions":[],
"industries":["population","spaceport"],
},
{ # Remnant battlestation
Expand Down Expand Up @@ -508,6 +519,10 @@
# Size of the asteroid field
# Defaults to 400 if this entry is omitted
"size":400,

# Number of interactable asteroids within the asteroid field
# Defaults to proc-gen settings if this entry is omitted or is set to a negative number
"numAsteroids":100
},
{ # Accretion disk
"entity":"accretion_disk",
Expand Down Expand Up @@ -599,7 +614,11 @@

# Size of the asteroid belt
# Defaults to 256 if this entry is omitted
"size":256
"size":256,

# Number of interactable asteroids within the asteroid belt
# Defaults to proc-gen settings if this entry is omitted or is set to a negative number
"numAsteroids":250
},
{ # Custom entities (also the default option for handling unrecognized or modded entities)
# Custom entity IDs can be found in starsector-core/data/config/custom_entities.json
Expand Down
11 changes: 10 additions & 1 deletion data/config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@
{
# Generates custom star systems upon starting a new game
# Custom star systems can be configured in customStarSystems.json
"enableCustomStarSystems":true,
"customizablestarsystems_enableCustomStarSystems":true,

# The hyperspace coordinates used to determine the closest constellations for the "setLocation" option
# Default values (-4531,-5865) provide the centroid point of all vanilla THEME_CORE systems
# Only applies to systems not using the [x,y] "setLocation" option
"customizablestarsystems_hyperspaceCenter":[-4531,-5865],

# Additional distance a custom star system generates away from other star systems when using "setLocation"
# Only applies to systems not using the [x,y] "setLocation" option
"customizablestarsystems_systemSpacing":150
}
8 changes: 6 additions & 2 deletions data/strings/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"mod_id_customizablestarsystems":"customizablestarsystems",

# Settings in settings.json
"settings_enableCustomStarSystems":"enableCustomStarSystems",
"settings_enableCustomStarSystems":"customizablestarsystems_enableCustomStarSystems",
"settings_hyperspaceCenter":"customizablestarsystems_hyperspaceCenter",
"settings_systemSpacing":"customizablestarsystems_systemSpacing",

# Main system options in customStarSystems.json
"opt_isEnabled":"isEnabled",
Expand Down Expand Up @@ -48,7 +50,8 @@
"opt_freePort":"freePort",
"opt_aiCoreAdmin":"aiCoreAdmin",
"opt_industries":"industries",
"opt_memory_keys":"memoryKeys",
"opt_memoryKeys":"memoryKeys",
"opt_marketMemoryKeys":"marketMemoryKeys",

# Sub-options for "opt_specChanges"
"opt_atmosphereColor":"atmosphereColor",
Expand All @@ -71,6 +74,7 @@
# Sub-options for certain entities
"opt_isDamaged":"isDamaged",
"opt_size":"size",
"opt_numAsteroids":"numAsteroids",
"opt_innerBandIndex":"innerBandIndex",
"opt_outerBandIndex":"outerBandIndex",
"opt_bandIndex":"bandIndex",
Expand Down
Binary file modified jars/CustomizableStarSystems.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name":"Customizable Star Systems",
"author":"Tranquility",
"utility":"true",
"version":{"major":2,"minor":1,"patch":0},
"version":{"major":2,"minor":1,"patch":1},
"description":"Adds customizable star systems, editable through a JSON config file.",
"gameVersion":"0.97a-RC11",
"jars":["jars/CustomizableStarSystems.jar"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void onGameLoad(boolean newGame) {
// Generates mod systems after proc-gen so that planet markets can properly generate
@Override
public void onNewGameAfterProcGen() {
boolean doCustomStarSystems = LUNALIB_ENABLED ? Boolean.TRUE.equals(CSSLunaUtil.getBoolean(MOD_ID_CUSTOMIZABLE_STAR_SYSTEMS, SETTINGS_ENABLE_CUSTOM_STAR_SYSTEMS)) : Global.getSettings().getBoolean(SETTINGS_ENABLE_CUSTOM_STAR_SYSTEMS);
boolean doCustomStarSystems = LUNALIB_ENABLED ? Boolean.TRUE.equals(CSSLunaUtil.getBoolean(MOD_ID_CUSTOMIZABLE_STAR_SYSTEMS, SETTINGS_ENABLE_CUSTOM_STAR_SYSTEMS.replace(MOD_ID_CUSTOMIZABLE_STAR_SYSTEMS + '_', ""))) : Global.getSettings().getBoolean(SETTINGS_ENABLE_CUSTOM_STAR_SYSTEMS);
if (doCustomStarSystems) try {
generateCustomStarSystems();
} catch (Exception e) {
Expand Down
8 changes: 6 additions & 2 deletions src/org/tranquility/customizablestarsystems/CSSStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
* A class containing the strings.json entries for this mod
*/
public final class CSSStrings {
public static final String STRINGS_CATEGORY = "customizablestarsystems";
private static final String STRINGS_CATEGORY = "customizablestarsystems";

public static final String MOD_ID_CUSTOMIZABLE_STAR_SYSTEMS = Global.getSettings().getString(STRINGS_CATEGORY, "mod_id_customizablestarsystems");

// Settings in settings.json
public static final String SETTINGS_ENABLE_CUSTOM_STAR_SYSTEMS = Global.getSettings().getString(STRINGS_CATEGORY, "settings_enableCustomStarSystems");
public static final String SETTINGS_HYPERSPACE_CENTER = Global.getSettings().getString(STRINGS_CATEGORY, "settings_hyperspaceCenter");
public static final String SETTINGS_SYSTEM_SPACING = Global.getSettings().getString(STRINGS_CATEGORY, "settings_systemSpacing");

// Main system options in customStarSystems.json
public static final String OPT_IS_ENABLED = Global.getSettings().getString(STRINGS_CATEGORY, "opt_isEnabled");
Expand Down Expand Up @@ -49,7 +51,8 @@ public final class CSSStrings {
public static final String OPT_FREE_PORT = Global.getSettings().getString(STRINGS_CATEGORY, "opt_freePort");
public static final String OPT_AI_CORE_ADMIN = Global.getSettings().getString(STRINGS_CATEGORY, "opt_aiCoreAdmin");
public static final String OPT_INDUSTRIES = Global.getSettings().getString(STRINGS_CATEGORY, "opt_industries");
public static final String OPT_MEMORY_KEYS = Global.getSettings().getString(STRINGS_CATEGORY, "opt_memory_keys");
public static final String OPT_MEMORY_KEYS = Global.getSettings().getString(STRINGS_CATEGORY, "opt_memoryKeys");
public static final String OPT_MARKET_MEMORY_KEYS = Global.getSettings().getString(STRINGS_CATEGORY, "opt_marketMemoryKeys");

// Sub-options for "specChanges"
public static final String OPT_ATMOSPHERE_COLOR = Global.getSettings().getString(STRINGS_CATEGORY, "opt_atmosphereColor");
Expand All @@ -72,6 +75,7 @@ public final class CSSStrings {
// Sub-options for certain entities
public static final String OPT_IS_DAMAGED = Global.getSettings().getString(STRINGS_CATEGORY, "opt_isDamaged");
public static final String OPT_SIZE = Global.getSettings().getString(STRINGS_CATEGORY, "opt_size");
public static final String OPT_NUM_ASTEROIDS = Global.getSettings().getString(STRINGS_CATEGORY, "opt_numAsteroids");
public static final String OPT_INNER_BAND_INDEX = Global.getSettings().getString(STRINGS_CATEGORY, "opt_innerBandIndex");
public static final String OPT_OUTER_BAND_INDEX = Global.getSettings().getString(STRINGS_CATEGORY, "opt_outerBandIndex");
public static final String OPT_BAND_INDEX = Global.getSettings().getString(STRINGS_CATEGORY, "opt_bandIndex");
Expand Down
7 changes: 3 additions & 4 deletions src/org/tranquility/customizablestarsystems/CSSUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import java.io.IOException;
import java.util.Map;

import static org.tranquility.customizablestarsystems.CSSStrings.MOD_ID_CUSTOMIZABLE_STAR_SYSTEMS;
import static org.tranquility.customizablestarsystems.CSSStrings.PATH_MERGED_JSON_CUSTOM_STAR_SYSTEMS;
import static org.tranquility.customizablestarsystems.CSSStrings.*;

/**
* A utility class for the Customizable Star Systems mod
Expand All @@ -31,7 +30,7 @@ public static JSONObject getMergedSystemJSON() throws JSONException, IOException
}

/**
* Sets admins accordingly on given markets; the Map is cleared afterwards
* Sets admins accordingly on given markets; the Map is cleared afterward
*
* @param marketMap A map of market IDs to the admins to place
*/
Expand All @@ -47,7 +46,7 @@ public static void generateAdminsOnMarkets(Map<MarketAPI, String> marketMap) {
market.setAdmin(aiPlugin.createPerson(Commodities.ALPHA_CORE, market.getFaction().getId(), 0));
break;
}
marketMap.clear(); // No need for the HashMap afterwards, so clear it just in case
marketMap.clear(); // No need for the HashMap afterward, so clear it just in case
}
}

Expand Down
Loading

0 comments on commit 82410db

Please sign in to comment.