MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / drawTitle

Function drawTitle

TheForceEngine/TFE_Editor/editor.cpp:679–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677 }
678
679 void drawTitle()
680 {
681 DisplayInfo info;
682 TFE_RenderBackend::getDisplayInfo(&info);
683 const s32 winWidth = info.width;
684
685 const Project* project = project_get();
686 char fullTitle[1024];
687 const char* title = project->active ? project->name : c_readOnly;
688 if (s_editorAssetType == TYPE_LEVEL)
689 {
690 sprintf(fullTitle, "%s - %s", title, LevelEditor::s_level.name.c_str());
691 if (LevelEditor::levelIsDirty())
692 {
693 strcat(fullTitle, "*");
694 }
695 }
696 else
697 {
698 strcpy(fullTitle, title);
699 }
700 const s32 titleWidth = (s32)ImGui::CalcTextSize(fullTitle).x;
701
702 const ImVec4 titleColor = getTextColor(project->active ? TEXTCLR_TITLE_ACTIVE : TEXTCLR_TITLE_INACTIVE);
703 ImGui::SameLine(f32((winWidth - titleWidth)/2));
704 ImGui::TextColored(titleColor, "%s", fullTitle);
705 }
706
707 void popupCallback_openAssetBrowser(EditorPopup popupId)
708 {

Callers 1

menuFunction · 0.85

Calls 5

getDisplayInfoFunction · 0.85
project_getFunction · 0.85
levelIsDirtyFunction · 0.85
getTextColorFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected