pawn-lang / YSI-Includes

Just the YSI include files, none of the extra stuff.
211 stars 105 forks source link

QWERTYUIOP for YSI 4.0? #30

Open PatchwerkQWER opened 9 years ago

PatchwerkQWER commented 9 years ago

Hi, is possible to use QWERTYUIOP with YSI 4.0? Because I somewhere read it's just for 3.1. I like the idea of QWERTYUIOP mainly D, G, W (if is possible) and Y.

Thanks

Misiur commented 9 years ago

G and W might work, not certain about D, it seems it uses outdated api. Y uses Command_TouchNamed which is not ported (no idea when it will be)

Crayder commented 9 years ago

I still use W, that's really the only one I ever used (I have renamed it to "Sleep"). The others would be nice shortcuts though, I'd like to see this.

Y-Less commented 9 years ago

I actually think this will just work:

https://github.com/Misiur/YSI-Includes/blob/master/y_commands.inc#L1104-L1156

Misiur commented 9 years ago

How did I miss that? Huh.

PatchwerkQWER commented 9 years ago

Okay, I test it and here are results: First problem - undefinited symbol E_CALLBACK_DATA I find it's in y_inline so i just put #include <YSI\y_inline>. Next error undefinited symbol E_CALLBACK_DATA_FLAGS What I must do? It's in public @QWERTY_Wait(a, b, c, d)

Thanks

Crayder commented 9 years ago

@PatchwerkQWER: That's weird, I have the following included and it works fine:

#include <YSI\y_inline>
#include <YSI\y_commands>
#include <YSI\y_dialog>
Crayder commented 9 years ago

This is how I have my sleep function:

#define Sleep(%0)%1; {new QWERTY@W;static const _QWERTY@W[]="@WAIT:...:";if(!Inline_Loop(INLINE_LOOP_PATTERNS,QWERTY@W,_QWERTY@W))return QWERTY_Wait((%0),callback_tag:_QWERTY@W);}
forward @QWERTY_Wait(a, b, c, d); public @QWERTY_Wait(a, b, c, d)
{
        new
                res[E_CALLBACK_DATA];
        res[E_CALLBACK_DATA_FLAGS] = e_CALLBACK_FLAGS:a;
        res[E_CALLBACK_DATA_POINTER] = b;
        res[E_CALLBACK_DATA_FORMAT] = c;
        res[E_CALLBACK_DATA_ALLOC] = Alloc:d;
        Callback_Call(res);
        Callback_Release(res);
}
stock QWERTY_Wait(delay, callback:c)
{
        new
                res[E_CALLBACK_DATA];
        Callback_Get(c, res, _F<>);
        SetTimerEx("@QWERTY_Wait", delay, false, "iiii", _:res[E_CALLBACK_DATA_FLAGS], res[E_CALLBACK_DATA_POINTER], res[E_CALLBACK_DATA_FORMAT], _:res[E_CALLBACK_DATA_ALLOC]);
        return cellmin;
}

This was taken directly from QWERTYUIOP, just renamed the function to "Sleep."

Crayder commented 9 years ago

Fuck, I just realised that I haven't compiled that script since YSI 3.1, the E_CALLBACK_DATA_FLAGS is in YSI 3.1's y_inline. https://github.com/Misiur/YSI/blob/33c14380439f644298dde83715973246d29153a4/pawno/include/YSI/y_inline.inc

Misiur commented 9 years ago

Oh, I was wrong about D, it uses macros from y_text, so it should work as well! So, I know only of problem with new inline functions api.