From b55fcbb9a6048ab3db8f0c26ab55c3ef3c1a1963 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 19 Jun 2022 00:25:25 +0700 Subject: [PATCH] Adapt to AcediaCore's `Text` changes --- sources/Commands/ACommandDB.uc | 6 +++--- sources/Commands/ACommandFeature.uc | 10 +++++----- sources/Commands/ACommandInventory.uc | 6 +++--- sources/Commands/ACommandNick.uc | 10 +++++----- sources/Features/FutileChat/FutilityChat.uc | 2 +- .../FutileChat/FutilityChat_Feature.uc | 4 ++-- .../FutileNickames/FutilityNicknames.uc | 4 ++-- .../FutilityNicknames_Feature.uc | 12 ++++++------ sources/Tools/InventoryTool.uc | 19 +++++++++++-------- sources/Tools/ReportTool.uc | 12 ++++++------ 10 files changed, 44 insertions(+), 41 deletions(-) diff --git a/sources/Commands/ACommandDB.uc b/sources/Commands/ACommandDB.uc index 80c7ae7..ff1bb25 100644 --- a/sources/Commands/ACommandDB.uc +++ b/sources/Commands/ACommandDB.uc @@ -224,7 +224,7 @@ protected function Executed(CallData result, EPlayer callerPlayer) // Simple API calls private function bool TryAPICallCommands( - Text subCommand, + BaseText subCommand, EPlayer callerPlayer, AssociativeArray commandParameters) { @@ -254,7 +254,7 @@ private function bool TryAPICallCommands( } // json pointer as `Text` -> `DBPointerPair` representation converter method -private function DBPointerPair TryLoadingDB(Text databaseLink) +private function DBPointerPair TryLoadingDB(BaseText databaseLink) { local DBPointerPair result; if (databaseLink == none) { @@ -354,7 +354,7 @@ protected function DisplayData( OutputStatus(callerPlayer, result); if (callerPlayer != none && result == DBR_Success) { - printedJSON = _.json.PrettyPrint(data); + printedJSON = _.json.PrettyPrint(data).IntoText(); callerConsole.Write(printedJSON).Flush(); _.memory.Free(printedJSON); _.memory.Free(callerPlayer); diff --git a/sources/Commands/ACommandFeature.uc b/sources/Commands/ACommandFeature.uc index 94dc1a9..fcd240e 100644 --- a/sources/Commands/ACommandFeature.uc +++ b/sources/Commands/ACommandFeature.uc @@ -54,9 +54,9 @@ protected function Executed(CallData result, EPlayer callerPlayer) } protected function TryEnableFeature( - EPlayer callerPlayer, - Text featureName, - Text chosenConfig) + EPlayer callerPlayer, + BaseText featureName, + BaseText chosenConfig) { local Text oldConfig, newConfig; local class featureClass; @@ -115,7 +115,7 @@ protected function EnableFeature( EPlayer callerPlayer, class featureClass, class configClass, - Text chosenConfig, + BaseText chosenConfig, bool autoConfig) { local bool wasEnabled; @@ -196,7 +196,7 @@ protected function DisableFeature(EPlayer callerPlayer, Text featureName) _.memory.Free(playerName); } -protected function class LoadFeatureClass(Text featureName) +protected function class LoadFeatureClass(BaseText featureName) { local Text featureClassName; local class featureClass; diff --git a/sources/Commands/ACommandInventory.uc b/sources/Commands/ACommandInventory.uc index b1fa1ca..abec758 100644 --- a/sources/Commands/ACommandInventory.uc +++ b/sources/Commands/ACommandInventory.uc @@ -241,9 +241,9 @@ protected function array LoadAllItemsLists(DynamicArray specifiedLists) } protected function array LoadItemsList( - Text listName, - array availableLists, - ReportTool badLists) + BaseText listName, + array availableLists, + ReportTool badLists) { local int i; local array emptyArray; diff --git a/sources/Commands/ACommandNick.uc b/sources/Commands/ACommandNick.uc index 5afbd52..5a308bf 100644 --- a/sources/Commands/ACommandNick.uc +++ b/sources/Commands/ACommandNick.uc @@ -82,7 +82,7 @@ protected function ExecutedFor( protected function bool TryChangeDefaultColor( MutableText newName, - Text specifiedColor) + BaseText specifiedColor) { local Color defaultColor; if (newName == none) return false; @@ -101,10 +101,10 @@ protected function bool TryChangeDefaultColor( } protected function AnnounceNicknameChange( - Text callerName, - Text oldName, - Text newName, - bool selfChange) + BaseText callerName, + BaseText oldName, + BaseText newName, + bool selfChange) { if (selfChange) { diff --git a/sources/Features/FutileChat/FutilityChat.uc b/sources/Features/FutileChat/FutilityChat.uc index fb0a0c6..82a0a6d 100644 --- a/sources/Features/FutileChat/FutilityChat.uc +++ b/sources/Features/FutileChat/FutilityChat.uc @@ -56,7 +56,7 @@ protected function FromData(AssociativeArray source) } private function ChatColorSetting ColorSettingFromText( - Text permissions) + BaseText permissions) { if (permissions == none) { return CCS_DoNothing; diff --git a/sources/Features/FutileChat/FutilityChat_Feature.uc b/sources/Features/FutileChat/FutilityChat_Feature.uc index 08ea3b5..f4a7b3f 100644 --- a/sources/Features/FutileChat/FutilityChat_Feature.uc +++ b/sources/Features/FutileChat/FutilityChat_Feature.uc @@ -93,8 +93,8 @@ private function bool ReformatChatMessage( MutableText message, bool teamMessage) { - local Text messageCopy; - local Text.Formatting defaultFormatting; + local Text messageCopy; + local BaseText.Formatting defaultFormatting; if (sender == none) return true; if (message == none) return true; if (colorSetting == CCS_DoNothing) return true; diff --git a/sources/Features/FutileNickames/FutilityNicknames.uc b/sources/Features/FutileNickames/FutilityNicknames.uc index 119040d..5bf844c 100644 --- a/sources/Features/FutileNickames/FutilityNicknames.uc +++ b/sources/Features/FutileNickames/FutilityNicknames.uc @@ -108,7 +108,7 @@ protected function FromData(AssociativeArray source) } } -private function NicknameSpacesAction SpaceActionFromText(Text action) +private function NicknameSpacesAction SpaceActionFromText(BaseText action) { if (action == none) { return NSA_DoNothing; @@ -126,7 +126,7 @@ private function NicknameSpacesAction SpaceActionFromText(Text action) } private function NicknameColorPermissions ColorPermissionsFromText( - Text permissions) + BaseText permissions) { if (permissions == none) { return NCP_ForbidColor; diff --git a/sources/Features/FutileNickames/FutilityNicknames_Feature.uc b/sources/Features/FutileNickames/FutilityNicknames_Feature.uc index 8839076..93bed10 100644 --- a/sources/Features/FutileNickames/FutilityNicknames_Feature.uc +++ b/sources/Features/FutileNickames/FutilityNicknames_Feature.uc @@ -253,7 +253,7 @@ private function bool IsAnyCensoringEnabled() // For nickname changes mid-game. private function HandleNicknameChange( EPlayer affectedPlayer, - Text oldName, + BaseText oldName, MutableText newName) { CensorNickname(newName, affectedPlayer); @@ -297,8 +297,8 @@ private function CensorCurrentPlayersNicknames() private function CensorNickname(MutableText nickname, EPlayer affectedPlayer) { - local Text fallback; - local Text.Formatting newFormatting; + local Text fallback; + local BaseText.Formatting newFormatting; if (nickname == none) return; if (affectedPlayer == none) return; @@ -343,9 +343,9 @@ private function CensorNickname(MutableText nickname, EPlayer affectedPlayer) // Asusmes `nickname != none`. private function ReplaceSpaces(MutableText nickname) { - local int i; - local MutableText nicknameCopy; - local Text.Character nextCharacter, underscoreCharacter; + local int i; + local MutableText nicknameCopy; + local BaseText.Character nextCharacter, underscoreCharacter; nicknameCopy = nickname.MutableCopy(); nickname.Clear(); underscoreCharacter = diff --git a/sources/Tools/InventoryTool.uc b/sources/Tools/InventoryTool.uc index 947137b..baaa58b 100644 --- a/sources/Tools/InventoryTool.uc +++ b/sources/Tools/InventoryTool.uc @@ -157,8 +157,8 @@ public final function Reset() // In case `resolvedWhat == intoWhat` just returns copy of // original `resolvedWhat` private function MutableText MakeResolvedIntoLine( - Text resolvedWhat, - Text intoWhat) + BaseText resolvedWhat, + BaseText intoWhat) { if (resolvedWhat == none) { return none; @@ -201,7 +201,10 @@ private function TryFillAmmo(EItem item) * @param doFillAmmo Set to `true` if we must also fill ammo reserves * of weapons we have added to the full. */ -public function AddItem(Text userProvidedName, bool doForce, bool doFillAmmo) +public function AddItem( + BaseText userProvidedName, + bool doForce, + bool doFillAmmo) { local EItem addedItem; local MutableText resolvedLine; @@ -268,10 +271,10 @@ public function AddItem(Text userProvidedName, bool doForce, bool doFillAmmo) * template and `false` to only remove one. */ public function RemoveItem( - Text userProvidedName, - bool doKeep, - bool doForce, - bool doRemoveAll) + BaseText userProvidedName, + bool doKeep, + bool doForce, + bool doRemoveAll) { local bool itemWasMissing; local Text realItemName, itemTemplate; @@ -332,7 +335,7 @@ public function RemoveItem( private function DetectAndReportRemovedItems( out array itemsAfterRemoval, array itemsBeforeRemoval, - array itemNames, + array itemNames, bool doForce) { local int i, j; diff --git a/sources/Tools/ReportTool.uc b/sources/Tools/ReportTool.uc index d12d6b5..0e115fb 100644 --- a/sources/Tools/ReportTool.uc +++ b/sources/Tools/ReportTool.uc @@ -80,7 +80,7 @@ protected function Finalizer() * the caller `ReportTool`. * Method does nothing (initialization fails) iff `template == none`. */ -public final function Initialize(Text template) +public final function Initialize(BaseText template) { if (template == none) { return; @@ -98,7 +98,7 @@ public final function Initialize(Text template) * to the previously added item). * @return Reference to the caller `ReportTool` to allow for method chaining. */ -public final function ReportTool Item(Text item) +public final function ReportTool Item(BaseText item) { local ReportItem newItem; if (headerTemplate == none) return self; @@ -119,7 +119,7 @@ public final function ReportTool Item(Text item) * Does nothing if `detail == none` or no items were added thuis far. * @return Reference to the caller `ReportTool` to allow for method chaining. */ -public final function ReportTool Detail(Text detail) +public final function ReportTool Detail(BaseText detail) { local array detailToReport; if (headerTemplate == none) return self; @@ -146,9 +146,9 @@ public final function ReportTool Detail(Text detail) * @return Reference to the caller `ReportTool` to allow for method chaining. */ public final function ReportTool Report( - ConsoleWriter writer, - optional Text cause, - optional Text target) + ConsoleWriter writer, + optional BaseText cause, + optional BaseText target) { local int i, j; local MutableText intro;