Skip to content

Dialogue feature #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 27, 2016
Merged

Dialogue feature #49

merged 5 commits into from
Oct 27, 2016

Conversation

AydinHassan
Copy link
Member

@AydinHassan AydinHassan commented Oct 27, 2016

TODO:

  • - Update docs

@AydinHassan AydinHassan reopened this Oct 27, 2016
@codecov-io
Copy link

codecov-io commented Oct 27, 2016

Current coverage is 84.96% (diff: 95.10%)

Merging #49 into develop will increase coverage by 2.06%

@@            develop        #49   diff @@
==========================================
  Files            15         19     +4   
  Lines           614        745   +131   
  Methods         166        183    +17   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            509        633   +124   
- Misses          105        112     +7   
  Partials          0          0          

Powered by Codecov. Last update df89aac...fff333f

Copy link
Member

@mikeymike mikeymike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loving this feature ❤️

}

$style = (new MenuStyle($this->terminal))
->setBg('yellow')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably make this customizable (one for a minor release later though imo, unless it would be a BC break)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can grab the style from the Flash object and change it before you call display :). Checkout the example 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course ... that didn't click .. nice!

$this->style->getUnselectedSetCode()
));

$this->write(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be handling long messages, e.g. wrap over multiple lines like we do with the menu items?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ATM - we only allow one line message and long message won't wrap - it was a bit hard for the calculating logic as I was rushing. We can add this in the future with a bit more time without breaking BC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah no worries sounds good to me. it would complicate centering height etc too so a nice little challenge in the future

}

/**
* @param $row
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string ?

@@ -217,6 +217,11 @@ public function moveCursorToRow($rowNumber)
echo sprintf("\033[%d;0H", $rowNumber);
}

public function moveCursorToColumn($column)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc block

{
$textLines = count(explode("\n", $this->text)) + 2;
$this->y = ceil(($this->parentMenu->getCurrentFrame()->count() / 2)) - ceil($textLines / 2) + 1;
$this->x = ($this->style->getWidth() / 2) - (mb_strlen($this->text) / 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think you need to divide the text length by 2 here dude

@AydinHassan AydinHassan merged commit 5472d7d into develop Oct 27, 2016
@AydinHassan AydinHassan deleted the dialouges branch October 27, 2016 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants