timestamp: use less callbacks in script overlays

all of these separate callbacks are error prone to update and hard to
test
This commit is contained in:
Max Weber
2021-05-25 17:08:29 -06:00
committed by Adam
parent adabb68ff1
commit 58e351dca6
5 changed files with 107 additions and 107 deletions

View File

@@ -288,6 +288,10 @@ LABEL245:
if_icmpeq LABEL256
jump LABEL1266
LABEL256:
iload 10 ; message uid
sconst "chatMessageBuilding"
runelite_callback
pop_int ; pop uid
iload 11
switch
1: LABEL259
@@ -312,14 +316,9 @@ LABEL256:
91: LABEL280
jump LABEL928
LABEL259:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 12
sconst ":"
join_string 3 ; + 1 for timestamp
join_string 2
sload 1
sload 14
sconst "</col>"
@@ -339,14 +338,9 @@ LABEL259:
istore 7
jump LABEL942
LABEL280:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 12
sconst ":"
join_string 3 ; + 1 for timestamp
join_string 2
sload 3
sload 14
sconst "</col>"
@@ -366,17 +360,12 @@ LABEL280:
istore 7
jump LABEL942
LABEL301:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "From "
sload 12
sconst ":"
sconst "privateChatFrom"
runelite_callback ; for prepending color tags
join_string 4 ; + 1 for timestamp
join_string 3
sconst "privChatUsername"
runelite_callback
sload 2
sload 14
sconst "</col>"
@@ -396,15 +385,10 @@ LABEL301:
istore 7
jump LABEL942
LABEL323:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 9
sload 14
sconst "</col>"
join_string 4 ; + 1 for timestamp
join_string 3
iload 8
iload 9
iconst 10616888
@@ -420,15 +404,10 @@ LABEL323:
istore 7
jump LABEL942
LABEL341:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 2
sload 14
sconst "</col>"
join_string 4 ; + 1 for timestamp
join_string 3
iload 8
iload 9
iconst 10616888
@@ -461,17 +440,12 @@ LABEL362:
LABEL373:
jump LABEL942
LABEL374:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "To "
sload 12
sconst ":"
sconst "privateChatTo"
runelite_callback ; for chat recolors
join_string 4 ; + 1 for timestamp
join_string 3
sconst "privChatUsername"
runelite_callback
sload 2
sload 14
sconst "</col>"
@@ -529,11 +503,6 @@ LABEL414:
istore 7
jump LABEL942
LABEL432:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "["
sload 5
sload 13
@@ -541,7 +510,7 @@ LABEL432:
sconst "] "
sload 12
sconst ":"
join_string 8 ; + 1 for time stamp
join_string 7
sload 6
sload 14
sconst "</col>"
@@ -623,17 +592,12 @@ LABEL485:
istore 7
jump LABEL548
LABEL515:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "["
sload 7
sload 13
sconst "</col>"
sconst "]"
join_string 6 ; + 1 for timestamp
join_string 5
iconst -1
iconst 0
iconst 0
@@ -1003,13 +967,7 @@ LABEL845:
LABEL864:
jump LABEL942
LABEL865:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 14
join_string 2
invoke 2066
istore 13
sstore 15
@@ -1077,13 +1035,7 @@ LABEL913:
LABEL927:
jump LABEL942
LABEL928:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 14
join_string 2 ; prepend the timestamp
iload 8
iload 9
iconst 10616888

View File

@@ -400,6 +400,10 @@ CHAT_FILTER:
if_icmpeq LABEL356 ; Check if we are building this message
jump LABEL530
LABEL356:
iload 12 ; message uid
sconst "chatMessageBuilding"
runelite_callback
pop_int
iload 17
switch
3: LABEL359
@@ -409,19 +413,14 @@ LABEL356:
jump LABEL446
LABEL359:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push a container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4
sconst "splitPrivChatUsernameColor"
runelite_callback
sconst "From "
sload 1
sconst ":"
sconst "privateChatSplitFrom"
runelite_callback
sconst "</col>"
join_string 6 ; Add the timestamp to the message
join_string 5
sload 4
sload 0
sconst "</col>"
@@ -443,19 +442,14 @@ LABEL359:
jump LABEL462
LABEL385:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4
sconst "splitPrivChatUsernameColor"
runelite_callback
sconst "To "
sload 1
sconst ":"
sconst "privateChatSplitTo"
runelite_callback
sconst "</col>"
join_string 6 ; Add the timestamp to the message
join_string 5
sload 4
sload 0
sconst "</col>"
@@ -477,15 +471,10 @@ LABEL385:
jump LABEL462
LABEL411:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push a container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4 ; Load the log in/out message
sload 4
sload 0
sconst "</col>"
join_string 4
join_string 3
iload 9
iload 10
iconst 10682368