Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 30 31 [32] 33 34 ... 42

Author Topic: API request thread (please read OP before posting!)  (Read 219282 times)

IonDragonX

  • Admiral
  • *****
  • Posts: 816
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #465 on: October 01, 2021, 07:16:48 AM »

Finally, a new UI component - rich table - is still needed. It will have clickable headers (sorting) and allow for variable cell content like button, image, or text. Yes, we have it in Starsector, but it is not exposed via API so need to build it myself (Alex plz).
Logged

RustyCabbage

  • Captain
  • ****
  • Posts: 347
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #466 on: October 02, 2021, 07:09:42 PM »

I'd like a ShipHullSpecAPI.getDeploymentPoints() or some equivalent. Currently I think the only way to obtain it is either loading the ship_data.csv or grabbing it from FleetMemberAPI.getStats().getSuppliesToRecover().getBaseValue() or something to that effect.

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #467 on: October 10, 2021, 03:18:50 PM »

Would it be possible to change the behavior of ShipAPI.getFleetMember() and MutableShipStatsAPI.getFleetMember() to more reliably return real fleet members instead of dummy fleet members?

Currently, the "stats" and "ship" arguments passed to the various BaseHullMod methods will return dummy fleet members if the hullmod is attached to a module, instead of returning the actual fleet member the module is attached to. Furthermore, modules in this context will present as if they're not modules for other reasons, returning false with isStationModule and null with getParentStation. This makes it very difficult to determine what fleet member the module is attached to.

I realize this might not be feasible if vanilla code relies on the existing behavior of getFleetMember, but I figured I might as well ask. Thanks for considering!

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #468 on: October 13, 2021, 08:58:18 PM »

The ship system WEAPON_BOOST AI only activates against fighters for frigates. Could we get a way to trigger this behavior for certain larger ships?

An ANTI_FTR ship tag or WEAPON_BOOST_ANTI_FTR AI would do.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #469 on: October 16, 2021, 06:44:18 PM »

Code
	public static boolean isUnboardable(FleetMemberAPI member) {
return isUnboardable(member.getHullSpec());
}

public static boolean isUnboardable(ShipHullSpecAPI hullSpec) {
if (hullSpec.getHints().contains(ShipTypeHints.UNBOARDABLE)) {
for (String tag : getAllowedRecoveryTags()) {
if (hullSpec.hasTag(tag)) return false;
}
if (hullSpec.isDefaultDHull()) {
ShipHullSpecAPI parent = hullSpec.getDParentHull();
for (String tag : getAllowedRecoveryTags()) {
if (parent.hasTag(tag)) return false;
}
}
return true;
}
return false;
}
Would it be possible for the Misc.IsUnboardable to check for the variant's tag of this fleet member as well? It is slightly annoying to duplicate a ship and make it unrecoverable when a variant's tag could do :(

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #470 on: October 27, 2021, 03:21:10 AM »

Can there be something like "OfficerPickerListener" and "SkillPickerListener", that can be called by something like "void showOfficerPickerListener(...)" in InteractionDialogAPI, just like existing CampaignEntityPickerListener or so?

I'm expecting something like existing officer picker that displays when selecting officer for a ship, or existing skill picker that displays when selecting skills for officers when they got a level up
Logged
Also known as AnyIDElse.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #471 on: November 05, 2021, 01:23:07 PM »

Thank you for the suggestions/requests, everyone! A reminder that this thread is for things that already exist but aren't exposed in the API, not new features. I don't particularly mind if stuff crosses over into that territory, but given that I generally go through this thread late in the release cycle, anything that requires substantial effort is not likely to get done.

With that out of the way, did a bunch of these!
Added SettingsAPI.computeStringWidth(String in, String font)
Added TooltipMakerAPI.computeStringWidth(String in)
Added HullModSpecAPI.setManufacturer()
Added DamagingProjectileAPI.List<CombatEntityAPI> getDamagedAlready()
   Returns null for everything other than explosions
   Added getters and setters to BoostIndustryInstallableItemEffect
"no_autofit" tag now also works when applied to variants
Added "unboardable" tag to variants
Added TextFieldAPI
Added to TooltipMakerAPI:
   TextFieldAPI addTextField(float width, float pad);
   TextFieldAPI addTextField(float width, String font, float pad);
   TextFieldAPI addTextField(float width, float height, String font, float pad);
ButtonAPI addCheckbox(float width, float height, String text, UICheckboxSize size, float pad);
   ButtonAPI addCheckbox(float width, float height, String text, String font, Color checkColor, UICheckboxSize size, float pad);
Added to SettingsAPI:
   TextFieldAPI createTextField(String text, String font);
ButtonAPI createCheckbox(String text, UICheckboxSize size);
ButtonAPI createCheckbox(String text, String font, Color checkColor, UICheckboxSize size);
Added to InteractionDialogAPI:
   Version of showCargoPickerDialog() that takes a custom dialog size as a parameter
Added to WeaponSpecAPI:
   void setOrdnancePointCost(float armamentCapacity);



3. While I am sharing my wishlist... Could we get cargo / fleet member pickers to work outside of dialogs? Might be affected by the one below...

4. ... And finally renewing my ask for the ability to create UI elements (custom panels) on top of an existing screen. Hope this is not a huge change though (functionality exists, but I get it if it's highly coupled with other code). Ideally I'd love to create a smaller (blocking) panel on top of intel UI (or campaign UI), with an X button and custom content (kinda like you can view commodity demand/availability on top of current market screen).

That's unfortunately a bit complicated, yeah. Sorry!


can we get removeSMod and addSMod, the same as add/removeMod and add/removePermaMod?

I'd like it for some faction-specific hullmod replacements, so they override autofitted smods properly (and it just kinda seems weird that it isnt a thing already)

It's a thing - addPermaMod() has a boolean parameter that sets whether it's an s-mod that's being added.

I'd like a ShipHullSpecAPI.getDeploymentPoints() or some equivalent. Currently I think the only way to obtain it is either loading the ship_data.csv or grabbing it from FleetMemberAPI.getStats().getSuppliesToRecover().getBaseValue() or something to that effect.

That already exists - ShipHullSpecAPI.getSuppliesToRecover()


The ship system WEAPON_BOOST AI only activates against fighters for frigates. Could we get a way to trigger this behavior for certain larger ships?

Hmm - Accelerated Ammo Feeder uses that AI, so I suspect this isn't actually the case?

Would it be possible to change the behavior of ShipAPI.getFleetMember() and MutableShipStatsAPI.getFleetMember() to more reliably return real fleet members instead of dummy fleet members?

Currently, the "stats" and "ship" arguments passed to the various BaseHullMod methods will return dummy fleet members if the hullmod is attached to a module, instead of returning the actual fleet member the module is attached to. Furthermore, modules in this context will present as if they're not modules for other reasons, returning false with isStationModule and null with getParentStation. This makes it very difficult to determine what fleet member the module is attached to.

I realize this might not be feasible if vanilla code relies on the existing behavior of getFleetMember, but I figured I might as well ask. Thanks for considering!

Ahh, this is... let's call it "code that's potentially very sensitive/error prone" and I don't want to touch it unless I absolutely have to. My apologies!
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #472 on: November 06, 2021, 08:22:51 PM »

The ship system WEAPON_BOOST AI only activates against fighters for frigates. Could we get a way to trigger this behavior for certain larger ships?

Hmm - Accelerated Ammo Feeder uses that AI, so I suspect this isn't actually the case?

Huh, tested Hammerhead and Roider Union's Firestorm and they do use their AAF vs fighters in 0.95a. They did not in 0.9.1a (tested that too) and I don't recall seeing any patch note mentioning a change in behavior.
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #473 on: November 07, 2021, 01:40:55 AM »

Quote
    4. ... And finally renewing my ask for the ability to create UI elements (custom panels) on top of an existing screen. Hope this is not a huge change though (functionality exists, but I get it if it's highly coupled with other code). Ideally I'd love to create a smaller (blocking) panel on top of intel UI (or campaign UI), with an X button and custom content (kinda like you can view commodity demand/availability on top of current market screen).

What if this was rephrased into the ability to hide more parts of interaction dialog API? Right now you can hide text or visual panels, but I'd like to hide text and option panels (and have visual panel extend to take over freed space), thus have one big visual panel to work with.
« Last Edit: November 07, 2021, 01:44:31 AM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #474 on: November 07, 2021, 08:29:03 AM »

Huh, tested Hammerhead and Roider Union's Firestorm and they do use their AAF vs fighters in 0.95a. They did not in 0.9.1a (tested that too) and I don't recall seeing any patch note mentioning a change in behavior.

Ah, that's entirely possible; the patch notes are definitely not 100% inclusive.


Quote
    4. ... And finally renewing my ask for the ability to create UI elements (custom panels) on top of an existing screen. Hope this is not a huge change though (functionality exists, but I get it if it's highly coupled with other code). Ideally I'd love to create a smaller (blocking) panel on top of intel UI (or campaign UI), with an X button and custom content (kinda like you can view commodity demand/availability on top of current market screen).

What if this was rephrased into the ability to hide more parts of interaction dialog API? Right now you can hide text or visual panels, but I'd like to hide text and option panels (and have visual panel extend to take over freed space), thus have one big visual panel to work with.

I was thinking you needed it in a different context - i.e. the intel screen. For this, actually, there *will* be something in the new release that should cover it:

InteractionDialogAPI.showCustomVisualDialog(float customPanelWidth, float customPanelHeight, CustomVisualDialogDelegate delegate);

Code
public interface CustomVisualDialogDelegate {
public interface DialogCallbacks {
void dismissDialog();
FaderUtil getPanelFader();
}
void init(CustomPanelAPI panel, DialogCallbacks callbacks);
CustomUIPanelPlugin getCustomPanelPlugin();
float getNoiseAlpha();
void advance(float amount);
void reportDismissed(int option);
}

Basically you get a custom dialog that's *entirely* a CustomPanelAPI, aside from the border decorating it. So it needs to handle being dismissed etc, but you get full control over its contents.
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #475 on: November 07, 2021, 09:00:10 AM »

This is exactly what I wanted, an ability to have a CustomPanelAPI that is not tied to intel ui or is not a section of interaction dialog plugin.

Can I conjure it in place of interaction dialog plugin? It doesn't implement InteractionDialogPlugin which makes sense, so if not then how do you create one (from where).
« Last Edit: November 07, 2021, 09:12:35 AM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #476 on: November 07, 2021, 10:31:53 AM »

Ah - you need to call it from an InteractionDialogAPI, so it's not quite what you're thinking.

InteractionDialogAPI.showCustomVisualDialog(float customPanelWidth, float customPanelHeight, CustomVisualDialogDelegate delegate);
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #477 on: November 07, 2021, 01:54:27 PM »

Ah, right. Still, I have this mastered already - dummy InteractionDialogPlugin that calls showCustomVisualDialog in init() and is dismissed from the CustomVisualDialogDelegate that is spawned. Looks decent as long as the InteractionDialogPlugin is empty (no text, no options, no visuals). Should do with my needs :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #478 on: November 07, 2021, 02:10:48 PM »

Ok, excellent :)
Logged

RustyCabbage

  • Captain
  • ****
  • Posts: 347
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #479 on: November 07, 2021, 03:00:51 PM »

I'd like a ShipHullSpecAPI.getDeploymentPoints() or some equivalent. Currently I think the only way to obtain it is either loading the ship_data.csv or grabbing it from FleetMemberAPI.getStats().getSuppliesToRecover().getBaseValue() or something to that effect.

That already exists - ShipHullSpecAPI.getSuppliesToRecover()
ah, looks like this is a new one, since it doesn't seem to be in the current javadoc and my IDE can't find it. Regardless, thanks!
Pages: 1 ... 30 31 [32] 33 34 ... 42