Browse Source

Adapt to AcediaCore's `Text` changes

feature_improvement
Anton Tarasenko 2 years ago
parent
commit
b55fcbb9a6
  1. 6
      sources/Commands/ACommandDB.uc
  2. 8
      sources/Commands/ACommandFeature.uc
  3. 4
      sources/Commands/ACommandInventory.uc
  4. 8
      sources/Commands/ACommandNick.uc
  5. 2
      sources/Features/FutileChat/FutilityChat.uc
  6. 2
      sources/Features/FutileChat/FutilityChat_Feature.uc
  7. 4
      sources/Features/FutileNickames/FutilityNicknames.uc
  8. 6
      sources/Features/FutileNickames/FutilityNicknames_Feature.uc
  9. 13
      sources/Tools/InventoryTool.uc
  10. 10
      sources/Tools/ReportTool.uc

6
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);

8
sources/Commands/ACommandFeature.uc

@ -55,8 +55,8 @@ protected function Executed(CallData result, EPlayer callerPlayer)
protected function TryEnableFeature(
EPlayer callerPlayer,
Text featureName,
Text chosenConfig)
BaseText featureName,
BaseText chosenConfig)
{
local Text oldConfig, newConfig;
local class<Feature> featureClass;
@ -115,7 +115,7 @@ protected function EnableFeature(
EPlayer callerPlayer,
class<Feature> featureClass,
class<FeatureConfig> 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<Feature> LoadFeatureClass(Text featureName)
protected function class<Feature> LoadFeatureClass(BaseText featureName)
{
local Text featureClassName;
local class<Feature> featureClass;

4
sources/Commands/ACommandInventory.uc

@ -241,8 +241,8 @@ protected function array<Text> LoadAllItemsLists(DynamicArray specifiedLists)
}
protected function array<Text> LoadItemsList(
Text listName,
array<Text> availableLists,
BaseText listName,
array<BaseText> availableLists,
ReportTool badLists)
{
local int i;

8
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,9 +101,9 @@ protected function bool TryChangeDefaultColor(
}
protected function AnnounceNicknameChange(
Text callerName,
Text oldName,
Text newName,
BaseText callerName,
BaseText oldName,
BaseText newName,
bool selfChange)
{
if (selfChange)

2
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;

2
sources/Features/FutileChat/FutilityChat_Feature.uc

@ -94,7 +94,7 @@ private function bool ReformatChatMessage(
bool teamMessage)
{
local Text messageCopy;
local Text.Formatting defaultFormatting;
local BaseText.Formatting defaultFormatting;
if (sender == none) return true;
if (message == none) return true;
if (colorSetting == CCS_DoNothing) return true;

4
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;

6
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);
@ -298,7 +298,7 @@ private function CensorCurrentPlayersNicknames()
private function CensorNickname(MutableText nickname, EPlayer affectedPlayer)
{
local Text fallback;
local Text.Formatting newFormatting;
local BaseText.Formatting newFormatting;
if (nickname == none) return;
if (affectedPlayer == none) return;
@ -345,7 +345,7 @@ private function ReplaceSpaces(MutableText nickname)
{
local int i;
local MutableText nicknameCopy;
local Text.Character nextCharacter, underscoreCharacter;
local BaseText.Character nextCharacter, underscoreCharacter;
nicknameCopy = nickname.MutableCopy();
nickname.Clear();
underscoreCharacter =

13
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,7 +271,7 @@ public function AddItem(Text userProvidedName, bool doForce, bool doFillAmmo)
* template and `false` to only remove one.
*/
public function RemoveItem(
Text userProvidedName,
BaseText userProvidedName,
bool doKeep,
bool doForce,
bool doRemoveAll)
@ -332,7 +335,7 @@ public function RemoveItem(
private function DetectAndReportRemovedItems(
out array<EItem> itemsAfterRemoval,
array<EItem> itemsBeforeRemoval,
array<Text> itemNames,
array<BaseText> itemNames,
bool doForce)
{
local int i, j;

10
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<Text> detailToReport;
if (headerTemplate == none) return self;
@ -147,8 +147,8 @@ public final function ReportTool Detail(Text detail)
*/
public final function ReportTool Report(
ConsoleWriter writer,
optional Text cause,
optional Text target)
optional BaseText cause,
optional BaseText target)
{
local int i, j;
local MutableText intro;

Loading…
Cancel
Save