Hmm. I don't really mod it, other than push or pop the button. How would you recommend I achieve the button then? Maybe scrap the MouseHook and have this test done at the beginning of the Submit Button's goto. If it fails the test, call the Mouse again, so that you are forced to go back.
Edit: My internet bugged out. The two successive posts happened by accident. You can delete the former.
Edit 2: Here's my rewrite--
Code: ;#####################
;Change Username
;#####################
;
;Allows you to change your username:
;
Username:
ld b,4
call PopGUIStacks
ld hl,ChangeUsernameData
ld de,saferam2
ld bc,ChangeUsernameDataEnd+1-ChangeUsernameData
ldir
ld de,saferam2+6
ld hl,Username
ld bc,8
ldir
ld de,saferam2+6+9
ld hl,Username
ld bc,8
ldir
ld hl,saferam2
call PushGUIStacks
ld hl,UsernameHook
call GUIMouse
ProcessUsername:
ld a,3
call GUIFindThis ;returns the current input username's GUI entry
add hl,8 ;points 'hl' to the start of the current username
push hl ;saves 'hl' to the stack
ex hl,de ;puts 'hl' into 'de'
ld a,0
ld b,8
ld hl,0
checksum: ;checksums the current username
ld (de),c ;if the checksum equals $00,
add a,c ;then we call GUIMouse again to force another username
inc de ;if not, then we have to check for a change
djnz checksum
cp 0
call z,GUIMouse
pop de
ld a,2
call GUIFindThis
push hl
push de
add hl,6
ld b,8
checksamenames: ;compares the current username with the old one, byte by byte
ld (de),a ;after encountering one change, it moves to 'finishcheck'
ld (hl),c ;increases 'hl' and 'de'
cp c ;repeats until 'b' is 0
jr nz,finishcheck ;if 'b' reaches 0, then we recall GUIMouse, to force a different input
inc de
inc hl
djnz checksamenames
ld hl,0
call GUIMouse
finishcheck: ;if both the checksum test and the difference tests are passed
pop hl ;overwrite old username with new one
ld de,Username
ld bc,8
ldir