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 // Simple API calls
private function bool TryAPICallCommands( private function bool TryAPICallCommands(
Text subCommand, BaseText subCommand,
EPlayer callerPlayer, EPlayer callerPlayer,
AssociativeArray commandParameters) AssociativeArray commandParameters)
{ {
@ -254,7 +254,7 @@ private function bool TryAPICallCommands(
} }
// json pointer as `Text` -> `DBPointerPair` representation converter method // json pointer as `Text` -> `DBPointerPair` representation converter method
private function DBPointerPair TryLoadingDB(Text databaseLink) private function DBPointerPair TryLoadingDB(BaseText databaseLink)
{ {
local DBPointerPair result; local DBPointerPair result;
if (databaseLink == none) { if (databaseLink == none) {
@ -354,7 +354,7 @@ protected function DisplayData(
OutputStatus(callerPlayer, result); OutputStatus(callerPlayer, result);
if (callerPlayer != none && result == DBR_Success) if (callerPlayer != none && result == DBR_Success)
{ {
printedJSON = _.json.PrettyPrint(data); printedJSON = _.json.PrettyPrint(data).IntoText();
callerConsole.Write(printedJSON).Flush(); callerConsole.Write(printedJSON).Flush();
_.memory.Free(printedJSON); _.memory.Free(printedJSON);
_.memory.Free(callerPlayer); _.memory.Free(callerPlayer);

8
sources/Commands/ACommandFeature.uc

@ -55,8 +55,8 @@ protected function Executed(CallData result, EPlayer callerPlayer)
protected function TryEnableFeature( protected function TryEnableFeature(
EPlayer callerPlayer, EPlayer callerPlayer,
Text featureName, BaseText featureName,
Text chosenConfig) BaseText chosenConfig)
{ {
local Text oldConfig, newConfig; local Text oldConfig, newConfig;
local class<Feature> featureClass; local class<Feature> featureClass;
@ -115,7 +115,7 @@ protected function EnableFeature(
EPlayer callerPlayer, EPlayer callerPlayer,
class<Feature> featureClass, class<Feature> featureClass,
class<FeatureConfig> configClass, class<FeatureConfig> configClass,
Text chosenConfig, BaseText chosenConfig,
bool autoConfig) bool autoConfig)
{ {
local bool wasEnabled; local bool wasEnabled;
@ -196,7 +196,7 @@ protected function DisableFeature(EPlayer callerPlayer, Text featureName)
_.memory.Free(playerName); _.memory.Free(playerName);
} }
protected function class<Feature> LoadFeatureClass(Text featureName) protected function class<Feature> LoadFeatureClass(BaseText featureName)
{ {
local Text featureClassName; local Text featureClassName;
local class<Feature> featureClass; 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( protected function array<Text> LoadItemsList(
Text listName, BaseText listName,
array<Text> availableLists, array<BaseText> availableLists,
ReportTool badLists) ReportTool badLists)
{ {
local int i; local int i;

8
sources/Commands/ACommandNick.uc

@ -82,7 +82,7 @@ protected function ExecutedFor(
protected function bool TryChangeDefaultColor( protected function bool TryChangeDefaultColor(
MutableText newName, MutableText newName,
Text specifiedColor) BaseText specifiedColor)
{ {
local Color defaultColor; local Color defaultColor;
if (newName == none) return false; if (newName == none) return false;
@ -101,9 +101,9 @@ protected function bool TryChangeDefaultColor(
} }
protected function AnnounceNicknameChange( protected function AnnounceNicknameChange(
Text callerName, BaseText callerName,
Text oldName, BaseText oldName,
Text newName, BaseText newName,
bool selfChange) bool selfChange)
{ {
if (selfChange) if (selfChange)

2
sources/Features/FutileChat/FutilityChat.uc

@ -56,7 +56,7 @@ protected function FromData(AssociativeArray source)
} }
private function ChatColorSetting ColorSettingFromText( private function ChatColorSetting ColorSettingFromText(
Text permissions) BaseText permissions)
{ {
if (permissions == none) { if (permissions == none) {
return CCS_DoNothing; return CCS_DoNothing;

2
sources/Features/FutileChat/FutilityChat_Feature.uc

@ -94,7 +94,7 @@ private function bool ReformatChatMessage(
bool teamMessage) bool teamMessage)
{ {
local Text messageCopy; local Text messageCopy;
local Text.Formatting defaultFormatting; local BaseText.Formatting defaultFormatting;
if (sender == none) return true; if (sender == none) return true;
if (message == none) return true; if (message == none) return true;
if (colorSetting == CCS_DoNothing) 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) { if (action == none) {
return NSA_DoNothing; return NSA_DoNothing;
@ -126,7 +126,7 @@ private function NicknameSpacesAction SpaceActionFromText(Text action)
} }
private function NicknameColorPermissions ColorPermissionsFromText( private function NicknameColorPermissions ColorPermissionsFromText(
Text permissions) BaseText permissions)
{ {
if (permissions == none) { if (permissions == none) {
return NCP_ForbidColor; return NCP_ForbidColor;

6
sources/Features/FutileNickames/FutilityNicknames_Feature.uc

@ -253,7 +253,7 @@ private function bool IsAnyCensoringEnabled()
// For nickname changes mid-game. // For nickname changes mid-game.
private function HandleNicknameChange( private function HandleNicknameChange(
EPlayer affectedPlayer, EPlayer affectedPlayer,
Text oldName, BaseText oldName,
MutableText newName) MutableText newName)
{ {
CensorNickname(newName, affectedPlayer); CensorNickname(newName, affectedPlayer);
@ -298,7 +298,7 @@ private function CensorCurrentPlayersNicknames()
private function CensorNickname(MutableText nickname, EPlayer affectedPlayer) private function CensorNickname(MutableText nickname, EPlayer affectedPlayer)
{ {
local Text fallback; local Text fallback;
local Text.Formatting newFormatting; local BaseText.Formatting newFormatting;
if (nickname == none) return; if (nickname == none) return;
if (affectedPlayer == none) return; if (affectedPlayer == none) return;
@ -345,7 +345,7 @@ private function ReplaceSpaces(MutableText nickname)
{ {
local int i; local int i;
local MutableText nicknameCopy; local MutableText nicknameCopy;
local Text.Character nextCharacter, underscoreCharacter; local BaseText.Character nextCharacter, underscoreCharacter;
nicknameCopy = nickname.MutableCopy(); nicknameCopy = nickname.MutableCopy();
nickname.Clear(); nickname.Clear();
underscoreCharacter = underscoreCharacter =

13
sources/Tools/InventoryTool.uc

@ -157,8 +157,8 @@ public final function Reset()
// In case `resolvedWhat == intoWhat` just returns copy of // In case `resolvedWhat == intoWhat` just returns copy of
// original `resolvedWhat` // original `resolvedWhat`
private function MutableText MakeResolvedIntoLine( private function MutableText MakeResolvedIntoLine(
Text resolvedWhat, BaseText resolvedWhat,
Text intoWhat) BaseText intoWhat)
{ {
if (resolvedWhat == none) { if (resolvedWhat == none) {
return none; return none;
@ -201,7 +201,10 @@ private function TryFillAmmo(EItem item)
* @param doFillAmmo Set to `true` if we must also fill ammo reserves * @param doFillAmmo Set to `true` if we must also fill ammo reserves
* of weapons we have added to the full. * 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 EItem addedItem;
local MutableText resolvedLine; local MutableText resolvedLine;
@ -268,7 +271,7 @@ public function AddItem(Text userProvidedName, bool doForce, bool doFillAmmo)
* template and `false` to only remove one. * template and `false` to only remove one.
*/ */
public function RemoveItem( public function RemoveItem(
Text userProvidedName, BaseText userProvidedName,
bool doKeep, bool doKeep,
bool doForce, bool doForce,
bool doRemoveAll) bool doRemoveAll)
@ -332,7 +335,7 @@ public function RemoveItem(
private function DetectAndReportRemovedItems( private function DetectAndReportRemovedItems(
out array<EItem> itemsAfterRemoval, out array<EItem> itemsAfterRemoval,
array<EItem> itemsBeforeRemoval, array<EItem> itemsBeforeRemoval,
array<Text> itemNames, array<BaseText> itemNames,
bool doForce) bool doForce)
{ {
local int i, j; local int i, j;

10
sources/Tools/ReportTool.uc

@ -80,7 +80,7 @@ protected function Finalizer()
* the caller `ReportTool`. * the caller `ReportTool`.
* Method does nothing (initialization fails) iff `template == none`. * Method does nothing (initialization fails) iff `template == none`.
*/ */
public final function Initialize(Text template) public final function Initialize(BaseText template)
{ {
if (template == none) { if (template == none) {
return; return;
@ -98,7 +98,7 @@ public final function Initialize(Text template)
* to the previously added item). * to the previously added item).
* @return Reference to the caller `ReportTool` to allow for method chaining. * @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; local ReportItem newItem;
if (headerTemplate == none) return self; 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. * Does nothing if `detail == none` or no items were added thuis far.
* @return Reference to the caller `ReportTool` to allow for method chaining. * @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; local array<Text> detailToReport;
if (headerTemplate == none) return self; if (headerTemplate == none) return self;
@ -147,8 +147,8 @@ public final function ReportTool Detail(Text detail)
*/ */
public final function ReportTool Report( public final function ReportTool Report(
ConsoleWriter writer, ConsoleWriter writer,
optional Text cause, optional BaseText cause,
optional Text target) optional BaseText target)
{ {
local int i, j; local int i, j;
local MutableText intro; local MutableText intro;

Loading…
Cancel
Save