Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package foundry.veil.api.client.editor;

import foundry.imgui.api.ImGuiMC;
import foundry.veil.Veil;
import foundry.veil.VeilClient;
import foundry.veil.api.event.VeilRegisterInspectorsEvent;
Expand Down Expand Up @@ -38,7 +37,12 @@
*/
public class EditorManager implements VeilEditorEnvironment, PreparableReloadListener {

public static final ResourceLocation DEFAULT_FONT = Veil.veilPath("jetbrains_mono");
/**
* @deprecated Use ImGuiMC#DEFAULT_FONT instead
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public static final ResourceLocation DEFAULT_FONT = ResourceLocation.fromNamespaceAndPath("imguimc", "jetbrains_mono");

private final Map<Inspector, ImBoolean> editors;
private final Map<ResourceLocation, ResourceFileEditor<?>> resourceFileEditors;
Expand Down Expand Up @@ -73,8 +77,6 @@ public void render() {
Minecraft.getInstance());
}

ImGui.pushFont(ImGuiMC.getFont(DEFAULT_FONT, false, false));

if (ImGui.beginMainMenuBar()) {
ImFont font = ImGui.getFont();
float dingleWidth = font.calcTextSizeAX(ImGui.getFontSize(), Float.MAX_VALUE, 0, " Veil ") + 1;
Expand Down Expand Up @@ -144,8 +146,6 @@ public void render() {

next.render();
}

ImGui.popFont();
}

@ApiStatus.Internal
Expand All @@ -154,17 +154,13 @@ public void renderLast() {
return;
}

ImGui.pushFont(ImGuiMC.getFont(DEFAULT_FONT, false, false));

for (Map.Entry<Inspector, ImBoolean> entry : this.editors.entrySet()) {
Inspector inspector = entry.getKey();
ImBoolean enabled = entry.getValue();
if (enabled.get()) {
inspector.renderLast();
}
}

ImGui.popFont();
}

@ApiStatus.Internal
Expand Down
Loading
Loading