// Discord Rich Presence - plugin made by Mathew Simon.

#pragma once

#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "DiscordRichPresenceTypes.h"
#include "DiscordRichPresenceSettings.generated.h"

/**
 * Discord Rich Presence - plugin made by Mathew Simon.
 *
 * Reglages ecrits dans Config/DefaultGame.ini.
 */
UCLASS(config = Game, defaultconfig, meta = (DisplayName = "Discord Rich Presence"))
class DISCORDRICHPRESENCE_API UDiscordRichPresenceSettings : public UDeveloperSettings
{
	GENERATED_BODY()

public:
	UDiscordRichPresenceSettings();

	virtual FName GetCategoryName() const override { return TEXT("Plugins"); }

	/** Auteur du plugin. Champ informatif, non modifiable. */
	UPROPERTY(VisibleAnywhere, Transient, Category = "About", meta = (DisplayName = "Plugin"))
	FString About = TEXT("Discord Rich Presence - plugin made by Mathew Simon");

	/** Active la presence Discord. */
	UPROPERTY(config, EditAnywhere, Category = "General")
	bool bEnabled = true;

	/**
	 * Application ID (= Client ID) recupere sur https://discord.com/developers/applications
	 * Le nom de l'application est ce que Discord affichera comme nom du jeu.
	 */
	UPROPERTY(config, EditAnywhere, Category = "General")
	FString ClientId;

	/** Active aussi la presence quand on joue dans l'editeur (PIE). Pratique pour tester. */
	UPROPERTY(config, EditAnywhere, Category = "General")
	bool bEnableInEditor = true;

	/** Presence envoyee des le lancement du jeu. Modifiable ensuite en Blueprint / C++. */
	UPROPERTY(config, EditAnywhere, Category = "Presence")
	FDiscordRichPresenceActivity DefaultActivity;

	/**
	 * Delai minimum entre deux envois a Discord.
	 * Discord limite a 5 mises a jour par 20 s : ne pas descendre sous 4 s.
	 */
	UPROPERTY(config, EditAnywhere, Category = "Advanced", meta = (ClampMin = "4.0", UIMin = "4.0"))
	float MinUpdateIntervalSeconds = 4.0f;

	/** Delai entre deux tentatives de connexion quand Discord n'est pas lance. */
	UPROPERTY(config, EditAnywhere, Category = "Advanced", meta = (ClampMin = "1.0", UIMin = "1.0"))
	float ReconnectIntervalSeconds = 15.0f;
};
