Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
devapromix committed Jan 12, 2018
1 parent 2571d5c commit d0bd4a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions uAffixes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ constructor TAffixes.Create();
begin
P := TypeInfo(TSuffixEnum);
for I := Low(TSuffixEnum) to High(TSuffixEnum) do
FSuffixName[I] := StringReplace(GetEnumName(P, Ord(I)), '_', ' ',
[rfReplaceAll]);
FSuffixName[I] := GetEnumName(P, Ord(I)).GetName('');
end;

procedure TAffixes.DoCraft(const Effect: TEffect; const Index: UInt);
Expand Down
3 changes: 2 additions & 1 deletion uHelpers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ function TItemHelper.DoIt: string;

function TStringHelper.GetName(const Pref: string): string;
begin
Result := StringReplace(Self, Pref, '', [rfReplaceAll]);
if (Pref <> '') then
Result := StringReplace(Self, Pref, '', [rfReplaceAll]);
Result := StringReplace(Result, '_', ' ', [rfReplaceAll]);
end;

Expand Down
10 changes: 5 additions & 5 deletions uScenes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,10 @@ procedure TSceneHelp.Render;
begin
UI.Title(_('Keybindings'), 5);

Terminal.Print(CX, 6, Format('%s: %s, %s, %s', [_('Scroll pages and skills'), UI.KeyToStr('arrow keys'),
UI.KeyToStr('numpad'), UI.KeyToStr('WADX')]), TK_ALIGN_CENTER);

X := 1;
Y := 8;
AddLine('Right/Left', _('Change tab'));
AddLine('Up/Down', _('Scroll skills'));
AddLine('Tab', _('Show Background'));
AddLine('Space', _('Show Inventory'));
end;
Expand Down Expand Up @@ -1811,10 +1810,11 @@ procedure TSceneRest.Update(var Key: UInt);

procedure TSceneName.Render;
begin
UI.Title(_('Name'));
UI.Title(_('Choose name'));

Terminal.Print(CX - 10, CY, _('Name') + ': ' + Player.Name + Game.GetCursor, TK_ALIGN_LEFT);
Terminal.Print(CX - 10, CY, _('Enter you name') + ': ' + Player.Name + Game.GetCursor, TK_ALIGN_LEFT);

AddKey('Enter', _('Confirm'));
AddKey('Esc', _('Back'), True);
end;

Expand Down

0 comments on commit d0bd4a6

Please sign in to comment.