Skip to content

Commit

Permalink
Enable [print] color= and deprecate red,green,blue= keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Dec 10, 2015
1 parent 8f35c4b commit 956e5f9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scripting/game_lua_kernel.cpp
Expand Up @@ -2255,7 +2255,15 @@ int game_lua_kernel::intf_print(lua_State *L) {

int size = cfg["size"].to_int(font::SIZE_SMALL);
int lifetime = cfg["duration"].to_int(50);
SDL_Color color = create_color(cfg["red"], cfg["green"], cfg["blue"]);

SDL_Color color;

if (!cfg["color"].empty()) {
color = string_to_color(cfg["color"]);
} else {
WRN_LUA << "[print] red,green,blue= format is deprecated. Use color= instead" << std::endl;
color = create_color(cfg["red"], cfg["green"], cfg["blue"]);
}

const SDL_Rect& rect = game_display_->map_outside_area();

Expand Down

0 comments on commit 956e5f9

Please sign in to comment.