Repository navigation
Conversation
But.. why? Any reason not to implement clickable UI? |
|
On the phone UI is so small that it is near impossible to press what you want. |
Too small? That is likely due to lack of |
|
Will investigate and post updates. |
|
Implemented |
|
Not very happy with this |
|
Dropped |
Try
left a comment
There was a problem hiding this comment.
but I think it is better that hardcode "20%|40%|60%|80%|100%|120%|140%|160%|180%|200%|220%|240%|260%|280%|300%"; values.
There are 2 variants of such control (script driven):
- Enum like (Range of view) - those have explicit values
- Slider - those have step value stored at
userFloat[0]
(OpenGothic actually doesn't have case 2 implemented - changes slider by 3% always)
Basically, it's not for engine to really decide - we just draw what UI-script wants :)
| if(auto window = dynamic_cast<const MainWindow*>(w)) { | ||
| const float scale = window->uiScale() * mul; | ||
| #if defined(__MOBILE_PLATFORM__) | ||
| return std::min(scale,0.85f*std::min(float(window->w())/640.f,float(window->h())/480.f)); |
There was a problem hiding this comment.
AFAIK model resolution for gothic ui is 800x600
| const int count = int(strEnumSize(touchSlider->handle->text[0])); | ||
| if(count==0) | ||
| return; | ||
| touchSlider->value = int(std::round(value*float(count-1))); |
There was a problem hiding this comment.
would it make more sense to have +1 on a tap, rather?
| touchStart = event.pos(); | ||
| touchMoved = false; | ||
| if(current->beginTouch(touchStart-current->pos())) | ||
| touchId = event.mouseID; |
There was a problem hiding this comment.
would it be cleaner to reject mouseEvent, if mouseID!=0 ? Basically, if mouseID!=0, that means there is already some other interaction with this menu, initiated earlier by user. And if you not accepting this event (event.ignore()) - it will not cause mouseUp/mouseDrag
| void setPlayer(const Npc& pl); | ||
|
|
||
| void onKeyboard(KeyCodec::Action k); | ||
| bool beginTouch(Tempest::Point pos); |
| if(!choice && slider==nullptr) | ||
| return; | ||
| const auto rect = itemRect(*touchSlider); | ||
| const int knob = choice ? 0 : int(float(slider->w())*float(rect.h/2)/float(slider->h())); |
There was a problem hiding this comment.
please, don't use texture resolution to decide integer vs float property.
| } | ||
|
|
||
| #if defined(__MOBILE_PLATFORM__) | ||
| void MenuRoot::mouseDragEvent(MouseEvent& event) { |
There was a problem hiding this comment.
nit: may you please have one definition of mouseDragEvent/mouseUpEvent, and only disable implementation code, base on platform?
|
Thanks, addressed all of them:
Tested on the phone. |


Adds direct touch navigation for game menus, using Tempest's Android touch events and UI scale.
INTERFACE.Scalemultiplier.Depends on Try/Tempest#127 for Android density-based
implUiScale. The view-distance choices remain unhooked from rendering; this changes their interaction, not their graphics behavior.Journal dialogs and text entry aren't covered yet.