Skip to content
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

Counter expressions #3534

Merged
merged 5 commits into from
Feb 2, 2019
Merged

Conversation

basicer
Copy link
Member

@basicer basicer commented Jan 30, 2019

Short roundup of the initial problem

  • You cant get the middle click menu for counters with a track pad
  • Math is hard.

What will change with this Pull Request?

  • Shift+Clicking a counter will show the middle click menu.
  • When setting a counter value, you can type a math expression in the box and the counter will be set to the result.

@basicer basicer force-pushed the counter-expressions branch 2 times, most recently from 6932941 to e6d303b Compare January 30, 2019 06:01
@skwerlman
Copy link
Contributor

Is it possible to reference the current value of the counter?

@basicer
Copy link
Member Author

basicer commented Jan 30, 2019

Yup, the current value is x.

@basicer basicer force-pushed the counter-expressions branch 2 times, most recently from 0d98501 to c965d86 Compare January 30, 2019 08:48
@ebbit1q
Copy link
Member

ebbit1q commented Jan 30, 2019

Err? Why can't you middle mouse button on trackpad? isn't it triple tap everywhere? I can do this just fine.....

Copy link
Contributor

@ctrlaltca ctrlaltca left a comment

Choose a reason for hiding this comment

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

Works as expected. 👍

A few notes:

  • I was in doubt about the maintainability of including en external library, but it seems like it compiles fine cross-os, and the inclusion of MIT licensed code in a GPL project is ok; the original code seems to be https://github.com/yhirose/cpp-peglib
  • as a c64 guy the first expression I tried was x/0, and the result was -MAX_INT. Is the result expected to be 0, since it should be treated as an error?
  • I'm not sure how needed trigonometric and other functions are, but since they are for free, they are fine.

@ctrlaltca
Copy link
Contributor

Err? Why can't you middle mouse button on trackpad? isn't it triple tap everywhere? I can do this just fine.....

On macs the "three finger tap" is tied to a useless "lookup" function. The shift+click addition can be quite useful there.

@tooomm
Copy link
Member

tooomm commented Jan 30, 2019

Do we want to let the user know that he can do calculations?
There is no exposure of this feature in the interface yet, right?

@basicer
Copy link
Member Author

basicer commented Jan 30, 2019

I suppose we could put it in the tips and tricks dialog.

@tooomm
Copy link
Member

tooomm commented Feb 1, 2019

Haven't thought about that one :)

That would go here:
https://github.com/Cockatrice/Cockatrice/tree/master/cockatrice/resources/tips

Do you want to include that in this PR as well?

@ZeldaZach
Copy link
Member

Should be included in the PR since it's such a big change. Re: tom's comment on new tip dialog

ZeldaZach and others added 2 commits February 1, 2019 15:12
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
@ctrlaltca
Copy link
Contributor

Added tip entry; also, fixed tip-of-the-day dialog image size calculation.

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.

None yet

6 participants