diff --git a/README.md b/README.md index 059afb886..994bf06b6 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,12 @@ mod_info.json # the usual content, no need for mod plugin ## Integration with Other Mods -See various CSV files in [data/stelnet](assets/data/stelnet/) directory. +To be able to exclude/include markets and storages in the Stelnet intel tab results +see various CSV files in [data/stelnet](assets/data/stelnet) directory. +For example, to exclude a faction in your mod create a file: +`starsector/mods/{your_mod_dir}/data/stelnet/exclude/market_by_faction.csv` +with content: +```text +id +hegemony +``` diff --git a/assets/mod_info.json b/assets/mod_info.json index 635a134e1..63cc68dcb 100644 --- a/assets/mod_info.json +++ b/assets/mod_info.json @@ -3,7 +3,7 @@ "name": "Stellar Networks", "author": "Jaghaimo", "utility": true, - "version": "3.2.2", + "version": "3.2.3", "description": "A collection of intel boards for Starsector", "gameVersion": "0.98a-RC7", "modPlugin": "stelnet.StelnetMod", diff --git a/assets/stelnet.version b/assets/stelnet.version index 5224698d6..247f6030a 100644 --- a/assets/stelnet.version +++ b/assets/stelnet.version @@ -5,8 +5,8 @@ "modVersion": { "major": 3, "minor": 2, - "patch": 2 + "patch": 3 }, - "directDownloadURL": "https://github.com/jaghaimo/stelnet/releases/download/3.2.2/stelnet-3.2.2.zip", + "directDownloadURL": "https://github.com/jaghaimo/stelnet/releases/download/3.2.3/stelnet-3.2.3.zip", "changelogURL": "https://raw.githubusercontent.com/jaghaimo/stelnet/master/changelog.txt" } diff --git a/changelog.txt b/changelog.txt index be21cd33b..3fb1d462c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,12 @@ Unreleased (TBD) +Version 3.2.3 (2025.05.12) +- Fix bug causing the game to crash when trying to start a new campaign with the Stelnet "Uninstall Mod" flag set to true. +- Change Commodities Intel tab to filter out markets returned by the `Excluder` - related files: + `market_by_faction.csv`, `market_by_id.csv`, `market_by_system.csv`, `market_by_tag.csv` and `skill_by_id.csv` + + Version 3.2.2 (2025.04.28) - Fix for modded contacts that can wipe out player's fleet when calling them remotely while they do not want to talk with the player. Instead, a dialog window will be displayed that will disappear immediately. diff --git a/src/stelnet/StelnetMod.java b/src/stelnet/StelnetMod.java index 791d27ed2..771ae1f8f 100644 --- a/src/stelnet/StelnetMod.java +++ b/src/stelnet/StelnetMod.java @@ -54,7 +54,7 @@ private void resetIntelUi() { return; } CampaignUIAPI campaignUi = Global.getSector().getCampaignUI(); - if (campaignUi == null) { + if (campaignUi == null || campaignUi.getCurrentCoreTab() == null) { return; } campaignUi.showCoreUITab(CoreUITabId.INTEL, null); diff --git a/src/stelnet/board/commodity/market/MarketFactory.java b/src/stelnet/board/commodity/market/MarketFactory.java index e200dd7e9..530bd9d6e 100644 --- a/src/stelnet/board/commodity/market/MarketFactory.java +++ b/src/stelnet/board/commodity/market/MarketFactory.java @@ -2,13 +2,14 @@ import com.fs.starfarer.api.Global; import com.fs.starfarer.api.campaign.econ.MarketAPI; -import java.util.Collections; -import java.util.Comparator; +import java.util.Arrays; import java.util.List; import lombok.RequiredArgsConstructor; import stelnet.board.commodity.price.Price; import stelnet.filter.MarketNotHidden; import stelnet.util.CollectionUtils; +import stelnet.util.Excluder; + @RequiredArgsConstructor public abstract class MarketFactory { @@ -17,24 +18,18 @@ public abstract class MarketFactory { public List createMarkets() { List markets = Global.getSector().getEconomy().getMarketsCopy(); - CollectionUtils.reduce(markets, new MarketNotHidden()); + CollectionUtils.reduce(markets, Arrays.asList(new MarketNotHidden(), Excluder.getMarketFilter())); filterMarkets(markets); sortMarkets(markets); return markets; } protected void sortMarkets(List markets) { - Collections.sort( - markets, - new Comparator() { - @Override - public int compare(MarketAPI marketA, MarketAPI marketB) { - float priceA = getPrice().getUnitPrice(marketA); - float priceB = getPrice().getUnitPrice(marketB); - return (int) Math.signum(priceB - priceA); - } - } - ); + markets.sort((marketA, marketB) -> { + float priceA = getPrice().getUnitPrice(marketA); + float priceB = getPrice().getUnitPrice(marketB); + return (int) Math.signum(priceB - priceA); + }); } protected abstract Price getPrice();