unit fRevards;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 
  FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
  System.Rtti, FMX.Grid.Style, FMX.Grid, FMX.ScrollBox, uRecords, System.Generics.Collections,
  FMX.Controls.Presentation, FMX.EditBox, FMX.NumberBox, FMX.Edit, FMX.ComboEdit;

type
  TfrRevards = class(TFrame)
    Label1: TLabel;
    StringGrid1: TStringGrid;
    StringColumn1: TStringColumn;
    StringColumn2: TStringColumn;
    StringColumn3: TStringColumn;
    StringColumn4: TStringColumn;
    Label34: TLabel;
    ceCustomRevardTitle: TComboEdit;
    edtCustomRevardPrompt: TEdit;
    nbCustomRevardCost: TNumberBox;
    Label35: TLabel;
    Label2: TLabel;
    btnDelCustomRewards: TButton;
    btnAddCustomRewards: TButton;
  private
    { Private declarations }
  public
    { Public declarations }

    CustomRewards: TList<TCustomRevards>;
    listRevards:tarray<TReward>;
    procedure LoadCustomRevards;
    procedure UpdateGrid;
  end;

implementation

{$R *.fmx}

uses ugeneral;

procedure TfrRevards.LoadCustomRevards;
var
  cr: TCustomRevards;
begin
  CustomRewards.Clear;
  TTW_Bot.frEvents1.cbRevards.Items.Clear;
  ceCustomRevardTitle.items.Clear;
  TTW_Bot.toLog('fRevards', 'LoadCustomRevards', 'Запрос наград с сервера', 3);
  ttw_API.getCustomReward(CustomRewards);

  for cr in CustomRewards do
  begin
    TTW_Bot.frEvents1.cbRevards.Items.Add(cr.Title);
    ceCustomRevardTitle.Items.Add(cr.Title);
  end;
end;

procedure TfrRevards.UpdateGrid;
begin

end;

end.
