OSDN Git Service

マップ上でのワープポイント位置表示 master v0.4.1
authorh2so5 <h2so5@git.sourceforge.jp>
Tue, 30 Oct 2012 03:52:19 +0000 (12:52 +0900)
committerh2so5 <h2so5@git.sourceforge.jp>
Tue, 30 Oct 2012 03:52:19 +0000 (12:52 +0900)
ワープ先の座標指定機能

Readme.txt
client/MiniMap.cpp
client/scene/Title.cpp
client/ui/Input.cpp
client/ui/Input.hpp
client/ui/InputBox.cpp
client/version.hpp

index 4ef6bbe..35b31a2 100644 (file)
@@ -1,4 +1,4 @@
-Miku Miku Online 0.4.0
+Miku Miku Online 0.4.1
 
 // ******************************** 警告 *********************************** //
 // *** 
index d02642a..7f4938d 100644 (file)
@@ -205,7 +205,7 @@ void MiniMap::DrawPosAndCalc()
        if(current_channel){
        BOOST_FOREACH(auto it,current_channel->warp_points)
        {
-               direction = VSub(VGet(it.x,it.y,it.z),myself_pos);
+               direction = VSub(it.position, myself_pos);
                direction.y = 0;
                theta = atan2( -direction.x, -direction.z);
                tmp_pos_x = ( sin(mtheta + TORADIAN(180.0f) - theta) * VSize(direction) * ( 1.0f / world_manager->stage()->map_scale()) )/ 3.0f + absolute_x() + absolute_width()/2;
index fcb9f28..1239341 100644 (file)
Binary files a/client/scene/Title.cpp and b/client/scene/Title.cpp differ
index f7de9a8..97a2a3e 100644 (file)
@@ -8,7 +8,7 @@
 
 const size_t Input::TEXT_BUFFER_SIZE = 1024;
 const size_t Input::HISTORY_MAX_SIZE = 50;
-const int Input::KEY_REPEAT_FRAME = 8;
+const int Input::KEY_REPEAT_FRAME = 6;
 
 const int Input::INPUT_MARGIN_X = 8;
 const int Input::INPUT_MARGIN_Y = 6;
@@ -19,12 +19,9 @@ const int Input::IME_MARGIN_Y = 16;
 const int Input::IME_MAX_PAGE_SIZE = 6;
 const int Input::IME_MIN_WIDTH = 120;
 
-Input::Input(ConfigManagerPtr config_manager) :
+Input::Input() :
        multiline_(true),
-    reverse_color_(false),
-       drag_flag_(false),
-       rightmenu_show_(false),
-       config_manager_(config_manager)
+    reverse_color_(false)
 {
     input_bg_image_handle_ = ResourceManager::LoadCachedDivGraph<4>(
             _T("system/images/gui/gui_inputbox_input_bg.png"), 2, 2, 12, 12);
@@ -48,114 +45,6 @@ Input::Input(ConfigManagerPtr config_manager) :
     y_ = 100;
     width_ = 160;
     height_ = font_height_ + 4;
-
-       click_cancel_count_ = 0;
-
-}
-
-void Input::Init()
-{
-       auto shd_right_click_list_ = std::make_shared<UIList>(right_click_list_);
-       right_click_list_.addItem(UIBasePtr(new UILabel([&]()->UILabel{
-               UILabel label;
-               label.set_parent_c(shd_right_click_list_);
-               label.set_input_adaptor(this);
-               label.set_text(unicode::ToTString(unicode::sjis2utf8("切り取り")));
-               label.set_width(120);
-               label.set_top(12);
-               label.set_left(0);
-               label.set_textcolor(UISuper::Color(0,0,0,255));
-               label.set_bgcolor(UISuper::Color(255,255,255,180));
-               label.set_on_click_function_([](UIBase* ptr)->void{
-                       auto input_ = ptr->input_adpator();
-                       auto sel_txt = input_->selecting_text();
-                       SetClipboardText(sel_txt.c_str());
-                       auto text = input_->text();
-                       auto pos = text.find(sel_txt);
-                       tstring res;
-                       if( pos != std::string::npos )
-                       {
-                               res = text.substr(0,pos);
-                               res += text.substr(pos + sel_txt.size(),text.size() - pos + sel_txt.size());
-                       }
-                       input_->set_text(res);
-                       input_->set_click_chancel_count(8);
-               });
-               label.set_on_hover_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(0,0,0,180));
-                       label_ptr->set_textcolor(UISuper::Color(255,255,255));
-               });
-               label.set_on_out_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(255,255,255,180));
-                       label_ptr->set_textcolor(UISuper::Color(0,0,0));
-               });
-               return label;
-       }())));
-       right_click_list_.addItem(UIBasePtr(new UILabel([&]()->UILabel{
-               UILabel label;
-               label.set_parent_c(shd_right_click_list_);
-               label.set_input_adaptor(this);
-               label.set_text(unicode::ToTString(unicode::sjis2utf8("コピー")));
-               label.set_width(120);
-               label.set_top(12);
-               label.set_left(0);
-               label.set_textcolor(UISuper::Color(0,0,0,255));
-               label.set_bgcolor(UISuper::Color(255,255,255,180));
-               label.set_on_click_function_([&](UIBase* ptr)->void{
-                       auto input_ = ptr->input_adpator();
-                       SetClipboardText(input_->selecting_text().c_str());
-                       input_->set_click_chancel_count(8);
-               });
-               label.set_on_hover_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(0,0,0,180));
-                       label_ptr->set_textcolor(UISuper::Color(255,255,255));
-               });
-               label.set_on_out_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(255,255,255,180));
-                       label_ptr->set_textcolor(UISuper::Color(0,0,0));
-               });
-               return label;
-       }())));
-       right_click_list_.addItem(UIBasePtr(new UILabel([&]()->UILabel{
-               UILabel label;
-               label.set_parent_c(shd_right_click_list_);
-               label.set_input_adaptor(this);
-               label.set_text(unicode::ToTString(unicode::sjis2utf8("貼り付け")));
-               label.set_width(120);
-               label.set_top(12);
-               label.set_left(0);
-               label.set_textcolor(UISuper::Color(0,0,0,255));
-               label.set_bgcolor(UISuper::Color(255,255,255,180));
-               label.set_on_click_function_([&](UIBase* ptr)->void{
-                       auto input_ = ptr->input_adpator();
-                       auto size = GetClipboardText(NULL);
-                       if(size > 0){
-                               TCHAR *buf = new TCHAR[size];
-                               GetClipboardText(buf);
-                               input_->paste_text(buf);
-                               delete []buf;
-                       }
-                       input_->set_click_chancel_count(8);
-               });
-               label.set_on_hover_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(0,0,0,180));
-                       label_ptr->set_textcolor(UISuper::Color(255,255,255));
-               });
-               label.set_on_out_function_([](UIBase* ptr)->void{
-                       auto label_ptr = (UILabel *)ptr;
-                       label_ptr->set_bgcolor(UISuper::Color(255,255,255,180));
-                       label_ptr->set_textcolor(UISuper::Color(0,0,0));
-               });
-               return label;
-       }())));
-       right_click_list_.set_height((font_height_ + 2)* 3);
-       right_click_list_.set_width(120);
-       right_click_list_.set_visible(false);
 }
 
 void Input::Draw()
@@ -270,98 +159,12 @@ void Input::Draw()
             }
         }
 
-               int select_start = 0,select_end = 0;
-               GetKeyInputSelectArea(&select_start,&select_end,input_handle_);
-               if( select_start > select_end )std::swap(select_start,select_end);
-
-               if( select_start > -1 && select_end != select_start ) {
-                       if ( multiline_ ) {
-                               BOOST_FOREACH(auto it,lines_){
-                                       int width = 0;
-                                       TCHAR c[2] = {0};
-                                       if( select_start >= it.size() && select_start != -1 ) {
-                                               DrawStringToHandle(internal_x, internal_y + current_line * font_height_,
-                                                       it.c_str(), text_color, font_handle_);
-                                               if(select_start == it.size()){
-                                                       select_start -= it.size();
-                                               }else{
-                                                       select_start -= it.size() + 1;
-                                               }
-                                               select_end -= it.size() + 1;
-                                               ++current_line;
-                                       }else if(select_start != -1){
-                                               for(int i = 0;i < select_start;++i){
-                                                       c[0] = it[i];
-                                                       DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                               c, text_color, font_handle_);
-                                                       width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                               }
-                                               for(int i = select_start;i < ((select_end > static_cast<int>(it.size())) ? it.size() : select_end); ++i){
-                                                       c[0] = it[i];
-                                                       SetDrawBlendMode(DX_BLENDMODE_ALPHA, 180);
-                                                       DrawBox(internal_x + width,internal_y + current_line * font_height_,
-                                                               internal_x + width + GetDrawStringWidthToHandle(c,1,font_handle_),internal_y + ( current_line + 1 ) * font_height_,text_color,1);
-                                                       DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                               c, !reverse_color_ ? GetColor(255, 255, 255) : GetColor(0, 0, 0), font_handle_);
-                                                       width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                                       SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
-                                               }
-                                               for(int i = ((select_end > static_cast<int>(it.size())) ? it.size() : select_end);i < it.size(); ++i){
-                                                       c[0] = it[i];
-                                                       DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                               c, text_color, font_handle_);
-                                                       width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                               }
-                                               if(select_end > it.size()){
-                                                       select_end -= it.size() + 1;
-                                                       select_start = 0;
-                                               }else{
-                                                       select_start = -1;
-                                               }
-                                               ++current_line;
-                                       }else if(select_start == -1){
-                                               DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                       it.c_str(), text_color, font_handle_);
-                                               ++current_line;
-                                       }
-                               }
-                       }else{
-                               BOOST_FOREACH(auto it,lines_){
-                                       int width = 0;
-                                       TCHAR c[2] = {0};
-                                       for(int i = 0;i < select_start;++i){
-                                               c[0] = it[i];
-                                               DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                       c, text_color, font_handle_);
-                                               width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                       }
-                                       for(int i = select_start;i < select_end; ++i){
-                                               c[0] = it[i];
-                                       SetDrawBlendMode(DX_BLENDMODE_ALPHA, 180);
-                                               DrawBox(internal_x + width,internal_y + current_line * font_height_,
-                                                       internal_x + width + GetDrawStringWidthToHandle(c,1,font_handle_),internal_y + ( current_line + 1 ) * font_height_,text_color,1);
-                                               DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                       c, !reverse_color_ ? GetColor(255, 255, 255) : GetColor(0, 0, 0), font_handle_);
-                                               width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                               SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
-                                       }
-                                       for(unsigned int i = select_end;i < it.size(); ++i){
-                                               c[0] = it[i];
-                                               DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_,
-                                                       c, text_color, font_handle_);
-                                               width += GetDrawStringWidthToHandle(c,1,font_handle_);
-                                       }
-                               }
-                       }
-               }else{
-                       for (auto it = lines_.begin(); it != lines_.end(); ++it) {
-                               auto line = *it;
-                               DrawStringToHandle(internal_x, internal_y + current_line * font_height_,
-                                       line.c_str(), text_color, font_handle_);
-                               current_line++;
-                       }
-               }
-
+        for (auto it = lines_.begin(); it != lines_.end(); ++it) {
+            auto line = *it;
+            DrawStringToHandle(internal_x, internal_y + current_line * font_height_,
+                    line.c_str(), text_color, font_handle_);
+            current_line++;
+        }
 
         // カーソルを描画
         if (clause_lines_.size() <= 0 && active() && blink_count_ < 30) {
@@ -455,21 +258,11 @@ void Input::Draw()
             }
         }
     }
-       {
-               if ( right_click_list_.visible() ) {
-                       right_click_list_.Draw();
-               }
-       }
 }
 
 void Input::Update()
 {
     blink_count_ = (blink_count_ + 1) % 60;
-       {
-               if ( right_click_list_.visible() ) {
-                       right_click_list_.Update();
-               }
-       }
 }
 
 void Input::ProcessInput(InputManager* input)
@@ -478,18 +271,7 @@ void Input::ProcessInput(InputManager* input)
         return;
     }
 
-       if (click_cancel_count_ > 0)
-       {
-               input->CancelMouseLeft();
-               input->CancelMouseRight();
-               --click_cancel_count_;
-       }
-
-    bool push_mouse_left = (input->GetMouseLeftCount() > 0);
-       bool prev_mouse_left = input->GetPrevMouseLeft();
-
-       bool push_mouse_right = (input->GetMouseRightCount() > 0);
-       bool prev_mouse_right = input->GetPrevMouseRight();
+    // bool push_mouse_left = (input->GetMouseLeftCount() > 0);
 
     // bool first_key_shift = (input->GetKeyCount(KEY_INPUT_RSHIFT) == 1
     //        || input->GetKeyCount(KEY_INPUT_LSHIFT) == 1);
@@ -510,7 +292,6 @@ void Input::ProcessInput(InputManager* input)
             + KEY_REPEAT_FRAME) % (KEY_REPEAT_FRAME + 1) == 0;
     bool push_repeat_key_down = (input->GetKeyCount(KEY_INPUT_DOWN)
             + KEY_REPEAT_FRAME) % (KEY_REPEAT_FRAME + 1) == 0;
-
     // bool push_long_backspace = (input->GetKeyCount(KEY_INPUT_BACK) > 60 * 1.5);
 
     auto input_text = text();
@@ -531,13 +312,6 @@ void Input::ProcessInput(InputManager* input)
         }
     }
 
-       if ( right_click_list_.visible() ) {
-               right_click_list_.ProcessInput(input);
-               if( push_mouse_left ) {
-                       //rightmenu_show_ = false;
-                       right_click_list_.set_visible(false);
-               }
-       }
     if (push_repeat_key_up) {
         cursor_moveto_y_ = cursor_y_ - font_height_ / 2;
         cursor_moveto_x_ = cursor_x_ + 2;
@@ -633,189 +407,7 @@ void Input::ProcessInput(InputManager* input)
     }
 
     if (active()) {
-               if ( !right_click_list_.visible() &&
-                       !( right_click_list_.visible() && right_click_list_.absolute_x()<= input->GetMouseX() && input->GetMouseX() <= right_click_list_.absolute_x()+ right_click_list_.absolute_width()
-                       && right_click_list_.absolute_y() <= input->GetMouseY() && input->GetMouseY() <= right_click_list_.absolute_y() + right_click_list_.absolute_height())) {
-                               // マウス左ボタンが押された時
-                               if (push_mouse_left && !prev_mouse_left) {
-                                       auto mpos = input->GetMousePos();
-                                       auto offset_x = mpos.first - (x_ + INPUT_MARGIN_X);
-                                       auto offset_y = mpos.second - (y_ + INPUT_MARGIN_Y);
-                                       // カレット変更
-                                       if( multiline_ ) {
-                                               auto line_num = offset_y / font_height_;
-                                               //if( ( offset_y % font_height_ ) != 0 )++line_num;
-                                               int tmp = 0,cnt = 0;
-                                               if( line_num < (int)lines_.size() && line_num >= 0 ){
-                                                       for(int i = 0;i < line_num; ++i){
-                                                               cnt += lines_[i].size();
-                                                       }
-                                                       for(unsigned int i = 0;i < lines_[line_num].size(); ++i){
-                                                               auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_);
-                                                               if( tmp + tmp_x < offset_x ){
-                                                                       tmp += tmp_x;
-                                                                       ++cnt;
-                                                               }
-                                                       }
-                                                       SetKeyInputCursorPosition(line_num + cnt,input_handle_);
-                                               }
-                                       }else{
-                                               int tmp = 0,cnt = 0;
-                                               for(unsigned int i = 0;i < lines_[0].size(); ++i){
-                                                       auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_);
-                                                       if( tmp + tmp_x < offset_x ){
-                                                               tmp += tmp_x;
-                                                               ++cnt;
-                                                       }
-                                               }
-                                               if( selecting_coursorpoint_.first = selecting_coursorpoint_.second ) {
-                                                       SetKeyInputSelectArea( -1, -1, input_handle_ );
-                                               }else{
-                                                       SetKeyInputSelectArea(selecting_coursorpoint_.first,selecting_coursorpoint_.second,input_handle_);
-                                               }
-                                               SetKeyInputCursorPosition(cnt,input_handle_);
-                                       }
-                               }
-                               // マウス左ボタンがドラッグされた時
-                               if (push_mouse_left && prev_mouse_left ) {
-                                       int prev_cursor_pos = 0;
-                                       if( !drag_flag_ ){
-                                               prev_cursor_pos = GetKeyInputCursorPosition(input_handle_);
-                                       }else{
-                                               prev_cursor_pos = selecting_coursorpoint_.first;
-                                       }
-                                       auto mpos = input->GetMousePos();
-                                       auto offset_x = mpos.first - (x_ + INPUT_MARGIN_X);
-                                       auto offset_y = mpos.second - (y_ + INPUT_MARGIN_Y);
-                                       // カレット変更
-                                       if( multiline_ ) {
-                                               auto line_num = offset_y / font_height_;
-                                               int tmp = 0,cnt = 0;
-                                               if( line_num < (int)lines_.size() && line_num >= 0){
-                                                       for(int i = 0;i < line_num; ++i,++cnt){
-                                                               cnt += lines_[i].size();
-                                                       }
-                                                       for(unsigned int i = 0;i < lines_[line_num].size(); ++i){
-                                                               auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_);
-                                                               if( tmp + tmp_x < offset_x ){
-                                                                       tmp += tmp_x;
-                                                                       ++cnt;
-                                                               }
-                                                       }
-                                               }
-                                               selecting_coursorpoint_ = std::make_pair<int,int>(prev_cursor_pos,cnt);
-                                       }else{
-                                               int tmp = 0,cnt = 0;
-                                               for(unsigned int i = 0;i < lines_[0].size(); ++i){
-                                                       auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_);
-                                                       if( tmp + tmp_x < offset_x ){
-                                                               tmp += tmp_x;
-                                                               ++cnt;
-                                                       }
-                                               }
-                                               selecting_coursorpoint_ = std::make_pair<int,int>(prev_cursor_pos,cnt);
-                                       }
-                                       SetKeyInputSelectArea(selecting_coursorpoint_.first,selecting_coursorpoint_.second,input_handle_);
-                                       SetKeyInputCursorPosition(selecting_coursorpoint_.second,input_handle_);
-                                       drag_flag_ = true;
-                               }
-                               // マウス左ボタンが離され、且つ前回ドラッグされていた時
-                               if (!push_mouse_left && prev_mouse_left && drag_flag_ ) {
-                                       drag_flag_ = false;
-                                       if( selecting_coursorpoint_.first == selecting_coursorpoint_.second ) {
-                                               SetKeyInputSelectArea( -1, -1, input_handle_ );
-                                       }else{
-                                               if(selecting_coursorpoint_.first > selecting_coursorpoint_.second)
-                                               {
-                                                       std::swap(selecting_coursorpoint_.first , selecting_coursorpoint_.second);
-                                               }
-                                               SetKeyInputSelectArea(selecting_coursorpoint_.first,selecting_coursorpoint_.second,input_handle_);
-                                       }
-                                       SetKeyInputCursorPosition(selecting_coursorpoint_.second,input_handle_);
-                               }
-               }else{
-                       if( push_mouse_left ){
-                               auto mpos = input->GetMousePos();
-                               auto offset_x = mpos.first - (x_ + INPUT_MARGIN_X);
-                               auto offset_y = mpos.second - (y_ + INPUT_MARGIN_Y);
-                               // カレット変更
-                               if( multiline_ ) {
-                                       auto line_num = offset_y / font_height_;
-                                       //if( ( offset_y % font_height_ ) != 0 )++line_num;
-                                       int tmp = 0,cnt = 0;
-                                       if( line_num < (int)lines_.size() && line_num >= 0 ){
-                                               for(int i = 0;i < line_num; ++i){
-                                                       cnt += lines_[i].size();
-                                               }
-                                               for(unsigned int i = 0;i < lines_[line_num].size(); ++i){
-                                                       auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_);
-                                                       if( tmp + tmp_x < offset_x ){
-                                                               tmp += tmp_x;
-                                                               ++cnt;
-                                                       }
-                                               }
-                                               SetKeyInputCursorPosition(line_num + cnt,input_handle_);
-                                       }
-                               }else{
-                                       int tmp = 0,cnt = 0;
-                                       for(unsigned int i = 0;i < lines_[0].size(); ++i){
-                                               auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_);
-                                               if( tmp + tmp_x < offset_x ){
-                                                       tmp += tmp_x;
-                                                       ++cnt;
-                                               }
-                                       }
-                                       if( selecting_coursorpoint_.first = selecting_coursorpoint_.second ) {
-                                               SetKeyInputSelectArea( -1, -1, input_handle_ );
-                                       }else{
-                                               SetKeyInputSelectArea(selecting_coursorpoint_.first,selecting_coursorpoint_.second,input_handle_);
-                                       }
-                                       SetKeyInputCursorPosition(cnt,input_handle_);
-                               }
-                       }
-               }
-               // マウス右ボタンが押されたとき
-               if ( push_mouse_right && !prev_mouse_right ) {
-                       if( x() <= input->GetMouseX() && input->GetMouseX() <= x() + width() && 
-                               y() <= input->GetMouseY() && input->GetMouseY() <= y() + height()){
-                                       auto mouse_pos_ = input->GetMousePos();
-                                       if( mouse_pos_.second + right_click_list_.absolute_height() > config_manager_->screen_height()){
-                                               right_click_list_.set_top(mouse_pos_.second - right_click_list_.absolute_height());
-                                               if ( mouse_pos_.first + right_click_list_.absolute_width() > config_manager_->screen_width()){
-                                                       right_click_list_.set_left(mouse_pos_.first - right_click_list_.absolute_width());
-                                                       BOOST_FOREACH(auto it,right_click_list_.getItems()){
-                                                               it->set_left(mouse_pos_.first - right_click_list_.absolute_width());
-                                                               it->set_top(mouse_pos_.second - right_click_list_.absolute_height() + 12);
-                                                       }
-                                               }else{
-                                                       right_click_list_.set_left(mouse_pos_.first);
-                                                       BOOST_FOREACH(auto it,right_click_list_.getItems()){
-                                                               it->set_left(mouse_pos_.first);
-                                                               it->set_top(mouse_pos_.second - right_click_list_.absolute_height() + 12);
-                                                       }
-                                               }
-                                       }else{
-                                               right_click_list_.set_top(mouse_pos_.second);
-                                               if ( mouse_pos_.first + right_click_list_.absolute_width() > config_manager_->screen_width()){
-                                                       right_click_list_.set_left(mouse_pos_.first - right_click_list_.absolute_width());
-                                                       BOOST_FOREACH(auto it,right_click_list_.getItems()){
-                                                               it->set_left(mouse_pos_.first - right_click_list_.absolute_width());
-                                                               it->set_top(mouse_pos_.second + 12);
-                                                       }
-                                               }else{
-                                                       right_click_list_.set_left(mouse_pos_.first);
-                                                       BOOST_FOREACH(auto it,right_click_list_.getItems()){
-                                                               it->set_left(mouse_pos_.first);
-                                                               it->set_top(mouse_pos_.second + 12);
-                                                       }
-                                               }
-                                       }
-                                       right_click_list_.set_visible(true);
-                                       //rightmenu_show_ = true;
-                       }
-               }
-
-        // カーソル位置(文字単位)を取得
+        // カーソル位置(byte)を取得
         cursor_byte_pos = GetKeyInputCursorPosition(input_handle_);
                if (prev_cursor_pos_ != cursor_byte_pos) {
                        ResetCursorCount();
@@ -823,7 +415,6 @@ void Input::ProcessInput(InputManager* input)
 
                prev_cursor_pos_ = cursor_byte_pos;
 
-
         // カーソルのドット単位の位置を取得する
         cursor_dot_pos = GetDrawStringWidthToHandle(String, cursor_byte_pos,
                 font_handle_);
@@ -1030,7 +621,6 @@ void Input::ProcessInput(InputManager* input)
             TCHAR c = *it;
             int width = GetDrawStringWidthToHandle(&c, 1, font_handle_);
             line_buffer += tstring(&c, 1);
-                       char_count++;
         #else
             unsigned char c = *it;
             TCHAR string[2] = { 0, 0 };
@@ -1069,7 +659,7 @@ void Input::ProcessInput(InputManager* input)
                     && cursor_moveto_x_ <= line_width + width
                     && static_cast<int>(lines_.size() + message_lines_.size()) * font_height_ <= cursor_moveto_y_
                     && cursor_moveto_y_ <= (static_cast<int>(lines_.size() + message_lines_.size()) + 1) * font_height_) {
-                SetKeyInputCursorPosition(char_count - 1, input_handle_);
+                SetKeyInputCursorPosition(prev_char_count, input_handle_);
                 cursor_moveto_x_ = -1;
                 cursor_moveto_y_ = -1;
             }
@@ -1126,7 +716,6 @@ void Input::ProcessInput(InputManager* input)
     if (active()) {
         input->CancelKeyCountAll();
     }
-
 }
 
 bool Input::active()
@@ -1226,51 +815,6 @@ void Input::set_on_enter(const CallbackFunc& func)
     on_enter_ = func;
 }
 
-tstring Input::selecting_text() const
-{
-               int select_start = 0,select_end = 0;
-               GetKeyInputSelectArea(&select_start,&select_end,input_handle_);
-               if( select_start > select_end )std::swap(select_start,select_end);
-               tstring selecting_text;
-
-               if( select_start > -1 && select_end != select_start ) {
-                       if ( multiline_ ) {
-                               BOOST_FOREACH(auto it,lines_){
-                                       TCHAR c[2] = {0};
-                                       if( select_start > it.size() && select_start != -1 ) {
-                                               select_start -= it.size();
-                                               select_end -= it.size();
-                                       }else{
-                                               for(int i = select_start;i < select_end; ++i){
-                                                       c[0] = it[i];
-                                                   selecting_text += c;
-                                               }
-                                               select_start = -1;
-                                       }
-                               }
-                       }else{
-                               BOOST_FOREACH(auto it,lines_){
-                                       TCHAR c[2] = {0};
-                                       for(int i = select_start;i < select_end; ++i){
-                                               c[0] = it[i];
-                                       selecting_text += c;
-                                       }
-                               }
-                       }
-               }
-               return selecting_text;
-}
-
-void Input::paste_text(tstring text)
-{
-       auto pos = GetKeyInputCursorPosition(input_handle_);
-       TCHAR String[TEXT_BUFFER_SIZE];
-    GetKeyInputString(String, input_handle_);
-    tstring dat(String, _tcslen(String));
-       dat.insert(pos,text);
-       SetKeyInputString(dat.c_str(), input_handle_);
-}
-
 bool Input::reverse_color() const
 {
     return reverse_color_;
@@ -1289,9 +833,4 @@ bool Input::multiline() const
 void Input::set_multiline(bool flag)
 {
     multiline_ = flag;
-}
-
-void Input::set_click_chancel_count(int count)
-{
-       click_cancel_count_ = count;
 }
\ No newline at end of file
index 709ba94..47ea084 100644 (file)
@@ -8,20 +8,16 @@
 #include <functional>
 #include "../ResourceManager.hpp"
 #include "../InputManager.hpp"
-#include "../ConfigManager.hpp"
-#include "include.hpp"
-#include <boost/enable_shared_from_this.hpp>
 
-class Input{
+class Input {
         typedef std::function<bool(const std::string&)> CallbackFunc;
 
     public:
-        Input(ConfigManagerPtr config_manager);
+        Input();
 
         void Draw();
         void Update();
         void ProcessInput(InputManager* input);
-               void Init();
 
         bool active();
         void set_active(bool flag);
@@ -49,11 +45,6 @@ class Input{
 
         void set_on_enter(const CallbackFunc& func);
 
-               tstring selecting_text() const;
-               void paste_text(tstring text);
-
-               void set_click_chancel_count(int count);
-
     public:    
         void CancelSelect();
 
@@ -82,22 +73,12 @@ class Input{
         std::vector<std::pair<int, int>> selecting_lines_;
         std::vector<std::pair<int, int>> clause_lines_;
         std::vector<std::pair<int, int>> selecting_clause_lines_;
-               std::pair<int, int> selecting_coursorpoint_;
-               bool drag_flag_;
 
         CallbackFunc on_enter_;
         tstring message_;
 
         bool reverse_color_;
         int blink_count_;
-               bool rightmenu_show_;
-               //std::pair<int, int> mouse_pos_;
-
-               UIList right_click_list_;
-
-               ConfigManagerPtr config_manager_;
-
-               int click_cancel_count_;
 
     private:
         const static size_t TEXT_BUFFER_SIZE;
index 3f70fce..b51cfee 100644 (file)
@@ -43,8 +43,7 @@ InputBox::InputBox(const ManagerAccessorPtr& manager_accessor) :
                 selecting_tab_index_(0),
                 manager_accessor_(manager_accessor),
                 card_(std::make_shared<Card>(manager_accessor_, "", "immo", "", "",
-                            std::vector<std::string>())),
-                               input_(manager_accessor->config_manager().lock())
+                            std::vector<std::string>()))
 
 {
        absolute_rect_ = Rect(100, 100, 800, 100);
@@ -103,7 +102,6 @@ InputBox::InputBox(const ManagerAccessorPtr& manager_accessor) :
 
         return true;
     });
-       input_.Init();
 }
 
 InputBox::~InputBox()
index 2bae79b..2aa8169 100644 (file)
@@ -9,7 +9,7 @@
 
 #define MMO_VERSION_MAJOR 0
 #define MMO_VERSION_MINOR 4
-#define MMO_VERSION_REVISION 0
+#define MMO_VERSION_REVISION 1
 
 #define MMO_PROTOCOL_VERSION 3