diff options
author | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-13 15:02:59 +0000 |
---|---|---|
committer | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-13 15:02:59 +0000 |
commit | 94024e2b57b31ee92bb81fc48ce236283330b60c (patch) | |
tree | a526015cfcdd33c3482b710dc4fa22bbec4e0090 /src/gui | |
parent | c9175a4d140f4c852aa5195b72ad9bd1ae8d5cee (diff) | |
download | mana-client-94024e2b57b31ee92bb81fc48ce236283330b60c.tar.gz mana-client-94024e2b57b31ee92bb81fc48ce236283330b60c.tar.bz2 mana-client-94024e2b57b31ee92bb81fc48ce236283330b60c.tar.xz mana-client-94024e2b57b31ee92bb81fc48ce236283330b60c.zip |
Added support for different colored fonts for different being types
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 47 | ||||
-rw-r--r-- | src/gui/gui.h | 8 |
2 files changed, 55 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e56afc76..edc25152 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -56,6 +56,13 @@ gcn::Font *hitYellowFont; // Font used to display speech and player names gcn::Font *speechFont; +// Font for displaying NPC names +gcn::Font *npcNameFont; +// Font for displaying mob names +gcn::Font *mobNameFont; +// Font for displaying GM names +gcn::Font *gmNameFont; + class GuiConfigListener : public ConfigListener { public: @@ -128,6 +135,46 @@ Gui::Gui(Graphics *graphics): logger->error("Unable to load rpgfont_wider.png!"); } + // Set npc name font + try { + npcNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-blue.png", + " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" + "αΑιΙνΝσΣϊΪηλ₯£’‘ΏΰγυκρΡφόδΦάΔίψθΘεΕ" + ); + } + catch (gcn::Exception e) + { + logger->error("Unable to load rpgfont_wider-blue.png!"); + } + + // Set monster name font + try { + mobNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-orange.png", + " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" + "αΑιΙνΝσΣϊΪηλ₯£’‘ΏΰγυκρΡφόδΦάΔίψθΘεΕ" + ); + } + catch (gcn::Exception e) + { + logger->error("Unable to load rpgfont_wider-orange.png!"); + } + + // Set GM name font + try { + gmNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-green.png", + " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" + "αΑιΙνΝσΣϊΪηλ₯£’‘ΏΰγυκρΡφόδΦάΔίψθΘεΕ" + ); + } + catch (gcn::Exception e) + { + logger->error("Unable to load rpgfont_wider-green.png!"); + } + + gcn::Widget::setGlobalFont(mGuiFont); // Load hits' colourful fonts diff --git a/src/gui/gui.h b/src/gui/gui.h index d2a832c7..f250a8e3 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -119,4 +119,12 @@ extern gcn::Font *hitYellowFont; */ extern gcn::Font *speechFont; +/** + * being name fonts + */ +extern gcn::Font *npcNameFont; +extern gcn::Font *mobNameFont; +extern gcn::Font *gmNameFont; + + #endif |