Fractal Softworks Forum

Please login or register.

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

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #480 on: November 07, 2021, 03:03:54 PM »

Ahh, ok!
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #481 on: November 09, 2021, 02:32:26 PM »

If it's not too late, could we have an update of Tags constants (com.fs.starfarer.api.impl.campaign.ids)? Didn't see "HIDE_IN_CODEX" or "omega" entries. Could be more missing...

From another thread:
Yeah, the rendering for all of these is done with some internal (and relatively involved) code, it's not as simple as just drawing a sprite. Consider that blueprints are composited from a base image and what they're a blueprint of, and that ship icons have a faint grid overlaid on top of them, that sort of thing.

Would it be possible to get overloaded methods for `beginImageWithText()` instead? One that takes CargoStackAPI and one that takes FleetMemberAPI (or ShipHullSpecAPI if it makes it easier) instead of the sprite string, that ties into that logic? For completeness, it would be great to have `addImage()` accept those as well.
« Last Edit: November 12, 2021, 10:35:37 AM by Jaghaimo »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #482 on: November 13, 2021, 04:38:36 AM »

Tiny ask for more button cutstyles - NONE, TL_BL, TR_BR, TL, TR, BL, BR.
« Last Edit: November 16, 2021, 07:34:35 AM by Jaghaimo »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #483 on: November 22, 2021, 06:24:39 AM »

And, how big of an ask would it be to have a showShips / showCargo methods that take "boolean showTooltips" and display regular tooltips when hovering over a ship / item?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #484 on: November 22, 2021, 09:23:18 AM »

I'll keep it in mind! At this point in the release cycle, though, need to focus on playtesting and making any changes/fixes that stem from that - so I don't think I'll be able to work it in for this release.
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #485 on: November 23, 2021, 01:37:57 AM »

Yup, I wasn't expecting any of these for 0.95.1 - either 0.95.2 (if there is any) or later. Lifting the lid off my wish-list jar, there's one more item I would dearly love to see: the ability to manipulate scrollers programmatically.

Currently, if I want to have a button that changes the state of the CustomPanelAPI (either the one it resides in or elsewhere that is displayed as part of the same view) I have to call `ui.updateUIForItem(this)`. This causes the whole thing to recreate the panel (createLargeIntel()), and shows the default state (every scroller that exist in this view is parked at the top). I am happy to do the legwork, e.g. check scroller position for each CustomPanelAPI, store it internally in my structures, and when I create the same panel in the new call - reapply the scroller.

A bare minimum that I would need is thus:
Code
float CustomPanelAPI.getScrollPosition();
void CustomPanelAPI.setScrollPosition(float);

Now, I THINK I could work this around and correct me if I am wrong. I could be keeping references to every CustomPanelAPI that was created as part of my UI (the ones that I allow scrollers at least), and on consecutive calls reusing them instead of creating a new one. Which is ugly, as these will have been created with different CustomPanelAPIs (from previous calls, so things could break). And it would have to be transient, of course, as resolution could have changed between loads affecting element sizes, and thus scroller positions.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #486 on: November 29, 2021, 07:40:29 PM »

I would love it if this was possible. I'd like to expand missions and reward players who take the time to do the mission task.

SettingsAPI.getMissionScore(String missionid)

//Replaces the "Your forces achieve a..."
MissionDefinitionAPI.setCustomMinorVictoryMessage(String text)
MissionDefinitionAPI.setCustomMajorVictoryMessage(String text)
MissionDefinitionAPI.setCustomLossMessage(String text)
and.. any other messages I'm forgetting  :-\ if possible.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #487 on: November 29, 2021, 08:20:26 PM »

Now, I THINK I could work this around and correct me if I am wrong. I could be keeping references to every CustomPanelAPI that was created as part of my UI (the ones that I allow scrollers at least), and on consecutive calls reusing them instead of creating a new one. Which is ugly, as these will have been created with different CustomPanelAPIs (from previous calls, so things could break). And it would have to be transient, of course, as resolution could have changed between loads affecting element sizes, and thus scroller positions.

I *think* that would work, yeah.


I would love it if this was possible. I'd like to expand missions and reward players who take the time to do the mission task.

SettingsAPI.getMissionScore(String missionid)

(Added this one since it was trivial; the other stuff is a bit less so, so, not this time around...)
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #488 on: November 30, 2021, 06:09:23 PM »

(Added this one since it was trivial; the other stuff is a bit less so, so, not this time around...)

That's okay!

Is it possible to have leader_attack_at_an_angle as well?

I'm using leader_no_swarm and attack_at_an_angle to a surprising degree on certain wings and it seems to work as expected except the wing leader never seems to face the target (just controls the wing formation around). Could the leader be encouraged to face the target and strafe around instead?

stormbringer951

  • Commander
  • ***
  • Posts: 130
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #489 on: December 04, 2021, 09:08:48 AM »

Would it be possible to add some method to register programmatically created variants with the methods used by the variant ID lookup so I can call these SettingsAPI methods on some new variant ID that did not exist at startup:

Code
void addDefaultEntryForRole(java.lang.String role, java.lang.String variantId, float weight)
void addEntryForRole(java.lang.String factionId, java.lang.String role, java.lang.String variantId, float weight)

I would like to programmatically create variants, but since they can't be added to the variant id lookup, I can't dynamically create variants, add default roles for them and add them to faction's known ships & doctrines.
Logged
Weapons Group Controls mod - deselect all weapon groups, hold-down hold-fire mode, toggle alternating/linked fire
Captain's Log - throw away your notepad: custom notes, ruins and salvageable reminders
Old Hyperion - for your dose of nostalgia
Adjustable Skill Thresholds - set fleet DP and fighter bay thresholds

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #490 on: December 04, 2021, 12:47:05 PM »

Would it be possible to add some method to register programmatically created variants with the methods used by the variant ID lookup so I can call these SettingsAPI methods on some new variant ID that did not exist at startup:

Code
void addDefaultEntryForRole(java.lang.String role, java.lang.String variantId, float weight)
void addEntryForRole(java.lang.String factionId, java.lang.String role, java.lang.String variantId, float weight)

I would like to programmatically create variants, but since they can't be added to the variant id lookup, I can't dynamically create variants, add default roles for them and add them to faction's known ships & doctrines.

If we're talking about adding things programmatically, being able to do that with weapons would be great too.

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #491 on: December 17, 2021, 01:54:06 AM »

Code
InteractionDialogAPI.hideOptionPanel()
InteractionDialogAPI.showOptionPanel()

We can already toggle visual and text panels, but not the option panel. The only way to draw a custom panel or cargo picker is currently to spawn an empty interaction dialog, and call showXXX on it. Unfortunately, you still see "You decide to..." in the background, even if there are no options to select.

Alternative - just autohide if option list is empty?
Logged

SikeSky

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #492 on: December 23, 2021, 03:45:22 AM »

New here! I was told this was the best place to bring this up.

Currently all ship systems will "reset" the colors of the ship's shields upon deactivation, not just ship systems that alter the color of the shields (like Fortress Shields). This causes unintended behavior with ships with hullmods etc. that change the color of ship's shields. A
Code
boolean resetShieldColor()
or something similar would at least allow us to stop that from happening, although given how hard it was to track down I think it'd be best if the behavior was simply isolated to ship systems that change the shield colors. Have them grab the current colors and then go back to that when they're done, maybe?
Logged

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #493 on: December 29, 2021, 07:03:55 PM »

can there be something like setPhase(String id, float phaseUpkeep, float phaseCost), that like setShield() in ShipAPI?

and, then maybe not an API request but some advice..?
In "logistical data", can "Maxium burn" and "Fuel / light year, jump cost" 's number colored red, same with "Fuel capacity"? like all crew-concerned numbers colored cyan.
« Last Edit: December 29, 2021, 07:26:58 PM by THEASD »
Logged
Also known as AnyIDElse.

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #494 on: December 30, 2021, 01:38:02 AM »

There is currently a problem with making vanilla hullmods incompatible with modded hullmods, so i'm suggesting a solution like this:

public class CoolModPlugin extends BaseModPlugin {

  public boolean pluginCheckHullmodIsCompatible(String installed, String candidate, ShipAPI ship) {
    if (installed.Equals("my_cool_hullmod") && candidate.equals("safetyoverrides") return false;
    return true;
  }
}

When a hullmod is moused over in the selection GUI or any other time a hullmod is applied to a variant, the game could iterate through all modplugins (like it does with plugin pick missile AI) and get a boolean for compatibility, there shouldn't be any cross-mod conflicts with this logic.
Logged
Pages: 1 ... 31 32 [33] 34 35 ... 42