Mini contribution, Hardcore names in red

Mini contribution, Hardcore names in red

Hi, after testing with Dev C + + to compile without result, probe with Visual Studio and ...... it worked! I can now modify or add things to the source, and version 0.18 is great! congratulations to the staff for the great job. Today I bring a small modification to the source for hardcore characters, differentiate them from the menu of characters:

FontEngine.h

Search:

const SDL_Color FONT_BLACK = {0,0,0,0};

Add after: 

const SDL_Color FONT_RED = {255,0,0};

 

GameStateLoad.cpp

Search in GameStateLoad::readGameSlot:

else if (infile.key == "class")

stats[slot].character_class = infile.val;

Add after:

else if (infile.key == "permadeath")

stats[slot].permadeath = atoi(infile.val.c_str());

 

Search in GameStateLoad::render():

// name

label.x = slot_pos[slot].x + name_pos.x;

label.y = slot_pos[slot].y + name_pos.y;

label_name[slot]->set(label.x, label.y, name_pos.justify, name_pos.valign, stats[slot].name, color_normal, name_pos.font_style);

label_name[slot]->render();

 

And change for:

label.x = slot_pos[slot].x + name_pos.x;

label.y = slot_pos[slot].y + name_pos.y;

if(stats[slot].permadeath == 1){

label_name[slot]->set(label.x, label.y, name_pos.justify, name_pos.valign, stats[slot].name, FONT_RED, name_pos.font_style);

label_name[slot]->render();

} else {

label_name[slot]->set(label.x, label.y, name_pos.justify, name_pos.valign, stats[slot].name, color_normal, name_pos.font_style);

label_name[slot]->render();

}

 

Preview:

 

 

similar to diablo 2 hardcore characters, names in red to differentiate

 

 

Greetings!