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. 10
      sources/Commands/ACommandFeature.uc
  3. 6
      sources/Commands/ACommandInventory.uc
  4. 10
      sources/Commands/ACommandNick.uc
  5. 2
      sources/Features/FutileChat/FutilityChat.uc
  6. 4
      sources/Features/FutileChat/FutilityChat_Feature.uc
  7. 4
      sources/Features/FutileNickames/FutilityNicknames.uc
  8. 12
      sources/Features/FutileNickames/FutilityNicknames_Feature.uc
  9. 19
      sources/Tools/InventoryTool.uc
  10. 12
      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);

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

6
sources/Commands/ACommandInventory.uc

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

10
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)
{

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;

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

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;

12
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 =

19
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<EItem> itemsAfterRemoval,
array<EItem> itemsBeforeRemoval,
array<Text> itemNames,
array<BaseText> itemNames,
bool doForce)
{
local int i, j;

12
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;
@ -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;

Loading…
Cancel
Save