additional settings changes
This commit is contained in:
65
HighRollerClassic/Windows/GambaWindow.cs
Normal file
65
HighRollerClassic/Windows/GambaWindow.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.Gui.ContextMenu;
|
||||
using Dalamud.Interface.Windowing;
|
||||
|
||||
namespace HighRollerClassic.Windows;
|
||||
|
||||
public class GambaWindow : Window, IDisposable
|
||||
{
|
||||
private readonly Configuration configuration;
|
||||
|
||||
// todo remove state as the window will only be opened by us calling it with parameters window id
|
||||
private readonly Player? player;
|
||||
private readonly Plugin plugin;
|
||||
private string name;
|
||||
|
||||
public GambaWindow(Plugin plugin, MenuTargetDefault target)
|
||||
: base($"High Roller Classic###{target.TargetContentId}",
|
||||
ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
||||
{
|
||||
SizeConstraints = new WindowSizeConstraints
|
||||
{
|
||||
MinimumSize = new Vector2(375, 330),
|
||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
||||
};
|
||||
|
||||
this.plugin = plugin;
|
||||
configuration = this.plugin.Configuration;
|
||||
|
||||
player = configuration.players.GetOrCreatePlayer(target);
|
||||
name = target.TargetName;
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
// TODO check if local player is null and if it is do not load anything
|
||||
|
||||
if (!plugin.PlayerIsLoaded())
|
||||
{
|
||||
ImGui.Text("Player must be loaded in the world in order for the plugin to function");
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO check if all settings are set
|
||||
roll settings
|
||||
message/macro settings
|
||||
*/
|
||||
// todo if player is null, then allow user to set user by clicking on them manually
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
ImGui.Text(
|
||||
"No target selected, please open HRC by right clicking the player and choosing the 'High Roller Classic' option");
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui.Text($"Player: {name}");
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.Text($"Bank balance: {player.Bank} gil");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user