Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion assets/mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions assets/stelnet.version
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/stelnet/StelnetMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 9 additions & 14 deletions src/stelnet/board/commodity/market/MarketFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -17,24 +18,18 @@ public abstract class MarketFactory {

public List<MarketAPI> createMarkets() {
List<MarketAPI> 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<MarketAPI> markets) {
Collections.sort(
markets,
new Comparator<MarketAPI>() {
@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();
Expand Down