Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)
public class YourModPlugin extends BaseModPlugin { @Override public void onApplicationLoad() { SettingsAPI settings = Global.getSettings(); JSONArray csvData; if (settings.getModManager().isModEnabled("whichmod")) return; try { csvData = settings.loadCSV("data/strings/descriptions.csv", "YOUR MOD ID HERE"); } catch (Exception e) { return; } // try reading each row in descriptions.csv for (int i = 0; i < csvData.length(); i++) { try { JSONObject row = csvData.getJSONObject(i); String id = row.getString("id"); String type = row.getString("type"); if (!(id == null || type == null || id.equals("") || type.equals(""))) { Description desc; Type descType = Enum.valueOf(Type.class, type); if (descType == Type.SHIP || descType == Type.WEAPON) desc = settings.getDescription(id, descType); else continue; desc.setText1("[YOUR MOD NAME HERE] " + desc.getText1()); String prefix; } } catch (Exception e) { //logger.log(Level.INFO, e); } } }}
Excuse me, the downloadable version is ahead of the version on the version checker. Just letting you know.
Quote from: SpaceshipCaptainYukari on May 26, 2023, 04:36:28 AMExcuse me, the downloadable version is ahead of the version on the version checker. Just letting you know.Thanks for the heads up. Fixed.