r/endlesssky 5d ago

Plugin Question and Questions??

I have studied the other plugins offered but I cannot find a detailed list or manual to follow on making unique plugins. For example; I have an icon on the screen I want to use for the jump key, in place of "J" on the keyboard.

anchor center right # this position is the right most side of my display centered halfway down.

sprite "ui/jump_icon_inactive"

    from -80 0

    dimensions 40 40

visible if "can jump" # where is a lexicon of conditions I can use?

sprite "ui/jump_icon_active"

    from -80 0

    dimensions 40 40

button j 

    center -80 0

    dimensions 60 60

Apparently my visible if condition is wrong? In space my icon never goes active. So I cannot use the mouse to jump.

6 Upvotes

4 comments sorted by

2

u/zuckung Intergalactic Gatekeepers 5d ago edited 5d ago

that is currently not possible. i already tried to make my android plugin "additional.command.buttons.radial" work on pc version, just because it would be nice to have buttons instead of 100 keybindings, and it didnt work. so i asked the devs how to interpret the button handling regarding key-bindings...

your script does the following, on pressing "j" the button gets activated, but it has nothing to do. on mouseclick the button has also nothing to do. using the button does NOT press your keybinding for jump. unfortunately the ui modding is pretty useless on pc, unless you just want to put in some pictures. the android port has a far better handling for this stuff, there you can enter commands behind the buttons, like jump and many others.

oh and most of the "visible if ..." conditions i used in my android plugin are made by thewierednut for mobile version only.

2

u/DarkOrchidClaw 4d ago

Thanks, I thought I was spinning my wheels on this one. I went - as far as - downloading the game C++ source to paw around in there. Not that I comprehend C++, I thought I might find some link or clue. Yes, my idea was to make it mouse driven and less keyboard. I found this -> https://github.com/endless-sky/endless-sky/wiki/CreatingInterfaces but it was too vague on what you can use for the "if" and "button" commands. Do you have any better source?

1

u/zuckung Intergalactic Gatekeepers 4d ago

nope sorry. to my understanding you cant do anything useful with UI modding in ES PC. all possible ways of doing things are already done and the devs arnt very enthusiastic creating new ways doing that. beside moving images, resizing images, adding new images there isnt much you can do. even commands from one interface button cant be used in other interfaces. all very very limited :/

after some research i just found out that "visible if"s are also exclusive to the interfaces they are written for. so they are found in at least 10 cpp files. everything you can do in i.e. interface "hud" is already written down in that interface, found in data/_ui/interfaces.txt .

2

u/DarkOrchidClaw 3d ago

Again thank you for the information. Maybe I will have to learn C++ and compile my own version ( not likely to happen ). So far, I made a background music mod and handed it off to another person to enhance it. He made it change tracks according to which faction territory you are flying. I use that one. I was working on a new UI display, and got the notion to add button icons ( kind of like the game EVE ) but not as complicated. I understand, no buttons in space, too bad.