• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão1e85aac7ee6028dd809d80527c0172308414f33f (tree)
Hora2012-09-11 00:05:07
Autorh2so5 <h2so5@git....>
Commiterh2so5

Mensagem de Log

InputBoxの改行まわりの不具合を修正
単一行Inputに対応

Mudança Sumário

Diff

Binary files a/client/scene/Title.cpp and b/client/scene/Title.cpp differ
--- a/client/ui/Input.cpp
+++ b/client/ui/Input.cpp
@@ -20,6 +20,7 @@ const int Input::IME_MAX_PAGE_SIZE = 6;
2020 const int Input::IME_MIN_WIDTH = 120;
2121
2222 Input::Input() :
23+ multiline_(true),
2324 reverse_color_(false)
2425 {
2526 input_bg_image_handle_ = ResourceManager::LoadCachedDivGraph<4>(
@@ -38,6 +39,7 @@ Input::Input() :
3839 candidate_x_ = -1;
3940 candidate_y_ = -1;
4041 blink_count_ = 0;
42+ prev_cursor_pos_ = -1;
4143
4244 x_ = 100;
4345 y_ = 100;
@@ -91,22 +93,22 @@ void Input::Draw()
9193 // int internal_height = height_ - INPUT_MARGIN * 2;
9294
9395 // 選択範囲の背景を描画
94- int current_line = 0;
95- for (auto it = selecting_lines_.begin(); it != selecting_lines_.end(); ++it) {
96- auto line = *it;
97- if (line.first < line.second) {
98- SetDrawBlendMode(DX_BLENDMODE_ALPHA, 100);
99- DrawBox(internal_x + line.first,
100- internal_y + current_line * font_height_,
101- internal_x + line.second,
102- internal_y + (current_line + 1) * font_height_,
103- GetColor(255, 0, 255), TRUE);
104- SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
105- }
106- current_line++;
107- }
108-
109- current_line = 0;
96+ //int current_line = 0;
97+ //for (auto it = selecting_lines_.begin(); it != selecting_lines_.end(); ++it) {
98+ // auto line = *it;
99+ // if (line.first < line.second) {
100+ // SetDrawBlendMode(DX_BLENDMODE_ALPHA, 100);
101+ // DrawBox(internal_x + line.first,
102+ // internal_y + current_line * font_height_,
103+ // internal_x + line.second,
104+ // internal_y + (current_line + 1) * font_height_,
105+ // GetColor(255, 0, 255), TRUE);
106+ // SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
107+ // }
108+ // current_line++;
109+ //}
110+
111+ int current_line = 0;
110112 for (auto it = clause_lines_.begin(); it != clause_lines_.end(); ++it) {
111113 auto line = *it;
112114 if (line.first < line.second) {
@@ -260,8 +262,7 @@ void Input::Draw()
260262
261263 void Input::Update()
262264 {
263- blink_count_ += 1;
264- blink_count_ %= 60;
265+ blink_count_ = (blink_count_ + 1) % 60;
265266 }
266267
267268 void Input::ProcessInput(InputManager* input)
@@ -281,7 +282,8 @@ void Input::ProcessInput(InputManager* input)
281282 bool push_key_v = (input->GetKeyCount(KEY_INPUT_V) > 0);
282283 bool push_key_ctrl = (input->GetKeyCount(KEY_INPUT_LCONTROL) > 0
283284 || input->GetKeyCount(KEY_INPUT_RCONTROL) > 0);
284-
285+
286+ bool push_key_return = (input->GetKeyCount(KEY_INPUT_RETURN) > 0);
285287 bool first_key_return = (input->GetKeyCount(KEY_INPUT_RETURN) == 1);
286288
287289 bool push_repeat_key_return = (input->GetKeyCount(KEY_INPUT_RETURN)
@@ -296,7 +298,7 @@ void Input::ProcessInput(InputManager* input)
296298 if (!active() && push_key_v && push_key_ctrl) {
297299 set_active(true);
298300 } else {
299- if (push_key_shift && first_key_return) {
301+ if (push_key_shift && push_key_return) {
300302 SetActiveKeyInput(input_handle_);
301303 } else if (first_key_return) {
302304 if (CheckKeyInput(input_handle_) == 1) {
@@ -364,6 +366,7 @@ void Input::ProcessInput(InputManager* input)
364366 TCHAR c = *it;
365367 int width = GetDrawStringWidthToHandle(&c, 1, font_handle_);
366368 line_buffer += c;
369+ char_count++;
367370 #else
368371 unsigned char c = *it;
369372 TCHAR string[2] = { 0, 0 };
@@ -406,6 +409,11 @@ void Input::ProcessInput(InputManager* input)
406409 if (active()) {
407410 // カーソル位置(byte)を取得
408411 cursor_byte_pos = GetKeyInputCursorPosition(input_handle_);
412+ if (prev_cursor_pos_ != cursor_byte_pos) {
413+ ResetCursorCount();
414+ }
415+
416+ prev_cursor_pos_ = cursor_byte_pos;
409417
410418 // カーソルのドット単位の位置を取得する
411419 cursor_dot_pos = GetDrawStringWidthToHandle(String, cursor_byte_pos,
@@ -471,6 +479,7 @@ void Input::ProcessInput(InputManager* input)
471479 TCHAR c = *it;
472480 int width = GetDrawStringWidthToHandle(&c, 1, font_handle_);
473481 line_buffer += c;
482+ char_count++;
474483 #else
475484 unsigned char c = *it;
476485 TCHAR string[2] = { 0, 0 };
@@ -552,6 +561,7 @@ void Input::ProcessInput(InputManager* input)
552561 TCHAR c = *it;
553562 int width = GetDrawStringWidthToHandle(&c, 1, font_handle_);
554563 line_buffer += tstring(&c, 1);
564+ char_count++;
555565 #else
556566 unsigned char c = *it;
557567 TCHAR string[2] = { 0, 0 };
@@ -696,10 +706,10 @@ void Input::ProcessInput(InputManager* input)
696706 line_buffer.clear();
697707 line_width = 0;
698708
699- if (push_key_shift && (push_repeat_key_up || push_repeat_key_down)) {
700- SetKeyInputSelectArea(GetKeyInputCursorPosition(input_handle_),
701- prev_cursor_pos_, input_handle_);
702- }
709+ //if (push_key_shift && (push_repeat_key_up || push_repeat_key_down)) {
710+ // SetKeyInputSelectArea(GetKeyInputCursorPosition(input_handle_),
711+ // prev_cursor_pos_, input_handle_);
712+ //}
703713
704714 }
705715
@@ -732,7 +742,7 @@ void Input::ResetCursorCount()
732742 void Input::CancelSelect()
733743 {
734744 int pos = GetKeyInputCursorPosition(input_handle_);
735- prev_cursor_pos_ = pos;
745+ // prev_cursor_pos_ = pos;
736746 SetKeyInputSelectArea(-1, -1, input_handle_);
737747 }
738748
@@ -811,4 +821,14 @@ bool Input::reverse_color() const
811821 void Input::set_reverse_color(bool flag)
812822 {
813823 reverse_color_ = flag;
824+}
825+
826+bool Input::multiline() const
827+{
828+ return multiline_;
829+}
830+
831+void Input::set_multiline(bool flag)
832+{
833+ multiline_ = flag;
814834 }
\ No newline at end of file
--- a/client/ui/Input.hpp
+++ b/client/ui/Input.hpp
@@ -40,6 +40,9 @@ class Input {
4040 bool reverse_color() const;
4141 void set_reverse_color(bool flag);
4242
43+ bool multiline() const;
44+ void set_multiline(bool flag);
45+
4346 void set_on_enter(const CallbackFunc& func);
4447
4548 public:
@@ -65,7 +68,7 @@ class Input {
6568 int selecting_candidate_, selecting_clause_;
6669 int cursor_moveto_x_, cursor_moveto_y_;
6770 int prev_cursor_pos_, cursor_drag_count_;
68- int multiline_;
71+ bool multiline_;
6972
7073 std::vector<std::pair<int, int>> selecting_lines_;
7174 std::vector<std::pair<int, int>> clause_lines_;
--- a/client/ui/InputBox.cpp
+++ b/client/ui/InputBox.cpp
@@ -343,7 +343,7 @@ void InputBox::ProcessInput(InputManager* input)
343343 bool empty = input_.text().empty();
344344 input_.ProcessInput(input);
345345
346- if (IsActive() && ((first_key_return && empty) || push_key_esc)) {
346+ if (IsActive() && ((first_key_return && !push_key_shift && empty) || push_key_esc)) {
347347 Inactivate();
348348 } else if (!IsActive() && first_key_return) {
349349 Activate();
--- a/client/version.hpp
+++ b/client/version.hpp
@@ -9,7 +9,7 @@
99
1010 #define MMO_VERSION_MAJOR 0
1111 #define MMO_VERSION_MINOR 2
12-#define MMO_VERSION_REVISION 5
12+#define MMO_VERSION_REVISION 6
1313
1414 #ifdef MMO_VERSION_BUILD
1515 #define MMO_VERSION_BUILD_TEXT " Build " MMO_VERSION_TOSTRING(MMO_VERSION_BUILD)