починил редактирование интеграций
This commit is contained in:
@@ -35,11 +35,11 @@ type
|
||||
|
||||
procedure UpdateGridFromArray;
|
||||
procedure AddChat(newRecord: TOBSChat);
|
||||
procedure EdtChat(newRecord: TOBSChat);
|
||||
procedure EdtChat(newRecord: TOBSChat; oldPort: Integer);
|
||||
procedure DelChat(aPort: Integer);
|
||||
|
||||
procedure AddNotify(newRecord: TOBSNotify);
|
||||
procedure EdtNotify(newRecord: TOBSNotify);
|
||||
procedure EdtNotify(newRecord: TOBSNotify; oldPort: Integer);
|
||||
procedure DelNotify(aPort: Integer);
|
||||
|
||||
procedure AddKandinsky(newRecord: TOBSKandinsky);
|
||||
@@ -175,7 +175,7 @@ begin
|
||||
if listKandinsky[i].port = aPort then
|
||||
begin
|
||||
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
||||
for j := i to High(listKandinsky) - 1 do
|
||||
for j := i to High(listKandinsky) do
|
||||
listKandinsky[j] := listKandinsky[j + 1];
|
||||
// Óìåíüøàåì ðàçìåð ìàññèâà
|
||||
SetLength(listKandinsky, Length(listKandinsky) - 1);
|
||||
@@ -197,7 +197,7 @@ begin
|
||||
if listNotify[i].port = aPort then
|
||||
begin
|
||||
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
||||
for j := i to High(listNotify) - 1 do
|
||||
for j := i to High(listNotify) do
|
||||
listNotify[j] := listNotify[j + 1];
|
||||
// Óìåíüøàåì ðàçìåð ìàññèâà
|
||||
SetLength(listNotify, Length(listNotify) - 1);
|
||||
@@ -210,85 +210,64 @@ begin
|
||||
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
|
||||
end;
|
||||
|
||||
procedure TfrOBS.EdtChat(newRecord: TOBSChat);
|
||||
procedure TfrOBS.EdtChat(newRecord: TOBSChat; oldPort: Integer);
|
||||
var
|
||||
rChat: TOBSChat;
|
||||
SavedColor: TAlphaColor;
|
||||
i: Integer;
|
||||
begin
|
||||
rChat:= newRecord;
|
||||
|
||||
if TryStrToUInt('$' + rChat.ColorBlock, Cardinal(SavedColor)) then
|
||||
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := SavedColor
|
||||
else
|
||||
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := TAlphaColorRec.Black;
|
||||
fCreateChat.frChatSettings1.ccbStyleBorderColor.ItemIndex :=
|
||||
rChat.ColorBorder;
|
||||
fCreateChat.frChatSettings1.ccbBColor.ItemIndex := rChat.ColorBackground;
|
||||
fCreateChat.frChatSettings1.sbStyleBlockBorderSize.Value := rChat.SolidBorder;
|
||||
fCreateChat.frChatSettings1.sbStyleBlockPadding.Value := rChat.Paddings;
|
||||
|
||||
fCreateChat.frFontSettings1.ccbFontColor.ItemIndex := rChat.ColorFont;
|
||||
fCreateChat.frFontSettings1.sbFontSize.Value := rChat.SizeFont;
|
||||
fCreateChat.frFontSettings1.cbFontStyleDefault.ItemIndex := rChat.StyleFont;
|
||||
|
||||
fCreateChat.sbTimeMsg.Value := rChat.TimeMess;
|
||||
fCreateChat.sbMaxMsg.Value := rChat.MaxCountMess;
|
||||
fCreateChat.sbWebServerPort.Value := rChat.port;
|
||||
fCreateChat.Show;
|
||||
for i := 0 to High(listChats) do
|
||||
if listChats[i].port = oldPort then
|
||||
begin
|
||||
listChats[i] := newRecord;
|
||||
UpdateGridFromArray;
|
||||
db.SaveRecordArray<TOBSChat>('listChats', listChats);
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrOBS.EdtNotify(newRecord: TOBSNotify);
|
||||
procedure TfrOBS.EdtNotify(newRecord: TOBSNotify; oldPort: Integer);
|
||||
var
|
||||
OBSNotify: TOBSNotify;
|
||||
SavedColor: TAlphaColor;
|
||||
i: Integer;
|
||||
begin
|
||||
OBSNotify:=newRecord;
|
||||
with OBSNotify do
|
||||
for i := 0 to High(listNotify) do
|
||||
if listNotify[i].port = oldPort then
|
||||
begin
|
||||
fCreateNotify.edtESImage.Text := Picture;
|
||||
fCreateNotify.edtESSound.Text := Sound;
|
||||
|
||||
if TryStrToUInt('$' + ColorBlock, Cardinal(SavedColor)) then
|
||||
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color := SavedColor
|
||||
else
|
||||
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color :=
|
||||
TAlphaColorRec.Black;
|
||||
|
||||
// fCreateNotify. ColorBlock:= GetColorFromColorPanel(frColorSettings1.cpStyleBlockColor.Color);
|
||||
fCreateNotify.frColorSettings1.sbStyleBlockBorderSize.Value := SolidBorder;
|
||||
fCreateNotify.frColorSettings1.sbStyleBlockPadding.Value := Paddings;
|
||||
fCreateNotify.frColorSettings1.ccbStyleBorderColor.ItemIndex := ColorBorder;
|
||||
fCreateNotify.frColorSettings1.ccbBColor.ItemIndex := ColorBackground;
|
||||
|
||||
fCreateNotify.edtESTitle.Text := HeaderText;
|
||||
fCreateNotify.frFontSettings2.ccbFontColor.ItemIndex := HeaderColorFont;
|
||||
fCreateNotify.frFontSettings2.sbFontSize.Value := HeaderSizeFont;
|
||||
fCreateNotify.frFontSettings2.cbFontStyleDefault.ItemIndex :=
|
||||
HeaderStyleFont;
|
||||
|
||||
fCreateNotify.edtESMessage.Text := MessText;
|
||||
fCreateNotify.frFontSettings3.ccbFontColor.ItemIndex := MessColorFont;
|
||||
fCreateNotify.frFontSettings3.sbFontSize.Value := MessSizeFont;
|
||||
fCreateNotify.frFontSettings3.cbFontStyleDefault.ItemIndex := MessStyleFont;
|
||||
|
||||
fCreateNotify.sbTimeMsg.Value := TimeMess;
|
||||
fCreateNotify.cbEventsType.ItemIndex := TypeEvent;
|
||||
fCreateNotify.edtIF.Text := TypeEdit;
|
||||
fCreateNotify.sbWebServerPort.Value := port;
|
||||
listNotify[i] := newRecord;
|
||||
UpdateGridFromArray;
|
||||
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrOBS.sgWebChatsCellDblClick(const Column: TColumn;
|
||||
const Row: Integer);
|
||||
var
|
||||
myChatRec: TOBSChat;
|
||||
myNotifyRec: TOBSNotify;
|
||||
i: Integer;
|
||||
begin
|
||||
if sgWebChats.Cells[1,row] = 'Îïîâåùåíèå' then
|
||||
if sgWebChats.Cells[1, Row] = 'Îïîâåùåíèå' then
|
||||
begin
|
||||
for i := 0 to High(listNotify) do
|
||||
if listNotify[i].port = (strtoint(sgWebChats.Cells[0, Row])) then
|
||||
begin
|
||||
myNotifyRec := listNotify[i];
|
||||
Break;
|
||||
end;
|
||||
|
||||
fCreateNotify.isEdit := true;
|
||||
fCreateNotify.setRecord(myNotifyRec);
|
||||
fCreateNotify.Show;
|
||||
end;
|
||||
if sgWebChats.Cells[1,row] = '×àò' then
|
||||
if sgWebChats.Cells[1, Row] = '×àò' then
|
||||
begin
|
||||
for i := 0 to High(listChats) do
|
||||
if listChats[i].port = (strtoint(sgWebChats.Cells[0, Row])) then
|
||||
begin
|
||||
myChatRec := listChats[i];
|
||||
Break;
|
||||
end;
|
||||
fCreateChat.isEdit := true;
|
||||
fCreateChat.setRecord(myChatRec);
|
||||
fCreateChat.Show;
|
||||
end;
|
||||
end;
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ object fCreateChat: TfCreateChat
|
||||
Size.Width = 112.000000000000000000
|
||||
Size.Height = 19.000000000000000000
|
||||
Size.PlatformDefault = False
|
||||
TabOrder = 38
|
||||
TabOrder = 37
|
||||
Text = #1042#1077#1095#1085#1086
|
||||
end
|
||||
object sbWebServerPort: TSpinBox
|
||||
|
||||
+32
-5
@@ -35,6 +35,8 @@ type
|
||||
public
|
||||
{ Public declarations }
|
||||
isEdit: boolean;
|
||||
oldPort: integer;
|
||||
procedure setRecord(aRec: TOBSChat);
|
||||
end;
|
||||
|
||||
var
|
||||
@@ -66,6 +68,28 @@ begin
|
||||
result := Format('rgba(%d, %d, %d, %.2f)', [r, G, B, A], FS);
|
||||
end;
|
||||
|
||||
procedure TfCreateChat.setRecord(aRec: TOBSChat);
|
||||
var
|
||||
SavedColor: TAlphaColor;
|
||||
begin
|
||||
if TryStrToUInt('$' + aRec.ColorBlock, Cardinal(SavedColor)) then
|
||||
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := SavedColor
|
||||
else
|
||||
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := TAlphaColorRec.Black;
|
||||
fCreateChat.frChatSettings1.ccbStyleBorderColor.ItemIndex := aRec.ColorBorder;
|
||||
fCreateChat.frChatSettings1.ccbBColor.ItemIndex := aRec.ColorBackground;
|
||||
fCreateChat.frChatSettings1.sbStyleBlockBorderSize.Value := aRec.SolidBorder;
|
||||
fCreateChat.frChatSettings1.sbStyleBlockPadding.Value := aRec.Paddings;
|
||||
|
||||
fCreateChat.frFontSettings1.ccbFontColor.ItemIndex := aRec.ColorFont;
|
||||
fCreateChat.frFontSettings1.sbFontSize.Value := aRec.SizeFont;
|
||||
fCreateChat.frFontSettings1.cbFontStyleDefault.ItemIndex := aRec.StyleFont;
|
||||
|
||||
fCreateChat.sbTimeMsg.Value := aRec.TimeMess;
|
||||
fCreateChat.sbMaxMsg.Value := aRec.MaxCountMess;
|
||||
fCreateChat.sbWebServerPort.Value := aRec.port;
|
||||
end;
|
||||
|
||||
procedure TfCreateChat.btnCreateWebChatClick(Sender: TObject);
|
||||
var
|
||||
OBSChat: TOBSChat;
|
||||
@@ -83,8 +107,11 @@ begin
|
||||
|
||||
OBSChat.MaxCountMess := round(sbMaxMsg.Value);
|
||||
OBSChat.TimeMess := round(sbTimeMsg.Value);
|
||||
OBSChat.Port := round(sbWebServerPort.Value);
|
||||
OBSChat.port := round(sbWebServerPort.Value);
|
||||
|
||||
if isEdit then
|
||||
TTW_Bot.frOBS1.EdtChat(OBSChat, oldPort)
|
||||
else
|
||||
TTW_Bot.frOBS1.AddChat(OBSChat);
|
||||
close;
|
||||
end;
|
||||
@@ -93,7 +120,7 @@ procedure TfCreateChat.FormCreate(Sender: TObject);
|
||||
procedure LoadFontList;
|
||||
var
|
||||
SearchRec: TSearchRec;
|
||||
n: Integer;
|
||||
n: integer;
|
||||
begin
|
||||
if not DirectoryExists(myConst.fontsPath) then
|
||||
CreateDir(myConst.fontsPath);
|
||||
@@ -117,7 +144,7 @@ procedure TfCreateChat.FormCreate(Sender: TObject);
|
||||
|
||||
procedure LoadChatOBSSettings;
|
||||
var
|
||||
I: Integer;
|
||||
I: integer;
|
||||
c: TComponent;
|
||||
ColorStr: string;
|
||||
SavedColor: TAlphaColor;
|
||||
@@ -155,9 +182,9 @@ end;
|
||||
procedure TfCreateChat.FormShow(Sender: TObject);
|
||||
begin
|
||||
if isEdit then
|
||||
btnCreateWebChat.Text:='Èçìåíèòü ÷àò'
|
||||
btnCreateWebChat.text := 'Èçìåíèòü ÷àò'
|
||||
else
|
||||
btnCreateWebChat.Text:='Ñîçäàòü ÷àò';
|
||||
btnCreateWebChat.text := 'Ñîçäàòü ÷àò';
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
+43
-3
@@ -44,6 +44,8 @@ type
|
||||
public
|
||||
{ Public declarations }
|
||||
isEdit: boolean;
|
||||
oldPort: integer;
|
||||
procedure setRecord(aRec: TOBSNotify);
|
||||
end;
|
||||
|
||||
var
|
||||
@@ -75,6 +77,44 @@ begin
|
||||
result := Format('rgba(%d, %d, %d, %.2f)', [r, G, B, A], FS);
|
||||
end;
|
||||
|
||||
procedure TfCreateNotify.setRecord(aRec: TOBSNotify);
|
||||
var
|
||||
SavedColor: TAlphaColor;
|
||||
begin
|
||||
with aRec do
|
||||
begin
|
||||
fCreateNotify.edtESImage.Text := Picture;
|
||||
fCreateNotify.edtESSound.Text := Sound;
|
||||
|
||||
if TryStrToUInt('$' + ColorBlock, Cardinal(SavedColor)) then
|
||||
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color := SavedColor
|
||||
else
|
||||
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color :=
|
||||
TAlphaColorRec.Black;
|
||||
|
||||
fCreateNotify.frColorSettings1.sbStyleBlockBorderSize.Value := SolidBorder;
|
||||
fCreateNotify.frColorSettings1.sbStyleBlockPadding.Value := Paddings;
|
||||
fCreateNotify.frColorSettings1.ccbStyleBorderColor.ItemIndex := ColorBorder;
|
||||
fCreateNotify.frColorSettings1.ccbBColor.ItemIndex := ColorBackground;
|
||||
|
||||
fCreateNotify.edtESTitle.Text := HeaderText;
|
||||
fCreateNotify.frFontSettings2.ccbFontColor.ItemIndex := HeaderColorFont;
|
||||
fCreateNotify.frFontSettings2.sbFontSize.Value := HeaderSizeFont;
|
||||
fCreateNotify.frFontSettings2.cbFontStyleDefault.ItemIndex :=
|
||||
HeaderStyleFont;
|
||||
|
||||
fCreateNotify.edtESMessage.Text := MessText;
|
||||
fCreateNotify.frFontSettings3.ccbFontColor.ItemIndex := MessColorFont;
|
||||
fCreateNotify.frFontSettings3.sbFontSize.Value := MessSizeFont;
|
||||
fCreateNotify.frFontSettings3.cbFontStyleDefault.ItemIndex := MessStyleFont;
|
||||
|
||||
fCreateNotify.sbTimeMsg.Value := TimeMess;
|
||||
fCreateNotify.cbEventsType.ItemIndex := TypeEvent;
|
||||
fCreateNotify.edtIF.Text := TypeEdit;
|
||||
fCreateNotify.sbWebServerPort.Value := port;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfCreateNotify.btnCreateEventClick(Sender: TObject);
|
||||
var
|
||||
OBSNotify: TOBSNotify;
|
||||
@@ -104,10 +144,10 @@ begin
|
||||
TimeMess := round(sbTimeMsg.Value);
|
||||
TypeEvent := cbEventsType.ItemIndex;
|
||||
TypeEdit := edtIF.Text;
|
||||
Port := round(sbWebServerPort.Value);
|
||||
port := round(sbWebServerPort.Value);
|
||||
end;
|
||||
if isEdit then
|
||||
TTW_Bot.frOBS1.EdtNotify(OBSNotify)
|
||||
TTW_Bot.frOBS1.EdtNotify(OBSNotify, oldPort)
|
||||
else
|
||||
TTW_Bot.frOBS1.AddNotify(OBSNotify);
|
||||
close;
|
||||
@@ -115,7 +155,7 @@ end;
|
||||
|
||||
procedure TfCreateNotify.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
i: integer;
|
||||
SavedColor: TAlphaColor;
|
||||
c: TComponent;
|
||||
ColorStr: string;
|
||||
|
||||
Reference in New Issue
Block a user