#include "common.h"

// Skills tab
void DrawTabSkills(int cX, int cY, int *skills, int selected_skill, bool edit_mode)
{
    DrawText("SKILLS",cX,cY,22,C_GOLD_L);
    HDivider(cX,cY+28,640);
    int col_w=310;
    for(int i=0;i<SKILL_COUNT;i++){
        int col=i<11?0:1, row=i%11;
        int x=cX+col*(col_w+20), y=cY+38+row*28;
        bool sel=(i==selected_skill&&edit_mode);
        Color bg=row%2==0?C_PANEL2:C_PANEL;
        DrawRectangle(x,y,col_w,24,bg);
        if(sel){
            DrawRectangleRoundedLinesEx((Rectangle){(float)x,(float)y,(float)col_w,24.f},0.1f,8,1.5f,C_GOLD);
            DrawRectangle(x,y,3,24,C_GOLD);
        }
        DrawText(skill_names[i],x+8,y+4,14,sel?C_GOLD_L:C_TEXT);
        char vs[16]; snprintf(vs,sizeof(vs),"%d",skills[i]);
        Color vc=skills[i]>0?C_GREEN_L:skills[i]<0?C_RED_L:C_MUTED;
        DrawText(vs,x+col_w-MeasureText(vs,14)-8,y+4,14,vc);
    }
}
