viewing paste topic/7024- COLOR constants | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
 db/const.txt            | 23 +++++++++++++++++++++++
 doc/script_commands.txt | 21 ++++++++++++++-------
 2 files changed, 37 insertions(+), 7 deletions(-)
 
diff --git a/db/const.txt b/db/const.txt
index 8023fc3..9c67c9b 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -3354,3 +3354,26 @@ PC_NAME  0
 PC_PARTY   1
 PC_GUILD   2
 PC_MAP 3
+
+COLOR_Aqua 0x00FFFF
+COLOR_Black    0x000000
+COLOR_Blue 0x0000FF
+COLOR_Fuchsia  0xFF00FF
+COLOR_Gray 0x808080
+COLOR_Green    0x008000
+COLOR_Lime 0x00FF00
+COLOR_Maroon   0x800000
+COLOR_Navy 0x000080
+COLOR_Olive    0x808000
+COLOR_Orange   0xFFA500
+COLOR_Purple   0x800080
+COLOR_Red  0xFF0000
+COLOR_Silver   0xC0C0C0
+COLOR_Teal 0x008080
+COLOR_White    0xFFFFFF
+COLOR_Yellow   0xFFFF00
+COLOR_Pink 0xFFC0CB
+COLOR_Chocolate    0xD2691E
+COLOR_Cyan 0x00FFFF
+COLOR_Gold 0xFFD700
+COLOR_Violet   0xEE82EE
\ No newline at end of file
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 3a65c86..7107269 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1189,11 +1189,14 @@ contain three hexadecimal numbers representing colors as if they were HTML
 colors - ^FF0000 is bright red, ^00FF00 is bright green, ^0000FF is bright 
 blue, ^000000 is black. ^FF00FF is a pure magenta, but it's also a color 
 that is considered transparent whenever the client is drawing windows on 
-screen, so printing text in that color will have kind of a weird effect. 
-Once you've set a text's color to something, you have to set it back to 
-black unless you want all the rest of the text be in that color:
+screen, so printing text in that color will have kind of a weird effect.
+You can also use COLOR_ for the color effect, see the full list of the
+available ones in 'db/const.txt' under 'COLOR_'. Once you've set a text's
+color to something, you have to set it back to black unless you want all
+the rest of the text be in that color:
 
     mes "This is ^FF0000 red ^000000 and this is ^00FF00 green, ^000000 so.";
+    mes "Or you can use ^"+ COLOR_Red +" COLOR_ constants ^"+ COLOR_Black +".";
     
 Notice that the text coloring is handled purely by the client. If you use 
 non-English characters, the color codes might get screwed if they stick to 
@@ -2548,7 +2551,7 @@ Example 1: list party member names
    
    // list the party member names
    for (.@i = 0; .@i < .@count; ++.@i) {
-       mes (.@i +1) + ". ^0000FF" + .@name$[.@i] + "^000000";
+       mes (.@i +1) + ". ^"+ COLOR_Blue + .@name$[.@i] + "^"+ COLOR_Black;
    }
    close;
 
@@ -6387,7 +6390,7 @@ client and appears always green.
 This command will broadcast a message to all or most players, similar to 
 @kami/@kamib GM commands.
 
-   announce "This will be shown to everyone at all in yellow.",0;
+   announce "This will be shown to everyone at all in yellow.", bc_all;
 
 The region the broadcast is heard in (target), source of the broadcast and 
 the color the message will come up as is determined by the flags.
@@ -6424,13 +6427,17 @@ special flag is ignored. Optional parameters may not work well (or at all)
 depending on a game client used.
 
 The color parameter is a single number which can be in hexadecimal 
-notation.
+notation. COLOR_ constant can also be used, see the full list of the
+available ones in 'db/const.txt' under 'COLOR_'.
 
 For example:
-   announce "This will be shown to everyone at all in green.",bc_all,0x00FF00;
+   announce "This announcement will shown to everyone in green.",bc_all,0x00FF00;
 Will display a global announce in green. The color format is in RGB 
 (0xRRGGBB).
 
+Another example:
+   announce "This announcement will shown to everyone in purple.",bc_all,COLOR_Purple;
+
 In official scripts only two font-weights (types) are used:
  - normal (FW_NORMAL = 400, default),
  - bold   (FW_BOLD = 700).
 
Viewed 1292 times, submitted by AnnieRuru.