CELE2 pixel mode

Forum for support and development discussion regarding the python based unified editor tool for CEGUI, known as CEED.

Moderators: CEGUI MVP, CEGUI Team

Senzin
Just popping in
Just popping in
Posts: 8
Joined: Sat Apr 23, 2011 01:13

CELE2 pixel mode

Postby Senzin » Sat Apr 23, 2011 01:59

I know CELE2 isn't being developed, but I find it a bit easier to use then CELE1. The "snap" ability of CELE1 seems to apply only to scale settings, but I'm doing all my work at the pixel level. Also it doesn't work as you're moving objects, but instead requires you to press 'g' after moving. CELE2, however, snaps to the pixel level and does it as I move, which is much better.

Anyway, is it possible to make pixels be the default move/size mode so I don't have to hold shift all the time? Perhaps in one of the .py files where it checks if the shift key is pressed I could just edit it to always be true? (It wouldn't hurt to know if this is possible in CELE1 as well.)

Senzin
Just popping in
Just popping in
Posts: 8
Joined: Sat Apr 23, 2011 01:13

Re: CELE2 pixel mode

Postby Senzin » Sat Apr 23, 2011 10:59

Figured it out for CELE2. In qtwidgets.py, there are two if statements at 175 and 181. For each if statement, swap the if and else bodies. This will make it so moving by pixels is the default and holding shift moves by scaling.

Original:

Code: Select all

    def __createUDimAdjusterFromModifierKeys(self, modifier_keys):
        if modifier_keys & Qt.AltModifier:
            if modifier_keys & Qt.ShiftModifier:
                return SetOffsetUDimAdjuster()
            else:
                return SetScaleUDimAdjuster()

        else:
            if modifier_keys & Qt.ShiftModifier:
                return UpdateOffsetUDimAdjuster()
            else:
                return UpdateScaleUDimAdjuster()

Edited:

Code: Select all

    def __createUDimAdjusterFromModifierKeys(self, modifier_keys):
        if modifier_keys & Qt.AltModifier:
            if modifier_keys & Qt.ShiftModifier:
                return SetScaleUDimAdjuster()
            else:
                return SetOffsetUDimAdjuster()

        else:
            if modifier_keys & Qt.ShiftModifier:
                return UpdateScaleUDimAdjuster()
            else:
                return UpdateOffsetUDimAdjuster()

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: CELE2 pixel mode

Postby Kulik » Sat Apr 23, 2011 19:40

This is a behavior change so I don't think it will be committed. However it's useful for people wanting just absolute positions.

Senzin
Just popping in
Just popping in
Posts: 8
Joined: Sat Apr 23, 2011 01:13

Re: CELE2 pixel mode

Postby Senzin » Sun Apr 24, 2011 06:06

Ah, I wasn't even thinking about my changes being committed. I posted them just so people could see. Though it would be nice if there was a checkbox or even a simple key-binding to enable the same swap. But CELE2 isn't being developed anymore and I've never done any GUI programming in Python, so I'm not even sure where to start.


Return to “Official Unified CEGUI Editor Tool (CEED)”

Who is online

Users browsing this forum: No registered users and 24 guests