Starsector API
Loading...
Searching...
No Matches
MarkerData.java
Go to the documentation of this file.
1package com.fs.starfarer.api.ui;
2
3import java.awt.Color;
4
5import org.lwjgl.util.vector.Vector2f;
6
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.campaign.LocationAPI;
9import com.fs.starfarer.api.campaign.econ.MarketAPI;
10import com.fs.starfarer.api.util.Misc;
11
12public class MarkerData {
13 public Vector2f coordinates;
15 public Color color;
16 public float scale = 1f;
18 this(coordinates, location, Global.getSector().getPlayerFaction().getBaseUIColor());
19 }
20 public MarkerData(Vector2f coordinates, LocationAPI location, Color color) {
22 this.coordinates = coordinates;
23 this.location = location;
24 if (this.location == null) {
25 this.location = Global.getSector().getHyperspace();
26 }
27 this.color = Misc.scaleColorOnly(color, 0.67f);
28 }
29 public MarkerData(Vector2f coordinates, LocationAPI location, Color color, float scale) {
30 this.coordinates = coordinates;
31 this.location = location;
32 this.color = Misc.scaleColorOnly(color, 0.67f);
33 this.scale = scale;
34 if (this.location == null) {
35 this.location = Global.getSector().getHyperspace();
36 }
37 }
38 public MarkerData(Vector2f coordinates, LocationAPI location, float scale) {
39 this.coordinates = coordinates;
40 this.location = location;
41 this.scale = scale;
43 this.color = Misc.scaleColorOnly(color, 0.67f);
44 if (this.location == null) {
45 this.location = Global.getSector().getHyperspace();
46 }
47 }
48 public static float getScaleForMarket(MarketAPI market) {
49 float size = market.getSize();
50 float scale = size / 8f;
51 if (scale < 0.33f) scale = 0.33f;
52 if (scale > 1f) scale = 1f;
53 return scale;
54 }
55
56}
static SectorAPI getSector()
Definition Global.java:65
MarkerData(Vector2f coordinates, LocationAPI location)
MarkerData(Vector2f coordinates, LocationAPI location, Color color, float scale)
MarkerData(Vector2f coordinates, LocationAPI location, float scale)
static float getScaleForMarket(MarketAPI market)
MarkerData(Vector2f coordinates, LocationAPI location, Color color)
static Color scaleColorOnly(Color color, float factor)
Definition Misc.java:1302