Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Sep 6, 2022
1 parent 948747a commit 7ab408c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion PartyPlanner/PartyPlanner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Authors>Zhyra</Authors>
<Company></Company>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
<Description>PartyVerse.app, directly on your client!</Description>
<Copyright>MIT</Copyright>
<PackageProjectUrl>https://github.com/edg-l/PartyPlanner</PackageProjectUrl>
Expand Down
14 changes: 11 additions & 3 deletions PartyPlanner/PartyVerseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ public class PartyVerseApi

public PartyVerseApi()
{
Assembly assembly = Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion!;
string version = "unknown";

try
{
Assembly assembly = Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
version = fvi.FileVersion!;
} catch(Exception e)
{
PluginLog.Error(e, "error loading assembly");
}

graphQL = new GraphQLHttpClient("https://partyverse.app/api/", new NewtonsoftJsonSerializer());
graphQL.HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Dalamud-PartyPlanner/" + version);
Expand Down
47 changes: 38 additions & 9 deletions PartyPlanner/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ public PluginUI(Configuration configuration)
{
this.configuration = configuration;
this.partyVerseApi = new PartyVerseApi();
windowTitle = "PartyPlanner";

Assembly assembly = Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion!;
windowTitle = string.Format("PartyPlanner v{0}", version);
try
{
Assembly assembly = Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion!;
windowTitle = string.Format("PartyPlanner v{0}", version);
} catch(Exception e)
{
PluginLog.Error(e, "error loading assembly");
}

Task.Run(async () =>
{
Expand Down Expand Up @@ -156,30 +163,52 @@ public void DrawEventRow(Models.EventType ev, Models.ServerType serverType)
ImGui.TableNextColumn();

ImGui.Spacing();
ImGui.PushStyleColor(ImGuiCol.Button, new Vector4(0.0742f, 0.530f, 0.150f, 1.0f));
if (ImGui.Button(ev.Title))

var greenColor = new Vector4(0.0742f, 0.530f, 0.150f, 1.0f);
ImGui.PushStyleColor(ImGuiCol.Button, greenColor);

var title = ev.Title;
if (title.Length > 30)
title = title[..30] + "...";

if (ImGui.Button(title))
{
this.eventDetails = ev;
EventDetailsOpen = true;
}
ImGui.PopStyleColor();

if(ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
ImGui.TextColored(greenColor, ev.Title);
ImGui.Text("Click to open a detailed view.");
ImGui.EndTooltip();
}

string description = ev.Description;

if (description.Length > 500)
description = description[..200] + "...";

ImGui.TableNextColumn();
var location = string.Format("[{0}] {1}", serverType.Name, ev.Location);


var originalLocation = string.Format("[{0}] {1}", serverType.Name, ev.Location);
var location = originalLocation;
if (location.Length > 50)
location = location[..50] + "...";

if (ImGui.Selectable(location))
{
ImGui.SetClipboardText(location);
}

if(ImGui.IsItemHovered())
if (ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
ImGui.SetTooltip("Click to copy");
ImGui.TextColored(greenColor, originalLocation);
ImGui.Text("Click to copy");
ImGui.EndTooltip();
}

Expand Down

0 comments on commit 7ab408c

Please sign in to comment.