Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

1M Downloads

Hotkey to place keyframes

Johni0702 opened this issue ยท 13 comments

commented

One for position (even when spectating), one for time, one for both and one for spectator. Latter two can probably be bound to NONE by default cause the first two are probably good enough for most people.

commented

I'm trying to work on this one, I need some clarity though.

one for spectator

You mean a shortcut that will only work if the camera is in spectator mode? i.e. if pressed when the camera is out of a character it will do nothing and only add a position keyframe if it is inside an entity.

Latter two can probably be bound to NONE

What do you mean by that? How can a shortcut not be bound to a key?

Also, do you have any prefered keys of each one? or I just add mine and we change it latter if needed?
This issue is a generalization of #303. So, the latter is no longer needed.

commented

You mean a shortcut that will only work if the camera is in spectator mode?

Yes, that's what I meant but it's probably not particularly useful, so having it just place a normal position keyframe while not spectating (i.e. exactly what the position keyframe button does now) is probably better. And then have a hotkey for that instead of the position-only cause it's more useful.

What do you mean by that? How can a shortcut not be bound to a key?

registry.registerKeyBinding("replaymod.input.settings", 0, () -> {
new GuiReplaySettings(null, settingsRegistry).display();
}, false);

Also, do you have any prefered keys of each one?

Nope. Should be fairly easy to reach and not conflict with any default key binding (it may conflict with vanilla ones if those don't apply it the replay viewer, just make sure to pass true as the boolean to registerKeyBinding)

commented

Where the key registering will take place? In ReplayMod.registerKeyBindings() or ReplayModSimplePathing.registerKeyBindings()? Btw, what's the difference?

commented

Where the key registering will take place? In ReplayMod.registerKeyBindings() or ReplayModSimplePathing.registerKeyBindings()? Btw, what's the difference?

In the latter cause that's the module which the keybindings belong to. And that's also the difference, the former only has keybindings which are globally valid. E.g. we could completely rework the camera path gui and the settings keybinding would be unaffected, whereas the keybindings for this issue would definitely be.

commented

I have a SPTimeline instance. How do I get the cursor position? I tried getCursorPosition(), but that method does not exist.
Also, in GuiPathing there are methods being called, that actually do not exist..am I missing something?

commented

I have a SPTimeline instance. How do I get the cursor position?

The SPTimeline doesn't care about the cursor and as such doesn't have its position, that's purely UI. You can get the cursor position from the GuiPathing.

Also, in GuiPathing there are methods being called, that actually do not exist..am I missing something?

Probably. Which methods?
Do you have stuff in the jGui folder? If not, you need to git submodule update --init as explained in the readme.

commented

I think I got the cursor position.
But, still at GuiPathing, line 110:

spTimeline.getTimeline()

spTimeline is of type SPTimeline and getTimeline() does not exist in SPTimeline.
There are many more red marks in IntelliJ and I used git submodule update --init
Also, I'm at develop branch.

commented

Oh, I see, those get generated by Lombok based on these annotations:

I should really get rid of it, it's nothing but trouble and only saves a few auto-generatable lines. You'll probably have to install its IntelliJ plugin for IntelliJ to be able to see those methods.

commented

And please don't forget about

One for position (even when spectating)

That's why I originally opened this issue cause there's currently no way to do this at all.

commented

Wait, I lost you there. I assume you already reviewed my PR. What do you mean by spectating? If I understand correctly, it's when you right click into an entity, right? I added an action for adding a position keyframe under the "I" key. Won't that work, spectating or not?

commented

Lombok did the trick, all good. To test my changes I need to produce a .jar. I go with the artifact root? I'm in IntelliJ. What module should I pick and what will the main class be?

commented

Wait, I lost you there. I assume you already reviewed my PR. What do you mean by spectating? If I understand correctly, it's when you right click into an entity, right? I added an action for adding a position keyframe under the "I" key. Won't that work, spectating or not?

I looked at the commit linked by GitHub above.
What I'm after is a way to add a position (not spectator) keyframe while spectating an entity. Such that one gets the exact position of the entity but doesn't actually spectate it (i.e. no hands and no following of its position).
What the current button and the hotkey in your commit do is always add a spectator keyframe whenever you're spectating an entity, I want a way to instead put a position keyframe though.

To test my changes I need to produce a .jar. I go with the artifact root? I'm in IntelliJ. What module should I pick and what will the main class be?

No, you don't need a jar to test in intellij. See the README. With the updated loom, it should auto-generate run configs.
If you want a jar for testing outside of intellij, see the README.

commented

I updated it. When inserting both keyframes I assume the user wants the spectate version of the position.