Basic time per category is done, needs cleanup.
This commit is contained in:
91
main.c
91
main.c
@@ -138,6 +138,7 @@ int main(int argc, char *argv[])
|
||||
U32 current_activity = 0;
|
||||
|
||||
Activity_Stat activities_stats[activity_type_COUNT];
|
||||
memset(activities_stats, 0, sizeof(activities_stats));
|
||||
|
||||
S32 window_w = 800;
|
||||
S32 window_h = 450;
|
||||
@@ -238,45 +239,57 @@ int main(int argc, char *argv[])
|
||||
activities[current_activity].ended = now_s;
|
||||
}
|
||||
}
|
||||
//
|
||||
// if(activity_button((padding_x*3)+(width*2), 60, width, (window_h-70), "Projects", font_size, YELLOW)) {
|
||||
// if(activities[current_activity].activity != projects) {
|
||||
// printf("Activity PROJECTS\n");
|
||||
//
|
||||
// current_activity++;
|
||||
//
|
||||
// activities[current_activity].activity = projects;
|
||||
// activities[current_activity].color = YELLOW;
|
||||
// activities[current_activity].began = now_s;
|
||||
// activities[current_activity].ended = now_s;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(activity_button((padding_x*4)+(width*3), 60, width, (window_h-70), "Gaming", font_size, GREEN)) {
|
||||
// if(activities[current_activity].activity != gaming) {
|
||||
// printf("Activity GAMING\n");
|
||||
//
|
||||
// current_activity++;
|
||||
//
|
||||
// activities[current_activity].activity = gaming;
|
||||
// activities[current_activity].color = GREEN;
|
||||
// activities[current_activity].began = now_s;
|
||||
// activities[current_activity].ended = now_s;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(activity_button((padding_x*5)+(width*4), 60, width, (window_h-70), "Exercise", font_size, PURPLE)) {
|
||||
// if(activities[current_activity].activity != exercise) {
|
||||
// printf("Activity EXERCISE\n");
|
||||
//
|
||||
// current_activity++;
|
||||
//
|
||||
// activities[current_activity].activity = exercise;
|
||||
// activities[current_activity].color = PURPLE;
|
||||
// activities[current_activity].began = now_s;
|
||||
// activities[current_activity].ended = now_s;
|
||||
// }
|
||||
// }
|
||||
|
||||
hrs = activities_stats[projects].total_seconds / 60 / 60;
|
||||
mins = activities_stats[projects].total_seconds / 60;
|
||||
secs = activities_stats[projects].total_seconds - (60 * mins);
|
||||
snprintf(activities_stats[projects].seconds_str, sizeof(activities_stats[projects].seconds_str), "%02lu:%02lu:%02lu", hrs, mins, secs);
|
||||
if(activity_button((padding_x*3)+(width*2), 60, width, (window_h-70), "Projects", activities_stats[projects].seconds_str, font_size, YELLOW)) {
|
||||
if(activities[current_activity].activity != projects) {
|
||||
printf("Activity PROJECTS\n");
|
||||
|
||||
current_activity++;
|
||||
|
||||
activities[current_activity].activity = projects;
|
||||
activities[current_activity].color = YELLOW;
|
||||
activities[current_activity].began = now_s;
|
||||
activities[current_activity].ended = now_s;
|
||||
}
|
||||
}
|
||||
|
||||
hrs = activities_stats[gaming].total_seconds / 60 / 60;
|
||||
mins = activities_stats[gaming].total_seconds / 60;
|
||||
secs = activities_stats[gaming].total_seconds - (60 * mins);
|
||||
snprintf(activities_stats[gaming].seconds_str, sizeof(activities_stats[gaming].seconds_str), "%02lu:%02lu:%02lu", hrs, mins, secs);
|
||||
if(activity_button((padding_x*4)+(width*3), 60, width, (window_h-70), "Gaming", activities_stats[gaming].seconds_str, font_size, GREEN)) {
|
||||
if(activities[current_activity].activity != gaming) {
|
||||
printf("Activity GAMING\n");
|
||||
|
||||
current_activity++;
|
||||
|
||||
activities[current_activity].activity = gaming;
|
||||
activities[current_activity].color = GREEN;
|
||||
activities[current_activity].began = now_s;
|
||||
activities[current_activity].ended = now_s;
|
||||
}
|
||||
}
|
||||
|
||||
hrs = activities_stats[exercise].total_seconds / 60 / 60;
|
||||
mins = activities_stats[exercise].total_seconds / 60;
|
||||
secs = activities_stats[exercise].total_seconds - (60 * mins);
|
||||
snprintf(activities_stats[exercise].seconds_str, sizeof(activities_stats[exercise].seconds_str), "%02lu:%02lu:%02lu", hrs, mins, secs);
|
||||
if(activity_button((padding_x*5)+(width*4), 60, width, (window_h-70), "Exercise", activities_stats[exercise].seconds_str, font_size, PURPLE)) {
|
||||
if(activities[current_activity].activity != exercise) {
|
||||
printf("Activity EXERCISE\n");
|
||||
|
||||
current_activity++;
|
||||
|
||||
activities[current_activity].activity = exercise;
|
||||
activities[current_activity].color = PURPLE;
|
||||
activities[current_activity].began = now_s;
|
||||
activities[current_activity].ended = now_s;
|
||||
}
|
||||
}
|
||||
|
||||
// DrawTextEx(state.font, "Hello, world! && How are you?", (Vector2){100, 400}, font_size, 2, BLUE);
|
||||
EndDrawing();
|
||||
|
||||
Reference in New Issue
Block a user