+4665
File diff suppressed because it is too large
Load Diff
+24
-3
@@ -5,17 +5,31 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "inter.h"
|
#include "inter.h"
|
||||||
|
#include "inter-bold.h"
|
||||||
|
|
||||||
|
|
||||||
extern bool should_exit;
|
extern bool should_exit;
|
||||||
extern bool show_demo_window;
|
extern bool show_demo_window;
|
||||||
|
|
||||||
//standard year
|
//standard year
|
||||||
int year = 2025;
|
static int year = 2025;
|
||||||
|
|
||||||
|
static int current_year = 2025;
|
||||||
|
static int current_month = 1;
|
||||||
|
static int current_day = 1;
|
||||||
|
|
||||||
|
//fonts
|
||||||
|
static ImFont *inter_regular;
|
||||||
|
static ImFont *inter_bold;
|
||||||
|
|
||||||
int get_current_year(){
|
int get_current_year(){
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
struct tm tm = *localtime(&t);
|
struct tm tm = *localtime(&t);
|
||||||
|
|
||||||
|
current_year = tm.tm_year + 1900;
|
||||||
|
current_month = tm.tm_mon + 1;
|
||||||
|
current_day = tm.tm_mday;
|
||||||
|
|
||||||
// tm_year is years since 1900
|
// tm_year is years since 1900
|
||||||
return year = tm.tm_year + 1900;
|
return year = tm.tm_year + 1900;
|
||||||
}
|
}
|
||||||
@@ -50,7 +64,8 @@ int days_per_month(int year, int month){
|
|||||||
|
|
||||||
void init(){
|
void init(){
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
io.Fonts->AddFontFromMemoryCompressedTTF(inter_compressed_data, inter_compressed_size);
|
inter_regular = io.Fonts->AddFontFromMemoryCompressedTTF(inter_compressed_data, inter_compressed_size);
|
||||||
|
inter_bold = io.Fonts->AddFontFromMemoryCompressedTTF(inter_bold_compressed_data, inter_bold_compressed_size);
|
||||||
year = get_current_year();
|
year = get_current_year();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +375,13 @@ void per_frame(){
|
|||||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImU32(color));
|
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImU32(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
if(current_year == year && current_month == month && current_day == day ) {
|
||||||
|
ImGui::PushFont(inter_bold);
|
||||||
|
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
||||||
|
ImGui::PopFont();
|
||||||
|
} else {
|
||||||
|
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
||||||
|
}
|
||||||
|
|
||||||
if(ImGui::IsItemHovered()){
|
if(ImGui::IsItemHovered()){
|
||||||
if(selected_category != -1) {
|
if(selected_category != -1) {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user