CLEO Help Move dialog

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,172
Solutions
6
Reaction score
898
Location
Lithuania
I try move dialog to cursor position when enter command /mdialog

PHP:
{$CLEO .cs}
 
 
//-------------MAIN---------------
0000: NOP
 
REPEAT
wait 0
UNTIL samp.Available() 
                            
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 7@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}test 1", 10, 10, 200, 20)
Dialog.AddCheckBox(0@, 2, "{FF0000}test 2", 10, 35, 200, 20)
Dialog.AddCheckBox(0@, 3, "{FF0000}test 3", 10, 60, 200, 20)
Dialog.AddCheckBox(0@, 4, "{FF0000}test 4", 10, 85, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor(0@, 1, -15952405)
Dialog.SetCheckBoxColor(0@, 2, -15952405)
Dialog.SetCheckBoxColor(0@, 3, -15952405)
Dialog.SetCheckBoxColor(0@, 4, -15952405) 
/// Dialog set not visibile
dialog.SetVisible(0@,0)
 
0B34: "test" @ShowDialog
0B34: "mdialog" @Move_Dialog
 
 
 
WHILE TRUE
wait 0
 
IF 
Dialog.IsVisible(0@)
THEN
    SAMP.ToggleCursor(1)
 
IF
0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
THEN
    IF AND
    3@ == 5 // ID
    2@ == 257 // pressed
    THEN
        Dialog.SetVisible(0@,0)
        SAMP.ToggleCursor(0)
   ELSE
       //nothing
    END
END
 
END // END Dialog.IsVisible(0@) 
END /// END WHILE TRUE
    
:ShowDialog
Dialog.SetVisible(0@, 1)
0B43: 

:Move_Dialog
0B12: 8@ = 8@ XOR TRUE

WHILE 8@ == TRUE 
    0B5E: get_cursor_pos 1@ 7@
    0AF5: write_string 1@ to_ini_file "Cleo\INI\Sarg.ini" section "Dialog Position" key "Position xy"
    0AF5: write_string 7@ to_ini_file "Cleo\INI\Sarg.ini" section "Dialog Position" key "Position z"
END
0B43:
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,172
Solutions
6
Reaction score
898
Location
Lithuania
I trying fix this shit 2 days... o_O
When i press check box then is be activated , but when i close dialog this going to deactivate , so how fix that?
@springfield
@supahdupahnubah

PHP:
        IF AND //////////////////////// Auto Scroll
        3@ == 3
        0B92: dialog 0@ checkbox 3@ is_checked
        THEN
            0A96: 7@ = actor $PLAYER_ACTOR struct
            0A8E: 8@ = 7@ + 0x0718
            0A8D: 8@ = read_memory 8@ size 1 virtual_protect 0
            8@ *= 0x1C
            0A8E: 9@ = 7@ + 0x5A0
            005a: 9@ += 8@
            9@ += 0x8
            0A8D: 9@ = read_memory 9@ size 4 virtual_protect 0
            IF 
            9@ == 2
            THEN
                0470: 10@ = actor $PLAYER_ACTOR current_weapon 
                06AB: set_actor $PLAYER_ACTOR all_weapons_hidden 1 
                wait 100 
                01B9: set_actor $PLAYER_ACTOR armed_weapon_to 10@   
            END 
        END

Why work ony this method?
@doroftel - Maybe this working method for you?
Maybe better use " call " method for all active checkbox?

PHP:
        IF AND //////////////////////// Auto Scroll
        3@ == 3
        0B92: dialog 0@ checkbox 3@ is_checked
        THEN
           11@ = TRUE
        ELSE
           IF
           8B92: dialog 0@ checkbox 3 is_checked
           THEN
               11@ = FALSE
           END
        END 
IF
11@ == TRUE
THEN
    wait 0
    0A96: 7@ = actor $PLAYER_ACTOR struct
    0A8E: 8@ = 7@ + 0x0718
    0A8D: 8@ = read_memory 8@ size 1 virtual_protect 0
    8@ *= 0x1C
    0A8E: 9@ = 7@ + 0x5A0
    005a: 9@ += 8@
    9@ += 0x8
    0A8D: 9@ = read_memory 9@ size 4 virtual_protect 0
    IF 
    9@ == 2
    THEN
    0470: 10@ = actor $PLAYER_ACTOR current_weapon 
    06AB: set_actor $PLAYER_ACTOR all_weapons_hidden 1 
    wait 100 
    01B9: set_actor $PLAYER_ACTOR armed_weapon_to 10@ 
    END 
END 
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
@Parazitas, dude wat are u tlkng about??

you have Dialog.CheckBoxIsChecked(dialog id, checkbox id)

what i showed you above is the easiest method to move dialog with a checkbox but ur 2 **** to understand :/ i l make you a vid and i l give you the entire source may be you l finally get it

ps. a checkbox is still checked when you close dialog
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,172
Solutions
6
Reaction score
898
Location
Lithuania
doroftel said:
@Parazitas, dude wat are u tlkng about??

you have Dialog.CheckBoxIsChecked(dialog id, checkbox id)

what i showed you above is the easiest method to move dialog with a checkbox but ur 2 **** to understand :/ i l make you a vid and i l give you the entire source may be you l finally get it

ps. a checkbox is still checked when you close dialog

Sorry , i wrong readed , my brain this week wont work correctly... o_O
 
Status
Not open for further replies.
Top