From d0a8117cfdd2bf32cb99c01b5ff54b6421cbdc6b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 27 Apr 2023 11:15:26 +0200 Subject: [PATCH] added additional function to rotate card+preview --- src/playercards/Tarotcard.ttslua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/playercards/Tarotcard.ttslua b/src/playercards/Tarotcard.ttslua index 74d24632..6f476ac5 100644 --- a/src/playercards/Tarotcard.ttslua +++ b/src/playercards/Tarotcard.ttslua @@ -1,10 +1,14 @@ -- context menu to manually fix rotation function onLoad() - self.addContextMenuItem("rotate alt preview", reverse) + self.addContextMenuItem("rotate preview", rotatePreview) + self.addContextMenuItem("rotate card+preview", function() + self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0)) + rotatePreview() + end) end -- rotates the alt_view_angle -function reverse() +function rotatePreview() local angle = self.alt_view_angle if angle.y == 0 then angle.y = 180