45 public void render(
float x,
float y,
float w,
float h,
float alphaMult,
58 boolean known =
Global.
getSector().getCharacterData().knowsHullMod(modId);
84 w = sprite.getWidth() * 1.5f + 5;
85 h = sprite.getHeight() * 1.5f;
128 sprite.setAlphaMult(alphaMult * mult);
129 sprite.setNormalBlend();
130 sprite.renderWithCorners(blX, blY, tlX, tlY, trX, trY, brX, brY);
134 sprite.setAlphaMult(alphaMult * glowMult * 0.5f * mult);
136 sprite.setAdditiveBlend();
137 sprite.renderWithCorners(blX, blY, tlX, tlY, trX, trY, brX, brY);
144 renderer.
renderSchematicWithCorners(sprite,
null, blX, blY, tlX, tlY, trX, trY, brX, brY, alphaMult * 0.67f);
175 Color h = Misc.getHighlightColor();
176 Color g = Misc.getGrayColor();
177 Color b = Misc.getButtonTextColor();
178 b = Misc.getPositiveHighlightColor();
183 Misc.addDesignTypePara(tooltip, design, 10f);
186 tooltip.addPara(
spec.
getDesc(), Misc.getGrayColor(), opad);
189 tooltip.addSectionHeading(
"Effect", Alignment.MID, opad * 1f);
191 HullModEffect e = modSpec.getEffect();
192 HullSize size = HullSize.CAPITAL_SHIP;
193 if (e.shouldAddDescriptionToTooltip(size,
null,
true)) {
194 final String [] params =
new String [] {
195 e.getDescriptionParam(0, size,
null),
196 e.getDescriptionParam(1, size,
null),
197 e.getDescriptionParam(2, size,
null),
198 e.getDescriptionParam(3, size,
null),
199 e.getDescriptionParam(4, size,
null),
200 e.getDescriptionParam(5, size,
null),
201 e.getDescriptionParam(6, size,
null),
202 e.getDescriptionParam(7, size,
null),
203 e.getDescriptionParam(8, size,
null),
204 e.getDescriptionParam(9, size,
null)
207 tooltip.addPara(modSpec.getDescription(size).replaceAll(
"\\%",
"%%"), opad, h, params);
211 e.addPostDescriptionSection(tooltip, size,
null,
getTooltipWidth(),
true);
213 if (e.hasSModEffectSection(size,
null,
false)) {
217 addCostLabel(tooltip, opad, transferHandler, stackSource);
222 boolean known =
Global.
getSector().getCharacterData().knowsHullMod(modId);
225 tooltip.addPara(
"Already known", g, opad);
228 tooltip.addPara(
"Right-click to learn", b, opad);
268 if (params ==
null || params.isEmpty())
return null;
271 JSONObject json =
new JSONObject(params);
273 int tier = json.optInt(
"tier", -1);
274 Set<String> tags =
new HashSet<String>();
275 if (json.has(
"tags")) {
276 JSONArray tagsArray = json.getJSONArray(
"tags");
277 for (
int i = 0; i < tagsArray.length(); i++) {
278 tags.add(tagsArray.getString(i));
284 Iterator<HullModSpecAPI> iter = specs.iterator();
285 while (iter.hasNext()) {
286 HullModSpecAPI curr = iter.next();
287 boolean known =
Global.
getSector().getPlayerFaction().knowsHullMod(curr.getId());
288 if (DebugFlags.ALLOW_KNOWN_HULLMOD_DROPS) known =
false;
289 if (known || curr.isHidden() || curr.isHiddenEverywhere() || curr.hasTag(Tags.HULLMOD_NO_DROP)) {
296 iter = specs.iterator();
297 while (iter.hasNext()) {
298 HullModSpecAPI curr = iter.next();
299 if (curr.getTier() != tier) iter.remove();
303 if (!tags.isEmpty()) {
304 iter = specs.iterator();
305 while (iter.hasNext()) {
306 HullModSpecAPI curr = iter.next();
307 for (String tag : tags) {
308 boolean not = tag.startsWith(
"!");
309 tag = not ? tag.substring(1) : tag;
310 boolean has = curr.hasTag(tag);
319 WeightedRandomPicker<HullModSpecAPI> picker =
new WeightedRandomPicker<HullModSpecAPI>(random);
320 for (HullModSpecAPI
spec : specs) {
323 HullModSpecAPI pick = picker.pick();