mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
reorder actors button
This commit is contained in:
parent
f1308c4ecc
commit
7b138a72d9
4 changed files with 36 additions and 6 deletions
|
@ -11,7 +11,7 @@ namespace Rimworld_Animations {
|
|||
class MainTabWindow_OffsetConfigure : MainTabWindow
|
||||
{
|
||||
|
||||
public override Vector2 RequestedTabSize => new Vector2(505, 340);
|
||||
public override Vector2 RequestedTabSize => new Vector2(505, 380);
|
||||
public override void DoWindowContents(Rect inRect) {
|
||||
|
||||
Rect position = new Rect(inRect.x, inRect.y, inRect.width, inRect.height);
|
||||
|
@ -20,7 +20,7 @@ namespace Rimworld_Animations {
|
|||
Listing_Standard listingStandard = new Listing_Standard();
|
||||
listingStandard.Begin(position);
|
||||
|
||||
listingStandard.Label("Offset Manager");
|
||||
listingStandard.Label("Animation Manager");
|
||||
|
||||
listingStandard.GapLine();
|
||||
|
||||
|
@ -72,6 +72,20 @@ namespace Rimworld_Animations {
|
|||
rotation = 0;
|
||||
}
|
||||
|
||||
listingStandard.GapLine();
|
||||
|
||||
if(listingStandard.ButtonText("Shift Actors")) {
|
||||
|
||||
if(AnimationSettings.debugMode) {
|
||||
Log.Message("Shifting actors in animation...");
|
||||
}
|
||||
|
||||
for(int i = 0; i < curPawn.TryGetComp<CompBodyAnimator>().actorsInCurrentAnimation.Count; i++) {
|
||||
curPawn.TryGetComp<CompBodyAnimator>().actorsInCurrentAnimation[i].TryGetComp<CompBodyAnimator>()?.shiftActorPositionAndRestartAnimation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (offsetX != AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex].x || offsetZ != AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex].y) {
|
||||
AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex] = new Vector2(offsetX, offsetZ);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue