Beispiel #1
0
        /*-------------------------------------------------------------------------
         * 현재위치の그리기
         * ついでに拡縮率も描く
         * ---------------------------------------------------------------------------*/
        private void draw_gpos()
        {
            hittest ht   = m_windows[(int)window_index.position];
            Vector3 pos  = new Vector3(ht.rect.X, ht.rect.Y, 0.1f);
            Vector2 size = new Vector2(ht.rect.Width, ht.rect.Height);

            m_lib.device.DrawFillRect(pos, size, m_back_color.ToArgb());
            m_lib.device.DrawLineRect(pos, size, Color.Black.ToArgb());

            int pos_y = (int)pos.Y + 2 + 1;

            // 拡縮率 배율
            int scale = (int)Math.Round((double)m_lib.loop_image.ImageScale * 100);

            m_lib.device.systemfont.DrawTextR(String.Format("{0}%", scale),
                                              (int)pos.X + 75 + OFFSET_X, pos_y, Color.White);

            // 季節
            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 6, pos_y, 0.1f), m_lib.icons.GetIcon(icons.icon_index.string04));             // 지도
            pos_y += 14 - 1;
            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 6, pos_y, 0.1f), m_lib.icons.GetIcon(icons.icon_index.string03));             // 季節
            d3d_sprite_rects.rect _rect = m_lib.icons.GetIcon((m_db.GvoSeason.now_season == gvo_season.season.summer) ? icons.icon_index.string06 : icons.icon_index.string05);
            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 75 + OFFSET_X - 12, pos_y, 0.1f), _rect);

            // 본인の배の위치
            pos_y += 14 - 1;
            string my_pos = "--- , ---";
            Point  tmp_p  = game_pos_2_map_pos_for_debug(m_myship_info.pos);

            if (m_myship_info.is_analized_pos)
            {
                my_pos = String.Format("{0} , {1}", tmp_p.X, tmp_p.Y);
            }
            m_lib.device.systemfont.DrawTextR(my_pos,
                                              (int)pos.X + 75 + OFFSET_X, pos_y, Color.White);

            // 좌클릭した위치
            pos_y += 14 - 1;
            tmp_p  = game_pos_2_map_pos_for_debug(m_select_pos);
            m_lib.device.systemfont.DrawTextR(String.Format("{0} , {1}", tmp_p.X, tmp_p.Y),
                                              (int)pos.X + 75 + OFFSET_X, pos_y, Color.White);
            // 현재の마우스위치
            pos_y += 14 - 1;
            Point gpos = transform.client_pos2_game_pos(m_mouse_pos, m_lib.loop_image);

            tmp_p = game_pos_2_map_pos_for_debug(gpos);
            m_lib.device.systemfont.DrawTextR(String.Format("{0} , {1}", tmp_p.X, tmp_p.Y),
                                              (int)pos.X + 75 + OFFSET_X, pos_y, Color.White);
            {
                // 좌클릭した위치にクロスカーソルの표시
                // 지도좌표に변환
                Vector2 p = m_lib.loop_image.GlobalPos2LocalPos(transform.game_pos2_map_pos(transform.ToVector2(m_select_pos), m_lib.loop_image));
                // ループを考慮する
                p = m_lib.loop_image.AjustLocalPos(p);

                m_lib.device.sprites.AddDrawSpritesNC(new Vector3(p.X, p.Y, 0.3f),
                                                      m_lib.icons.GetIcon(icons.icon_index.select_cross));
            }
        }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     animator = GetComponent <Animator>();
     //animator.SetBool("hitbool", true);
     mainCube = GameObject.Find("Cube01");
     hittes   = mainCube.GetComponent <hittest>();
     //audioSource = GetComponent<AudioSource>();
 }
        /*-------------------------------------------------------------------------
         * 設定リストの背景
         * ---------------------------------------------------------------------------*/
        private void draw_seting_back()
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            Vector3 pos = new Vector3(base.client_pos.X, rect.Y, base.z);

            base.device.DrawFillRect(pos, new Vector2(base.client_size.X, rect.Height + 1), Color.FromArgb(255, 96, 96, 96).ToArgb());
        }
        /*-------------------------------------------------------------------------
         * 設定ボタン
         * ---------------------------------------------------------------------------*/
        private void draw_setting_button()
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting_button];
            Rectangle rect = ht.CalcRect();

            Vector3 pos = new Vector3(rect.X, rect.Y, base.z);

            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon(icons.icon_index.setting_button));
        }
Beispiel #5
0
                /*-------------------------------------------------------------------------
                 *
                 * ---------------------------------------------------------------------------*/
                public data(string name, Vector2 pos, Vector2 size, bool is_create_from_mask) : base()
                {
                    m_name = name;
                    m_pos  = pos;
                    m_size = size;
                    m_is_create_from_mask = is_create_from_mask;

                    m_hittest = new hittest(new Rectangle(0, 0, (int)size.X, (int)size.Y), transform.ToPoint(pos));
                }
        /*-------------------------------------------------------------------------
         * 設定
         * ---------------------------------------------------------------------------*/
        private void draw_setting()
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            Vector3 pos = new Vector3(rect.X, rect.Y, base.z);

            //
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.save_searoutes)
                                                                                        ? icons.icon_index.setting_0
                                                                                        : icons.icon_index.setting_gray_0));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_share_routes)
                                                                                        ? icons.icon_index.setting_1
                                                                                        : icons.icon_index.setting_gray_1));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_web_icons)
                                                                                        ? icons.icon_index.setting_8
                                                                                        : icons.icon_index.setting_gray_8));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_icons)
                                                                                        ? icons.icon_index.setting_2
                                                                                        : icons.icon_index.setting_gray_2));

            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_sea_routes)
                                                                                        ? icons.icon_index.setting_3
                                                                                        : icons.icon_index.setting_gray_3));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_popup_day_interval == 1)
                                                                                        ? icons.icon_index.setting_4
                                                                                        : (m_lib.setting.draw_popup_day_interval == 5)
                                                                                        ? icons.icon_index.setting_12
                                                                                        : icons.icon_index.setting_gray_4));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_accident)
                                                                                        ? icons.icon_index.setting_5
                                                                                        : icons.icon_index.setting_gray_5));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.center_myship)
                                                                                        ? icons.icon_index.setting_6
                                                                                        : icons.icon_index.setting_gray_6));
            pos.X += SETTING_ICONS_STEP;
            base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon((m_lib.setting.draw_myship_angle)
                                                                                        ? icons.icon_index.setting_7
                                                                                        : icons.icon_index.setting_gray_7));
            pos.X += SETTING_ICONS_STEP;

            // 残り3つはグレー表示なし
            for (int i = 0; i < 3; i++)
            {
                base.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon(icons.icon_index.setting_10 + i));
                pos.X += SETTING_ICONS_STEP;
            }
        }
        /*-------------------------------------------------------------------------
         * マウス左クリック
         * 設定項目
         * ---------------------------------------------------------------------------*/
        private void on_mouse_l_click_setting(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;
            pos.X /= SETTING_ICONS_STEP;

            setting_icons_index index = setting_icons_index.save_searoutes + pos.X;

            m_form.ExecFunction(get_extc_function(index));
        }
Beispiel #8
0
        /*-------------------------------------------------------------------------
         * 속도그리기
         * ついでに진행방향も그리기する
         * ---------------------------------------------------------------------------*/
        private void draw_speed()
        {
            hittest ht  = m_windows[(int)window_index.speed];
            Vector3 pos = new Vector3(ht.rect.X, ht.rect.Y, 0.3f);

            // 枠
            // 속도용
            m_lib.device.sprites.AddDrawSpritesNC(pos, m_lib.icons.GetIcon(icons.icon_index.speed_background));
            // 각도용
            Vector3 pos2 = pos;
            Vector3 pos3 = pos;

            pos3.Z += -0.1f;
            pos2.Y += 16 + 1;
            pos3.Y += 16 + 3;
            pos3.X += 33;
            m_lib.device.sprites.AddDrawSpritesNC(pos2, m_lib.icons.GetIcon(icons.icon_index.speed_background));
            m_lib.device.sprites.AddDrawSpritesNC(pos3, m_lib.icons.GetIcon(icons.icon_index.degree));
            pos2.Y += 16 + 1;
            pos3.Y += 16 + 1;
            m_lib.device.sprites.AddDrawSpritesNC(pos2, m_lib.icons.GetIcon(icons.icon_index.speed_background));
            m_lib.device.sprites.AddDrawSpritesNC(pos3, m_lib.icons.GetIcon(icons.icon_index.degree));

            // 각도정확도
            pos2.X += 1;
            pos2.Y += 1;
            pos2.Z -= 0.05f;
            m_lib.device.DrawFillRect(pos2, new Vector2(m_db.SpeedCalculator.angle_precision * (ht.rect.Width - 1 - 1), 13), Color.FromArgb(255, 160, 210, 255).ToArgb());
            //			m_lib.Device.DrawFillRect(pos2, new Vector2(0.5f * (ht.rect.Width-1-1), 13), Color.FromArgb(255, 160, 210, 255).ToArgb());

            int pos_x = (int)pos.X + ht.rect.Width - 2;

            // 속도
            m_lib.device.systemfont.DrawTextR(m_db.SpeedCalculator.speed_knot.ToString("0.00") + "Kt",
                                              pos_x, (int)pos.Y + 1 + 1, Color.Black);
            //			m_lib.Device.systemfont.DrawTextR(m_db.speed.speed_knot.ToString("0.00") + "Kt(" + m_db.speed.speed_map.ToString("0.00") + ")",
            //									pos_x, (int)pos.Y + 1+1, Color.Black);
            // 각도
            // 측량からの각도
            if (m_myship_info.angle >= 0)
            {
                m_lib.device.systemfont.DrawTextR(m_myship_info.angle.ToString("0.0"),
                                                  pos_x - 12, (int)pos.Y + 1 + 1 + 16 + 1, Color.Black);
            }
            // 나침반からの각도
            if (m_db.SpeedCalculator.angle >= 0)
            {
                m_lib.device.systemfont.DrawTextR(m_db.SpeedCalculator.angle.ToString("0.0"),
                                                  pos_x - 12, (int)pos.Y + 1 + 1 + 16 + 1 + 16 + 1, Color.Black);
            }
        }
        /*-------------------------------------------------------------------------
         * ツールチップ表示用の文字列を得る
         * 表示すべき文字列がない場合nullを返す
         * 設定ボタン
         * ---------------------------------------------------------------------------*/
        private string get_tooltip_string_setting_button(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting_button];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;

            if (pos.X < 16)
            {
                return("できるだけ検索ダイアログを開く" + get_assign_shortcut_text(KeyFunction.setting_window_button_12));
            }
            else
            {
                return("設定ダイアログを開く" + get_assign_shortcut_text(KeyFunction.setting_window_button_13));
            }
        }
Beispiel #10
0
        /*-------------------------------------------------------------------------
         * TCP서버
         * 윈도우
         * ---------------------------------------------------------------------------*/
        private void draw_tcp_server()
        {
            hittest ht = m_windows[(int)window_index.tcp_server];

            if (!ht.enable)
            {
                return;                          // 유효ではない
            }
            Vector3 pos  = new Vector3(ht.rect.X, ht.rect.Y, 0.1f);
            Vector2 size = new Vector2(ht.rect.Width, ht.rect.Height);

            m_lib.device.DrawFillRect(pos, size, m_back_color.ToArgb());
            m_lib.device.DrawLineRect(pos, size, Color.Black.ToArgb());

            m_lib.device.systemfont.DrawText("TCP SERVER",
                                             (int)pos.X + 3, (int)pos.Y + 3, Color.White);
        }
Beispiel #11
0
        /*-------------------------------------------------------------------------
         * 항로공유
         * 윈도우
         * ---------------------------------------------------------------------------*/
        private void draw_share()
        {
            hittest ht = m_windows[(int)window_index.share];

            if (!ht.enable)
            {
                return;                          // 유효ではない
            }
            Vector3 pos  = new Vector3(ht.rect.X, ht.rect.Y, 0.1f);
            Vector2 size = new Vector2(ht.rect.Width, ht.rect.Height);

            m_lib.device.DrawFillRect(pos, size, m_back_color.ToArgb());
            m_lib.device.DrawLineRect(pos, size, Color.Black.ToArgb());

            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 6, pos.Y + 3, 0.1f), m_lib.icons.GetIcon(icons.icon_index.string01));
            m_lib.device.systemfont.DrawTextR(String.Format("{0}", m_db.ShareRoutes.ShareList.Count),
                                              (int)pos.X + 75 + OFFSET_X, (int)pos.Y + 3, Color.White);
        }
        /*-------------------------------------------------------------------------
         * 設定ボタン
         * ---------------------------------------------------------------------------*/
        private void on_mouse_l_click_setting_button(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting_button];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;

            if (pos.X < 16)
            {
                // 検索
                m_form.ExecFunction(KeyFunction.setting_window_button_12);
            }
            else
            {
                // 設定
                m_form.ExecFunction(KeyFunction.setting_window_button_13);
            }
        }
        /*-------------------------------------------------------------------------
         * 現在のマウスがある場所の設定
         * ---------------------------------------------------------------------------*/
        private void draw_current_setting_back()
        {
            Point pos = base.device.GetClientMousePosition();

            hittest ht = m_hittest_list[(int)item_index.setting];

            if (!ht.HitTest(pos))
            {
                return;
            }
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;
            pos.X /= SETTING_ICONS_STEP;

            base.DrawCurrentButtonBack(new Vector3(rect.X + SETTING_ICONS_STEP * pos.X, rect.Y, base.z),
                                       new Vector2(def.ICON_SIZE_X, def.ICON_SIZE_Y));
        }
Beispiel #14
0
        /*-------------------------------------------------------------------------
         * 造船からの経過日数
         * ウインドウ
         * ---------------------------------------------------------------------------*/
        private void draw_build_ship()
        {
            hittest ht = m_windows[(int)window_index.build_ship];

            if (!ht.enable)
            {
                return;                                         // 有効ではない
            }
            Vector3 pos  = new Vector3(ht.rect.X, ht.rect.Y, 0.1f);
            Vector2 size = new Vector2(ht.rect.Width, ht.rect.Height);

            m_lib.device.DrawFillRect(pos, size, m_back_color.ToArgb());
            m_lib.device.DrawLineRect(pos, size, Color.Black.ToArgb());

            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 6, pos.Y + 3, 0.1f), m_lib.icons.GetIcon(icons.icon_index.string07));
            m_lib.device.sprites.AddDrawSpritesNC(new Vector3(pos.X + 6 + 75 + OFFSET_X - 13, pos.Y + 3, 0.1f), m_lib.icons.GetIcon(icons.icon_index.string00));
            m_lib.device.systemfont.DrawTextR(String.Format("{0}", m_db.BuildShipCounter.GetDays()),
                                              (int)pos.X + 75 + OFFSET_X - 8, (int)pos.Y + 3, Color.White);
        }
        /*-------------------------------------------------------------------------
         * ツールチップ表示用の文字列を得る
         * 表示すべき文字列がない場合nullを返す
         * 設定アイコン
         * ---------------------------------------------------------------------------*/
        private string get_tooltip_string_setting(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;
            pos.X /= SETTING_ICONS_STEP;

            setting_icons_index index = setting_icons_index.save_searoutes + pos.X;
            string tip;

            switch (index)
            {
            case setting_icons_index.save_searoutes:                tip = "航路記録(要測量)"; break;

            case setting_icons_index.share_routes:                  tip = "共有している船表示(要設定)"; break;

            case setting_icons_index.web_icons:                             tip = "@Webアイコン表示\n右クリックで表示項目設定"; break;

            case setting_icons_index.memo_icons:                    tip = "メモアイコン表示\n右クリックで表示項目設定"; break;

            case setting_icons_index.searoutes:                             tip = "航路線表示"; break;

            case setting_icons_index.popup_day_interval:    tip = "ふきだし表示"; break;

            case setting_icons_index.accident:                              tip = "災害表示\n右クリックで表示項目設定"; break;

            case setting_icons_index.center_my_ship:                tip = "現在位置中心表示"; break;

            case setting_icons_index.myship_angle:                  tip = "コンパスの角度線、進路予想線表示\n右クリックで表示項目設定"; break;

            case setting_icons_index.sea_area:                              tip = "危険海域変動システムの設定"; break;

            case setting_icons_index.screen_shot:                   tip = "航路のスクリーンショット保存"; break;

            case setting_icons_index.show_searoutes_list:   tip = "航路図一覧\n右クリックで航路図設定"; break;

            default:
                return(null);
            }
            return(tip + get_assign_shortcut_text(get_extc_function(index)));
        }
Beispiel #16
0
        /*-------------------------------------------------------------------------
         * ツールチップ표시용の문자열を得る
         * 표시すべき문자열がない場合nullを返す
         * 설정아이콘
         * ---------------------------------------------------------------------------*/
        private string get_tooltip_string_setting(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;
            pos.X /= SETTING_ICONS_STEP;

            setting_icons_index index = setting_icons_index.save_searoutes + pos.X;
            string tip;

            switch (index)
            {
            case setting_icons_index.save_searoutes: tip = "항로기록(예측량)"; break;

            case setting_icons_index.share_routes: tip = "공유하고 있는 선박표시(설정 필요)"; break;

            case setting_icons_index.web_icons: tip = "@Web아이콘 표시\n우클릭으로 표시항목 설정"; break;

            case setting_icons_index.memo_icons: tip = "메모아이콘 표시\n우클릭으로 표시항목 설정"; break;

            case setting_icons_index.searoutes: tip = "항로선표시"; break;

            case setting_icons_index.popup_day_interval: tip = "말풍선표시"; break;

            case setting_icons_index.accident: tip = "재해표시\n우클릭으로 표시항목설정"; break;

            case setting_icons_index.center_my_ship: tip = "현재위치 중심으로 표시"; break;

            case setting_icons_index.myship_angle: tip = "나침반의 각도선, 진로예상선표시\n우클릭으로 표시항목 설정"; break;

            case setting_icons_index.sea_area: tip = "위험해역변동시스템설정"; break;

            case setting_icons_index.screen_shot: tip = "항로의 스크린샷보존"; break;

            case setting_icons_index.show_searoutes_list: tip = "항로도목록\n우클릭으로 항로도 설정"; break;

            default:
                return(null);
            }
            return(tip + get_assign_shortcut_text(get_extc_function(index)));
        }
Beispiel #17
0
        /*-------------------------------------------------------------------------
         * 更新
         * 主にウインドウ位置
         * ---------------------------------------------------------------------------*/
        public void Update(Point select_pos, Point mouse_pos)
        {
            // 表示用情報
            m_select_pos = select_pos;
            m_mouse_pos  = mouse_pos;

            Size rect = new Size((int)m_lib.device.client_size.X, (int)m_lib.device.client_size.Y);

            // 速度ウインドウ
            {
                hittest ht   = m_windows[(int)window_index.speed];
                Size    size = new Size(43 + 4, (16 + 1) * 3);
                ht.rect = new Rectangle(rect.Width - size.Width - 3, 3, size.Width, size.Height);
            }

            // 位置ウインドウ
            {
                hittest ht   = m_windows[(int)window_index.position];
                Size    size = new Size(78, 14 * (4 + 1) + 2);
                ht.rect = new Rectangle(rect.Width - size.Width, rect.Height - size.Height, size.Width, size.Height);
            }

            // 航路共有ウインドウ
            {
                hittest ht = m_windows[(int)window_index.share];

                // 状態によっては非表示になる
                ht.enable = true;
#if !DEBUG_SHARE_ROUTES
                if (!m_lib.setting.enable_share_routes)
                {
                    ht.enable = false;
                }
#endif
                Size      size  = new Size(78, 14 + 2);
                Rectangle prect = m_windows[(int)window_index.position].rect;
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // 利息からの経過日数ウインドウ
            {
                hittest ht = m_windows[(int)window_index.interest];

                // 状態によっては非表示になる
                ht.enable = true;
                if (!m_lib.setting.enable_analize_log_chat)
                {
                    ht.enable = false;
                }
                if (!m_lib.setting.save_searoutes)
                {
                    ht.enable = false;
                }
                // サーバモード時は有効
                if (m_lib.setting.is_server_mode)
                {
                    ht.enable = true;
                }

                Size      size  = new Size(78, 14 * 1 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.interest);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // 造船からの経過日数
            {
                hittest ht = m_windows[(int)window_index.build_ship];

                // 状態によっては非表示になる
                ht.enable = true;
                if (!m_lib.setting.enable_analize_log_chat)
                {
                    ht.enable = false;
                }
                if (!m_lib.setting.save_searoutes)
                {
                    ht.enable = false;
                }
                // サーバモード時は有効
                if (m_lib.setting.is_server_mode)
                {
                    ht.enable = true;
                }
                if (!m_lib.setting.force_show_build_ship)
                {
                    // 造船中でないときは非表示
                    ht.enable = m_db.BuildShipCounter.IsNowBuild;
                }

                Size      size  = new Size(78, 14 * 1 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.build_ship);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // TCPサーバ
            {
                hittest ht = m_windows[(int)window_index.tcp_server];

                // 状態によっては非表示になる
                ht.enable = true;
                if (!m_lib.setting.is_server_mode)
                {
                    ht.enable = false;
                }

                Size      size  = new Size(78, 14 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.tcp_server);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }
        }
        /*-------------------------------------------------------------------------
         * マウス右クリック
         * 設定項目
         * ---------------------------------------------------------------------------*/
        private void on_mouse_r_click_setting(Point pos)
        {
            hittest   ht   = m_hittest_list[(int)item_index.setting];
            Rectangle rect = ht.CalcRect();

            pos.X -= rect.X;
            pos.X /= SETTING_ICONS_STEP;

            setting_icons_index index = setting_icons_index.save_searoutes + pos.X;

            switch (index)
            {
            case setting_icons_index.save_searoutes:
                break;

            case setting_icons_index.share_routes:
                break;

            case setting_icons_index.searoutes:
                break;

            case setting_icons_index.popup_day_interval:
                break;

            case setting_icons_index.center_my_ship:
                break;

            case setting_icons_index.sea_area:
                break;

            case setting_icons_index.screen_shot:
                break;

            case setting_icons_index.web_icons:
                set_draw_setting(DrawSettingPage.WebIcons);
                break;

            case setting_icons_index.memo_icons:
                set_draw_setting(DrawSettingPage.MemoIcons);
                break;

            case setting_icons_index.accident:
                set_draw_setting(DrawSettingPage.Accidents);
                break;

            case setting_icons_index.myship_angle:
                set_draw_setting(DrawSettingPage.MyShipAngle);
                break;

            case setting_icons_index.show_searoutes_list:
            {
                string info = m_lib.device.deviec_info_string;
                using (setting_form2 dlg = new setting_form2(m_lib.setting, m_lib.KeyAssignManager.List, info, setting_form2.tab_index.sea_routes)){
                    if (dlg.ShowDialog(base.device.form) == DialogResult.OK)
                    {
                        // 設定項目を反映させる
                        m_form.UpdateSettings(dlg);
                    }
                }
            }
            break;
            }
        }
Beispiel #19
0
        /*-------------------------------------------------------------------------
         * 업데이트
         * 主に윈도우위치
         * ---------------------------------------------------------------------------*/
        public void Update(Point select_pos, Point mouse_pos)
        {
            // 표시용정보
            m_select_pos = select_pos;
            m_mouse_pos  = mouse_pos;

            Size rect = new Size((int)m_lib.device.client_size.X, (int)m_lib.device.client_size.Y);

            // 속도윈도우
            {
                hittest ht   = m_windows[(int)window_index.speed];
                Size    size = new Size(43 + 4, (16 + 1) * 3);
                ht.rect = new Rectangle(rect.Width - size.Width - 3, 3, size.Width, size.Height);
            }

            // 위치윈도우
            {
                hittest ht   = m_windows[(int)window_index.position];
                Size    size = new Size(78, 14 * (4 + 1) + 2);
                ht.rect = new Rectangle(rect.Width - size.Width, rect.Height - size.Height, size.Width, size.Height);
            }

            // 항로공유윈도우
            {
                hittest ht = m_windows[(int)window_index.share];

                // 상태によっては비표시になる
                ht.enable = true;
#if !DEBUG_SHARE_ROUTES
                if (!m_lib.setting.enable_share_routes)
                {
                    ht.enable = false;
                }
#endif
                Size      size  = new Size(78, 14 + 2);
                Rectangle prect = m_windows[(int)window_index.position].rect;
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // 이자からの경과일수윈도우
            {
                hittest ht = m_windows[(int)window_index.interest];

                // 상태によっては비표시になる
                ht.enable = true;
                if (!m_lib.setting.enable_analize_log_chat)
                {
                    ht.enable = false;
                }
                if (!m_lib.setting.save_searoutes)
                {
                    ht.enable = false;
                }
                // 서버모드時は유효
                if (m_lib.setting.is_server_mode)
                {
                    ht.enable = true;
                }

                Size      size  = new Size(78, 14 * 1 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.interest);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // 조선からの경과일수
            {
                hittest ht = m_windows[(int)window_index.build_ship];

                // 상태によっては비표시になる
                ht.enable = true;
                if (!m_lib.setting.enable_analize_log_chat)
                {
                    ht.enable = false;
                }
                if (!m_lib.setting.save_searoutes)
                {
                    ht.enable = false;
                }
                // 서버모드時は유효
                if (m_lib.setting.is_server_mode)
                {
                    ht.enable = true;
                }
                if (!m_lib.setting.force_show_build_ship)
                {
                    // 조선중でないときは비표시
                    ht.enable = m_db.BuildShipCounter.IsNowBuild;
                }

                Size      size  = new Size(78, 14 * 1 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.build_ship);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }

            // TCP서버
            {
                hittest ht = m_windows[(int)window_index.tcp_server];

                // 상태によっては비표시になる
                ht.enable = true;
                if (!m_lib.setting.is_server_mode)
                {
                    ht.enable = false;
                }

                Size      size  = new Size(78, 14 + 2);
                Rectangle prect = get_parent_window_rect((int)window_index.tcp_server);
                ht.rect = new Rectangle(rect.Width - size.Width, prect.Y - size.Height - 3, size.Width, size.Height);
            }
        }