mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-01 13:06:58 +03:00
IRCC 0.21: Dont draw vertical separator when scrollbar is active, input textbox always has focus now, CTCP action is now also supported in channels, fixed bug which: caused some usercommands not to work, added usercommand /me for CTCP action.
git-svn-id: svn://kolibrios.org@4659 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f813e5d1d8
commit
0001dc9a16
@ -121,20 +121,22 @@ draw_window: ; Completely redraw the window, recalculate all coordinates and
|
|||||||
cmp [edi + window.type], WINDOWTYPE_CHANNEL
|
cmp [edi + window.type], WINDOWTYPE_CHANNEL
|
||||||
jne .not_channel
|
jne .not_channel
|
||||||
|
|
||||||
; draw a vertical separator line
|
mov [scroll1.all_redraw], 1
|
||||||
; TODO: dont draw this if we draw textbox scrollbar ??
|
call draw_channel_list
|
||||||
|
|
||||||
|
; draw a vertical separator line when there is no scrollbar
|
||||||
|
cmp [scroll2.all_redraw], 1
|
||||||
|
jne .not_channel
|
||||||
|
|
||||||
mov ebx, [xsize]
|
mov ebx, [xsize]
|
||||||
sub ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
|
sub ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
|
||||||
push bx
|
push bx
|
||||||
shl ebx, 16
|
shl ebx, 16
|
||||||
pop bx
|
pop bx
|
||||||
mov ecx, [ysize]
|
mov ecx, [ysize]
|
||||||
add ecx, TOP_Y SHL 16 -(BOTTOM_Y) ;;;;
|
add ecx, TOP_Y shl 16 - (BOTTOM_Y)
|
||||||
mov edx, [colors.work_graph]
|
mov edx, [colors.work_graph]
|
||||||
mcall 38
|
mcall 38
|
||||||
|
|
||||||
mov [scroll1.all_redraw], 1
|
|
||||||
call draw_channel_list
|
|
||||||
.not_channel:
|
.not_channel:
|
||||||
|
|
||||||
; draw editbox
|
; draw editbox
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
;; ;;
|
;; ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
version equ '0.20'
|
version equ '0.21'
|
||||||
|
|
||||||
; connection status
|
; connection status
|
||||||
STATUS_DISCONNECTED = 0
|
STATUS_DISCONNECTED = 0
|
||||||
@ -563,7 +563,7 @@ import boxlib,\
|
|||||||
scrollbar_mouse,'scrollbar_v_mouse'
|
scrollbar_mouse,'scrollbar_v_mouse'
|
||||||
|
|
||||||
; width, left, top
|
; width, left, top
|
||||||
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_focus, 25, 25
|
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_always_focus, 25, 25
|
||||||
; xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol
|
; xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol
|
||||||
scroll1 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
|
scroll1 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
|
||||||
scroll2 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
|
scroll2 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
|
||||||
|
@ -257,10 +257,6 @@ cmd_privmsg:
|
|||||||
jz .fail2
|
jz .fail2
|
||||||
pop esi
|
pop esi
|
||||||
call skip_parameter ; our own nickname
|
call skip_parameter ; our own nickname
|
||||||
|
|
||||||
cmp byte[esi], 1 ; Client to Client protocol?
|
|
||||||
je cmd_ctcp
|
|
||||||
|
|
||||||
jmp .print
|
jmp .print
|
||||||
|
|
||||||
.channel:
|
.channel:
|
||||||
@ -269,7 +265,9 @@ cmd_privmsg:
|
|||||||
jz .fail
|
jz .fail
|
||||||
|
|
||||||
.print:
|
.print:
|
||||||
; nope, just plain old privmsg, print it using '<nick> message' format
|
cmp byte[esi], 1 ; Client to Client protocol?
|
||||||
|
je cmd_ctcp
|
||||||
|
|
||||||
if TIMESTAMP
|
if TIMESTAMP
|
||||||
call print_timestamp
|
call print_timestamp
|
||||||
end if
|
end if
|
||||||
|
@ -117,7 +117,6 @@ user_commands:
|
|||||||
.number = ($ - user_commands) / 8
|
.number = ($ - user_commands) / 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
server_command:
|
server_command:
|
||||||
|
|
||||||
mov eax, dword[usercommand+1] ; skip '/'
|
mov eax, dword[usercommand+1] ; skip '/'
|
||||||
@ -126,7 +125,7 @@ server_command:
|
|||||||
mov edi, user_commands
|
mov edi, user_commands
|
||||||
mov ecx, user_commands.number
|
mov ecx, user_commands.number
|
||||||
cmp [status], STATUS_CONNECTED
|
cmp [status], STATUS_CONNECTED
|
||||||
jne .loop
|
je .loop
|
||||||
mov ecx, user_commands.number2
|
mov ecx, user_commands.number2
|
||||||
.loop:
|
.loop:
|
||||||
scasd
|
scasd
|
||||||
@ -137,6 +136,10 @@ server_command:
|
|||||||
|
|
||||||
cmp [status], STATUS_CONNECTED
|
cmp [status], STATUS_CONNECTED
|
||||||
jne .notconnected
|
jne .notconnected
|
||||||
|
; Commands shorter then 3 chars are placed here
|
||||||
|
and eax, 0x00ffffff
|
||||||
|
cmp eax, 'me '
|
||||||
|
je cmd_usr_me
|
||||||
|
|
||||||
jmp cmd_usr_send ; If none of the previous commands, just send to server
|
jmp cmd_usr_send ; If none of the previous commands, just send to server
|
||||||
|
|
||||||
@ -432,7 +435,6 @@ cmd_usr_part:
|
|||||||
cmd_usr_close_window:
|
cmd_usr_close_window:
|
||||||
|
|
||||||
mov esi, [window_active]
|
mov esi, [window_active]
|
||||||
mov [window_print], esi
|
|
||||||
cmp [esi + window.type], WINDOWTYPE_SERVER
|
cmp [esi + window.type], WINDOWTYPE_SERVER
|
||||||
je .not_channel
|
je .not_channel
|
||||||
|
|
||||||
@ -540,6 +542,74 @@ cmd_usr_ctcp:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cmd_usr_me:
|
||||||
|
|
||||||
|
; prepare a 'PRIVMSG '
|
||||||
|
mov dword[packetbuf], 'PRIV'
|
||||||
|
mov dword[packetbuf+4], 'MSG '
|
||||||
|
lea edi, [packetbuf+8]
|
||||||
|
|
||||||
|
; append the destination (nickname/channel)
|
||||||
|
mov esi, [window_active]
|
||||||
|
lea esi, [esi + window.name]
|
||||||
|
@@:
|
||||||
|
lodsb
|
||||||
|
test al, al
|
||||||
|
je @f
|
||||||
|
stosb
|
||||||
|
jmp @r
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; Make the CTCP action header
|
||||||
|
mov eax, ' :' + 0x01 shl 16 + 'A' shl 24
|
||||||
|
stosd
|
||||||
|
mov eax, 'CTIO'
|
||||||
|
stosd
|
||||||
|
mov al, 'N'
|
||||||
|
stosb
|
||||||
|
|
||||||
|
; copy the message itself (including first space)
|
||||||
|
mov esi, usercommand+3
|
||||||
|
@@:
|
||||||
|
lodsb
|
||||||
|
cmp al, 13
|
||||||
|
je @f
|
||||||
|
stosb
|
||||||
|
jmp @r
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; end of CTCP message
|
||||||
|
mov al, 0x01
|
||||||
|
stosb
|
||||||
|
mov ax, 0x0a0d
|
||||||
|
stosw
|
||||||
|
|
||||||
|
; now send it to the server
|
||||||
|
lea esi, [edi - packetbuf] ; calculate length
|
||||||
|
mcall send, [socketnum], packetbuf, , 0 ; and finally send to server
|
||||||
|
|
||||||
|
; print to local window
|
||||||
|
if TIMESTAMP
|
||||||
|
call print_timestamp
|
||||||
|
end if
|
||||||
|
|
||||||
|
mov esi, action_header
|
||||||
|
call print_asciiz
|
||||||
|
|
||||||
|
mov esi, user_nick
|
||||||
|
call print_asciiz
|
||||||
|
|
||||||
|
mov esi, usercommand+3
|
||||||
|
mov bl, 13
|
||||||
|
call print_string
|
||||||
|
|
||||||
|
mov al, 10
|
||||||
|
call print_char
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; The user typed some undefined command, just recode it and send to the server
|
; The user typed some undefined command, just recode it and send to the server
|
||||||
cmd_usr_send:
|
cmd_usr_send:
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
user_prefixes db '~&@%+ ', 0 ; in descending order
|
user_prefixes db '~&@%+ ', 0 ; in descending order
|
||||||
|
|
||||||
|
; TODO: update selected user if needed
|
||||||
; esi is ptr to nick
|
; esi is ptr to nick
|
||||||
; ebx is ptr to window
|
; ebx is ptr to window
|
||||||
align 4
|
align 4
|
||||||
@ -120,7 +121,7 @@ user_add:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; TODO: update selected user if needed
|
||||||
; esi is ptr to nick
|
; esi is ptr to nick
|
||||||
; ebx is ptr to window
|
; ebx is ptr to window
|
||||||
align 4
|
align 4
|
||||||
|
Loading…
Reference in New Issue
Block a user