diff --git a/Content/Blueprints/Player/GI.uasset b/Content/Blueprints/Player/GI.uasset index ce6c08b0..cd59f23e 100644 Binary files a/Content/Blueprints/Player/GI.uasset and b/Content/Blueprints/Player/GI.uasset differ diff --git a/Content/Blueprints/Player/MyPC.uasset b/Content/Blueprints/Player/MyPC.uasset index 7261ce87..5e766ab7 100644 Binary files a/Content/Blueprints/Player/MyPC.uasset and b/Content/Blueprints/Player/MyPC.uasset differ diff --git a/Content/Blueprints/Player/getFunctions.uasset b/Content/Blueprints/Player/getFunctions.uasset index eeb0f997..5516ae6b 100644 Binary files a/Content/Blueprints/Player/getFunctions.uasset and b/Content/Blueprints/Player/getFunctions.uasset differ diff --git a/Content/Blueprints/UI/WBPS/LoginPage.uasset b/Content/Blueprints/UI/WBPS/LoginPage.uasset new file mode 100644 index 00000000..bd169ffb Binary files /dev/null and b/Content/Blueprints/UI/WBPS/LoginPage.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/Anketa.uasset b/Content/Blueprints/UI/WBPS/Menu/Anketa.uasset index 7d8a6c62..8877a4da 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/Anketa.uasset and b/Content/Blueprints/UI/WBPS/Menu/Anketa.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/Favorites.uasset b/Content/Blueprints/UI/WBPS/Menu/Favorites.uasset new file mode 100644 index 00000000..c12f90b0 Binary files /dev/null and b/Content/Blueprints/UI/WBPS/Menu/Favorites.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/FlatInfo.uasset b/Content/Blueprints/UI/WBPS/Menu/FlatInfo.uasset index 6cd23bf0..3cb99ff6 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/FlatInfo.uasset and b/Content/Blueprints/UI/WBPS/Menu/FlatInfo.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset index c385be34..a2805e7a 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset and b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/MenuBtn.uasset b/Content/Blueprints/UI/WBPS/Menu/MenuBtn.uasset index 06a9652b..2d1784c0 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/MenuBtn.uasset and b/Content/Blueprints/UI/WBPS/Menu/MenuBtn.uasset differ diff --git a/Content/Blueprints/UI/WBPS/filter/Filter.uasset b/Content/Blueprints/UI/WBPS/filter/Filter.uasset index 4134574d..fe58b89c 100644 Binary files a/Content/Blueprints/UI/WBPS/filter/Filter.uasset and b/Content/Blueprints/UI/WBPS/filter/Filter.uasset differ diff --git a/Content/Blueprints/UI/WBPS/filter/FlatCard.uasset b/Content/Blueprints/UI/WBPS/filter/FlatCard.uasset index 62fb717b..21b609a1 100644 Binary files a/Content/Blueprints/UI/WBPS/filter/FlatCard.uasset and b/Content/Blueprints/UI/WBPS/filter/FlatCard.uasset differ diff --git a/Content/TMP/Custom_Size-5_–_1.uasset b/Content/TMP/Custom_Size-5_–_1.uasset new file mode 100644 index 00000000..70f759d0 Binary files /dev/null and b/Content/TMP/Custom_Size-5_–_1.uasset differ diff --git a/Content/TMP/Custom_Size-5_–_3.uasset b/Content/TMP/Custom_Size-5_–_3.uasset new file mode 100644 index 00000000..212457cf Binary files /dev/null and b/Content/TMP/Custom_Size-5_–_3.uasset differ diff --git a/Content/TMP/Custom_Size-5_–_4.uasset b/Content/TMP/Custom_Size-5_–_4.uasset new file mode 100644 index 00000000..908c5cee Binary files /dev/null and b/Content/TMP/Custom_Size-5_–_4.uasset differ diff --git a/Content/TMP/bkg_anketa.uasset b/Content/TMP/bkg_anketa.uasset new file mode 100644 index 00000000..e1325d38 Binary files /dev/null and b/Content/TMP/bkg_anketa.uasset differ diff --git a/Content/TMP/bkg_anketa__2_.uasset b/Content/TMP/bkg_anketa__2_.uasset new file mode 100644 index 00000000..e8325326 Binary files /dev/null and b/Content/TMP/bkg_anketa__2_.uasset differ diff --git a/Content/TMP/btn_save.uasset b/Content/TMP/btn_save.uasset new file mode 100644 index 00000000..fb581247 Binary files /dev/null and b/Content/TMP/btn_save.uasset differ diff --git a/Content/TMP/icon_broni_active.uasset b/Content/TMP/icon_broni_active.uasset new file mode 100644 index 00000000..4571d3ac Binary files /dev/null and b/Content/TMP/icon_broni_active.uasset differ diff --git a/Content/TMP/icon_broni_normal.uasset b/Content/TMP/icon_broni_normal.uasset new file mode 100644 index 00000000..37b7526a Binary files /dev/null and b/Content/TMP/icon_broni_normal.uasset differ diff --git a/Content/TMP/icon_like_active.uasset b/Content/TMP/icon_like_active.uasset new file mode 100644 index 00000000..94e8361f Binary files /dev/null and b/Content/TMP/icon_like_active.uasset differ diff --git a/Content/TMP/icon_like_normal.uasset b/Content/TMP/icon_like_normal.uasset new file mode 100644 index 00000000..ea655a26 Binary files /dev/null and b/Content/TMP/icon_like_normal.uasset differ diff --git a/Content/TMP/like.uasset b/Content/TMP/like.uasset new file mode 100644 index 00000000..3b32f48f Binary files /dev/null and b/Content/TMP/like.uasset differ diff --git a/Content/TMP/window_info_user__2_.uasset b/Content/TMP/window_info_user__2_.uasset new file mode 100644 index 00000000..be56793e Binary files /dev/null and b/Content/TMP/window_info_user__2_.uasset differ diff --git a/Source/Onejsky4U/Onejsky4U.Build.cs b/Source/Onejsky4U/Onejsky4U.Build.cs index c44573d0..bc5fa5fe 100644 --- a/Source/Onejsky4U/Onejsky4U.Build.cs +++ b/Source/Onejsky4U/Onejsky4U.Build.cs @@ -12,12 +12,16 @@ public class Onejsky4U : ModuleRules PrivateDependencyModuleNames.AddRange(new string[] { }); - // Uncomment if you are using Slate UI - // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - - // Uncomment if you are using online features - // PrivateDependencyModuleNames.Add("OnlineSubsystem"); + // Uncomment if you are using Slate UI + // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true - } + // Uncomment if you are using online features + // PrivateDependencyModuleNames.Add("OnlineSubsystem"); + + // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + // Add any import libraries or static libraries + //Type = ModuleType.External; + //PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "D:\Projects\Onejsky\libxl-3.9.4.3\lib64", "libxl.lib")); + PublicAdditionalLibraries.Add("D:\\Projects\\Onejsky\\libxl-3.9.4.3\\lib64\\libxl.lib"); + } } diff --git a/Source/Onejsky4U/Onejsky4UGameModeBase.cpp b/Source/Onejsky4U/Onejsky4UGameModeBase.cpp index f6d6f464..7ab53ef9 100644 --- a/Source/Onejsky4U/Onejsky4UGameModeBase.cpp +++ b/Source/Onejsky4U/Onejsky4UGameModeBase.cpp @@ -1,7 +1,9 @@ // Copyright Epic Games, Inc. All Rights Reserved. - #include "Onejsky4UGameModeBase.h" +//#define WIN32_LEAN_AND_MEAN +//#include +//#include "..\..\Libraries\libxl-3.9.4.3\include_cpp\libxl.h" void AOnejsky4UGameModeBase::CreateTxt(FString Path, FString FileName, FString text) @@ -13,3 +15,124 @@ void AOnejsky4UGameModeBase::CreateTxt(FString Path, FString FileName, FString t FFileHelper::SaveStringToFile(text, *fullpath, FFileHelper::EEncodingOptions::ForceUTF8); } + +bool AOnejsky4UGameModeBase::AppendStringToFile(FString DirPath, FString FileName, FString Data) +{ + // get file path + FString FilePath; + if (!DirPath.Len()) + { + // default documents directory path + FileName + FilePath = FPlatformProcess::UserDir() + FileName; + } + else + { + FilePath = DirPath + FileName; + } + UE_LOG(LogTemp, Log, TEXT("File path: %s"), *FilePath); + + // check file existence and write data to a file + FString OldData; + bool append_result; + if (FPaths::FileExists(FilePath)) + { + UE_LOG(LogTemp, Log, TEXT("File exists: true")); + FFileHelper::LoadFileToString(OldData, *FilePath); + OldData += Data; + append_result = FFileHelper::SaveStringToFile(Data, *FilePath, FFileHelper::EEncodingOptions::ForceUTF8, &IFileManager::Get(), FILEWRITE_Append); + } + else + { + UE_LOG(LogTemp, Warning, TEXT("File exists: false")); + append_result = FFileHelper::SaveStringToFile(Data, *FilePath, FFileHelper::EEncodingOptions::ForceUTF8); + } + + // return append result + if (append_result) + { + UE_LOG(LogTemp, Log, TEXT("Append: complete")); + return true; + } + else + { + UE_LOG(LogTemp, Error, TEXT("Append: not complete")); + return false; + } +} + +void AOnejsky4UGameModeBase::RunSystemCommand(FString Command) +{ + system(TCHAR_TO_ANSI(*Command)); +} + +void AOnejsky4UGameModeBase::GetExcelData(FString Command) +{ + /*using namespace libxl; + Book* book = xlCreateXMLBook(); + if (!book) + return; + Font* boldFont = book->addFont(); + boldFont->setBold(); + + Font* titleFont = book->addFont(); + titleFont->setName(L"Arial Black"); + titleFont->setSize(16); + + Format* titleFormat = book->addFormat(); + titleFormat->setFont(titleFont); + + Format* headerFormat = book->addFormat(); + headerFormat->setAlignH(ALIGNH_CENTER); + headerFormat->setBorder(BORDERSTYLE_THIN); + headerFormat->setFont(boldFont); + headerFormat->setFillPattern(FILLPATTERN_SOLID); + headerFormat->setPatternForegroundColor(libxl::Color::COLOR_YELLOW); + + Format* descriptionFormat = book->addFormat(); + descriptionFormat->setBorderLeft(BORDERSTYLE_THIN); + + Format* amountFormat = book->addFormat(); + amountFormat->setNumFormat(NUMFORMAT_CURRENCY_NEGBRA); + amountFormat->setBorderLeft(BORDERSTYLE_THIN); + amountFormat->setBorderRight(BORDERSTYLE_THIN); + + Format* totalLabelFormat = book->addFormat(); + totalLabelFormat->setBorderTop(BORDERSTYLE_THIN); + totalLabelFormat->setAlignH(ALIGNH_RIGHT); + totalLabelFormat->setFont(boldFont); + + Format* totalFormat = book->addFormat(); + totalFormat->setNumFormat(NUMFORMAT_CURRENCY_NEGBRA); + totalFormat->setBorder(BORDERSTYLE_THIN); + totalFormat->setFont(boldFont); + totalFormat->setFillPattern(FILLPATTERN_SOLID); + totalFormat->setPatternForegroundColor(libxl::Color::COLOR_YELLOW); + + Format* signatureFormat = book->addFormat(); + signatureFormat->setAlignH(ALIGNH_CENTER); + signatureFormat->setBorderTop(BORDERSTYLE_THIN); + + Sheet* sheet = book->addSheet(L"Invoice"); + if (!sheet) + return; + + sheet->writeStr(1, 1, L"ïîëíîå_èìÿ", headerFormat); + + //sheet->writeStr(1, 2, L"òåëåôîí", headerFormat); + //sheet->writeStr(1, 3, L"ïî÷òà", headerFormat); + //sheet->writeStr(1, 4, L"âðåìÿ_ñåàíñà", headerFormat); + //sheet->writeStr(1, 5, L"çàðåçåðâèðîâàííûå", headerFormat); + //sheet->writeStr(1, 6, L"èçáðàííûå", headerFormat); + //sheet->writeStr(1, 7, L"ïðîñìîòðåííûå", headerFormat); + + sheet->setCol(1, 1, 35.0f); + sheet->setCol(1, 2, 35.0f); + sheet->setCol(1, 3, 35.0f); + sheet->setCol(1, 4, 35.0f); + sheet->setCol(1, 5, 35.0f); + sheet->setCol(1, 6, 35.0f); + sheet->setCol(1, 7, 35.0f); + + if (book->save(L"invoice.xlsx")) + book->release();*/ +} \ No newline at end of file diff --git a/Source/Onejsky4U/Onejsky4UGameModeBase.h b/Source/Onejsky4U/Onejsky4UGameModeBase.h index dbfe2e14..df0fded8 100644 --- a/Source/Onejsky4U/Onejsky4UGameModeBase.h +++ b/Source/Onejsky4U/Onejsky4UGameModeBase.h @@ -22,6 +22,15 @@ class ONEJSKY4U_API AOnejsky4UGameModeBase : public AGameModeBase public: UFUNCTION(BlueprintCallable, Category = "TextMaker") - static void CreateTxt(FString Path, FString FileName, FString text); + static void CreateTxt(FString Path, FString FileName, FString text); + + UFUNCTION(BlueprintCallable, Category = "File") + static bool AppendStringToFile(FString DirPath, FString FileName, FString Data); + + UFUNCTION(BlueprintCallable, Category = "System") + static void RunSystemCommand(FString Command); + + UFUNCTION(BlueprintCallable, Category = "System") + static void GetExcelData(FString Command); }; \ No newline at end of file