Split mod into core, recording, replay, render[todo], paths[todo] and extras[wip] modules

Move everything to com.replaymod package
Add KeyBindingRegistry and SettingsRegistry
Recreate settings GUI with new GUI API and dynamically from SettingsRegistry
Use ReplayFile from ReplayStudio
ReplayHandler is now object oriented
Add GuiOverlay, GuiSlider and GuiTexturedButton to GUI API
Rewrite both overlays to use new GUI API
Fix size capping in vertical and horizontal layout
Allow CustomLayouts to have parents
Fix tooltip rendering when close to screen border
Allow changing of columns in GridLayout
This commit is contained in:
johni0702
2015-10-03 17:36:03 +02:00
parent 8bd051eb27
commit f925d56ca2
141 changed files with 6294 additions and 5582 deletions

View File

@@ -3,8 +3,6 @@ package eu.crushedpixel.replaymod.interpolation;
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
import eu.crushedpixel.replaymod.holders.Keyframe;
import eu.crushedpixel.replaymod.holders.SpectatorData;
import eu.crushedpixel.replaymod.holders.TimestampValue;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import lombok.NoArgsConstructor;
import java.util.ListIterator;
@@ -56,17 +54,18 @@ public class AdvancedPositionKeyframeList extends KeyframeList<AdvancedPosition>
spectatorInterpolation = new SpectatorDataInterpolation(linear);
}
int keyframeTimestamp = keyframe.getRealTimestamp();
TimestampValue timestampValue = ReplayHandler.getTimeKeyframes().getInterpolatedValueForTimestamp(keyframeTimestamp, true);
int replayTimestamp = timestampValue == null ? 0 : timestampValue.asInt();
if(firstTimestamp == -1) firstTimestamp = replayTimestamp;
spectatorInterpolation.addPoint(keyframe, replayTimestamp);
if(iterator.hasNext()) {
keyframe = iterator.next();
found = keyframe.getValue() instanceof SpectatorData;
if(!found) completedKeyframes.add(keyframe);
} else {
found = false;
}
// TODO
// TimestampValue timestampValue = ReplayHandler.getTimeKeyframes().getInterpolatedValueForTimestamp(keyframeTimestamp, true);
// int replayTimestamp = timestampValue == null ? 0 : timestampValue.asInt();
// if(firstTimestamp == -1) firstTimestamp = replayTimestamp;
// spectatorInterpolation.addPoint(keyframe, replayTimestamp);
// if(iterator.hasNext()) {
// keyframe = iterator.next();
// found = keyframe.getValue() instanceof SpectatorData;
// if(!found) completedKeyframes.add(keyframe);
// } else {
// found = false;
// }
}
if(spectatorInterpolation != null && spectatorInterpolation.size() > 1) {

View File

@@ -4,7 +4,6 @@ import eu.crushedpixel.replaymod.holders.AdvancedPosition;
import eu.crushedpixel.replaymod.holders.Keyframe;
import eu.crushedpixel.replaymod.holders.SpectatorData;
import eu.crushedpixel.replaymod.holders.SpectatorDataThirdPersonInfo;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
@@ -58,20 +57,21 @@ public class SpectatorDataInterpolation {
//updating the spectator keyframe's position in the world to smoothly continue the path
//with non-spectator position keyframes
for(Pair<Integer, Keyframe<AdvancedPosition>> pair : points) {
AdvancedPosition entityPosition = ReplayHandler.getEntityPositionTracker().getEntityPositionAtTimestamp(entityID, pair.getKey());
if(entityPosition == null) continue;
//transform the entity position (sry for no dry code :x )
SpectatorDataThirdPersonInfo thirdPersonInfo = ((SpectatorData)pair.getValue().getValue()).getThirdPersonInfo();
//first, rotate the camera pitch and yaw according to the settings
entityPosition.setYaw(entityPosition.getYaw() + thirdPersonInfo.shoulderCamYawOffset);
entityPosition.setPitch(entityPosition.getPitch() + thirdPersonInfo.shoulderCamPitchOffset);
//next, move the camera point to fulfill the specified distance to the entity
entityPosition = entityPosition.getDestination(-1 * thirdPersonInfo.shoulderCamDistance);
pair.getValue().getValue().apply(entityPosition);
// TODO
// AdvancedPosition entityPosition = ReplayHandler.getEntityPositionTracker().getEntityPositionAtTimestamp(entityID, pair.getKey());
// if(entityPosition == null) continue;
//
// //transform the entity position (sry for no dry code :x )
// SpectatorDataThirdPersonInfo thirdPersonInfo = ((SpectatorData)pair.getValue().getValue()).getThirdPersonInfo();
//
// //first, rotate the camera pitch and yaw according to the settings
// entityPosition.setYaw(entityPosition.getYaw() + thirdPersonInfo.shoulderCamYawOffset);
// entityPosition.setPitch(entityPosition.getPitch() + thirdPersonInfo.shoulderCamPitchOffset);
//
// //next, move the camera point to fulfill the specified distance to the entity
// entityPosition = entityPosition.getDestination(-1 * thirdPersonInfo.shoulderCamDistance);
//
// pair.getValue().getValue().apply(entityPosition);
}
//feed the underlying keyframe list with AdvancedPosition Keyframes that are derived from the Spectator Keyframes
@@ -116,17 +116,18 @@ public class SpectatorDataInterpolation {
smoothness = (int)(thirdPersonInfo.shoulderCamSmoothness*1000);
//calculate the Position relative to the Entity
AdvancedPosition entityPosition = ReplayHandler.getEntityPositionTracker().getEntityPositionAtTimestamp(entityID, currentTimestamp);
if(entityPosition == null) continue;
//first, rotate the camera pitch and yaw according to the settings
entityPosition.setYaw(entityPosition.getYaw() + thirdPersonInfo.shoulderCamYawOffset);
entityPosition.setPitch(entityPosition.getPitch() + thirdPersonInfo.shoulderCamPitchOffset);
//next, move the camera point to fulfill the specified distance to the entity
entityPosition = entityPosition.getDestination(-1 * thirdPersonInfo.shoulderCamDistance);
underlyingKeyframes.add(new Keyframe<AdvancedPosition>(interpolatedRealTimestamp, entityPosition));
// TODO
// AdvancedPosition entityPosition = ReplayHandler.getEntityPositionTracker().getEntityPositionAtTimestamp(entityID, currentTimestamp);
// if(entityPosition == null) continue;
//
// //first, rotate the camera pitch and yaw according to the settings
// entityPosition.setYaw(entityPosition.getYaw() + thirdPersonInfo.shoulderCamYawOffset);
// entityPosition.setPitch(entityPosition.getPitch() + thirdPersonInfo.shoulderCamPitchOffset);
//
// //next, move the camera point to fulfill the specified distance to the entity
// entityPosition = entityPosition.getDestination(-1 * thirdPersonInfo.shoulderCamDistance);
//
// underlyingKeyframes.add(new Keyframe<AdvancedPosition>(interpolatedRealTimestamp, entityPosition));
}
i++;