починил редактирование интеграций
This commit is contained in:
+37
-10
@@ -34,7 +34,9 @@ type
|
||||
function GetColorFromColorPanel(aColor: TAlphaColor): string;
|
||||
public
|
||||
{ Public declarations }
|
||||
isEdit:boolean;
|
||||
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,9 +107,12 @@ begin
|
||||
|
||||
OBSChat.MaxCountMess := round(sbMaxMsg.Value);
|
||||
OBSChat.TimeMess := round(sbTimeMsg.Value);
|
||||
OBSChat.Port := round(sbWebServerPort.Value);
|
||||
OBSChat.port := round(sbWebServerPort.Value);
|
||||
|
||||
TTW_Bot.frOBS1.AddChat(OBSChat);
|
||||
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;
|
||||
@@ -146,7 +173,7 @@ procedure TfCreateChat.FormCreate(Sender: TObject);
|
||||
end;
|
||||
|
||||
begin
|
||||
isEdit:=false;
|
||||
isEdit := false;
|
||||
LoadChatOBSSettings;
|
||||
LoadFontList;
|
||||
|
||||
@@ -154,10 +181,10 @@ end;
|
||||
|
||||
procedure TfCreateChat.FormShow(Sender: TObject);
|
||||
begin
|
||||
if isEdit then
|
||||
btnCreateWebChat.Text:='Èçìåíèòü ÷àò'
|
||||
else
|
||||
btnCreateWebChat.Text:='Ñîçäàòü ÷àò';
|
||||
if isEdit then
|
||||
btnCreateWebChat.text := 'Èçìåíèòü ÷àò'
|
||||
else
|
||||
btnCreateWebChat.text := 'Ñîçäàòü ÷àò';
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user