Jump to content

Metin2 - Color Formatter Class


Recommended Posts

  • Forum Moderator

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

Metin2 Color Formatter

A simple class writted for Python and C++ which convert the param-values into an string by a specific color rgb as hexadecimals.

  • Color constants module:
    https://www.webucator.com/blog/2015/03/python-color-constants-module/
    https://www.color-hex.com/color/ccffff
  • Python:
    from cff import CFF
    text = CFF.format('Metin2', 'green')
    text = CFF.format(8000, 'banana')
    text = CFF.format(412.55, 'red')
    text = CFF.format('Pending', '#113355')
    text = CFF.format('Item name:', 'springgreen', CFF.FLAG_NEW_TAB) + CFF.format(item.GetItemName(), 'chocolate')
    text = CFF.multi_format(('a', 'b', 'c'), 'red') # text[0], text[1], text[2]
  • C++:
    #include "cff.h"
    std::string text = CFF::format("Metin2", "green");
    std::string text = CFF::format(std::to_string(8000), "banana");
    std::string text = CFF::format(std::to_string(412.55), "red");
    std::string text = CFF::format("Pending", "#113355");
    std::string text = CFF::format("Item name:", "springgreen", CFF::FLAG_NEW_TAB) + CFF::format(pItemData->GetName(), "chocolate");
    
    std::vector<string> text = CFF::multi_format({"a", "b", "c"}, "red"); // text[0], text[1], text[2]

Github repository: 

This is the hidden content, please

  • Metin2 Dev 24
  • Dislove 1
  • Think 1
  • Good 5
  • Love 3
  • Love 22
Link to comment
Share on other sites

  • 3 months later...
  • Forum Moderator

This is the hidden content, please

#include "cff.h"
std::string text = CFF::format("Metin2", "green");
std::string text = CFF::format(std::to_string(8000), "banana");
std::string text = CFF::format(std::to_string(412.55), "red");
std::string text = CFF::format("Pending", "#113355");
std::string text = CFF::format("Item name:", "springgreen", CFF::FLAG_NEW_TAB) + CFF::format(pItemData->GetName(), "chocolate");

std::vector<string> text = CFF::multi_format({"a", "b", "c"}, "red"); // text[0], text[1], text[2]
  • Metin2 Dev 1
  • Love 7
Link to comment
Share on other sites

  • 3 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.