Code: |
// ColorText(sString, int nColor); FILE: dmfi_inc_sendtex
// This function will make sString be the specified color as specified in nColor. // Obsidian's COLOR constants are all included. Hex valus for colors are available // in nwn2_colors.2da string ColorText(string sString, int nColor); string ColorText(string sString, int nColor) { // PURPOSE: To convert sString to specified color: Note a few // colors I went to "light" versions. This was based on my // preference. A complete list of supported colors are in // nwn2_color.2da //Original Scripter: Demetrious //Last Modified By: Demetrious 11/13/6 if (nColor==COLOR_BLACK) return "<color=black>"+sString+"</color>"; else if (nColor==COLOR_BLUE) return "<color=cornflowerblue>"+sString+"</color>"; else if (nColor==COLOR_BLUE_DARK) return "<color=steelblue>"+sString+"</color>"; else if (nColor==COLOR_BROWN) return "<color=burlywood>"+sString+"</color>"; else if (nColor==COLOR_BROWN_DARK) return "<color=saddlebrown>"+sString+"</color>"; else if (nColor==COLOR_CYAN) return "<color=cyan>"+sString+"</color>"; else if (nColor==COLOR_GREEN) return "<color=lightgreen>"+sString+"</color>"; else if (nColor==COLOR_GREEN_DARK) return "<color=darkgreen>"+sString+"</color>"; else if (nColor==COLOR_GREY) return "<color=lightgrey>"+sString+"</color>"; else if (nColor==COLOR_MAGENTA) return "<color=magenta>"+sString+"</color>"; else if (nColor==COLOR_ORANGE) return "<color=orange>"+sString+"</color>"; else if (nColor==COLOR_ORANGE_DARK) return "<color=darkorange>"+sString+"</color>"; else if (nColor==COLOR_RED) return "<color=red>"+sString+"</color>"; else if (nColor==COLOR_RED_DARK) return "<color=darkred>"+sString+"</color>"; else if (nColor==COLOR_WHITE) return "<color=white>"+sString+"</color>"; else if (nColor==COLOR_YELLOW) return "<color=yellow>"+sString+"</color>"; else if (nColor==COLOR_YELLOW_DARK) return "<color=gold>"+sString+"</color>"; return sString; } |
C'est ça que tu voulais? Ca existait déjà dans le DMFI, je me suis dit que ça servait à rien de le refaire
Bah tu peux récupérer la fonction ainsi, le DMFI est certes un outil utile, mais la présentement tu n'en as pas l'utilité. J'ai juste nommé la source par respect envers leurs auteurs.