fix: handle null groups

This commit is contained in:
Anna 2024-02-18 16:06:33 -05:00
parent 6997af9431
commit 090c71b44d
Signed by: anna
GPG Key ID: D0943384CD9F87D1
2 changed files with 8 additions and 6 deletions

View File

@ -15,10 +15,12 @@ public class Configuration : IPluginConfiguration {
public string SaveFileNameFormat = """
{{ captured_at_local | date.to_string '%Y/%m %b/[%H.%M.%S]' }}
{{ active_character.name }}
-
{{ location }}
{{ if active_character -}}
{{ active_character.name }} - {{ location }}
{{- else -}}
Main Menu or Loading Screen
{{- end -}}
{{- if area }} ({{ area }}) {{- end -}}
{{- if ward }} W{{ ward }} {{- end -}}
{{- if plot -}} P{{ plot }} {{- end -}}

View File

@ -139,7 +139,7 @@ internal class DatabaseTab : ITab {
ImGui.PushID($"{Enum.GetName(groupBy.Value)}-{label}");
using var popId = new OnDispose(ImGui.PopID);
if (!ImGui.TreeNodeEx(label)) {
if (!ImGui.TreeNodeEx(label ?? "<unknown>")) {
continue;
}
@ -168,7 +168,7 @@ internal class DatabaseTab : ITab {
using var treePop = new OnDispose(ImGui.TreePop);
var availWidth = ImGui.GetContentRegionAvail().X;
var buttonWidth = availWidth / 2 - ImGui.GetStyle().ItemSpacing.X;
var buttonWidth = availWidth / 2 - ImGui.GetStyle().ItemSpacing.X / 2;
if (ImGui.Button("Open", new Vector2(buttonWidth, 0))) {
Process.Start(new ProcessStartInfo(shot.Path) {