72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
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 readonly 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
|
|
bet/step
|
|
roll settings
|
|
message/macro settings
|
|
*/
|
|
if (!configuration.SettingsInit)
|
|
{
|
|
ImGui.Text("Please set up settings");
|
|
return;
|
|
}
|
|
// 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");
|
|
}
|
|
}
|