示例#1
0
        private void draw_namerects(Vector2 offset, LoopXImage image, hittest_list list)
        {
            foreach (GvoWorldInfo.Info i in list)
            {
                if (i.NameRect == null)
                {
                    continue;
                }

                Vector2 p = image.GlobalPos2LocalPos(transform.ToVector2(i.position), offset);

                if (m_lib.setting.map_icon == MapIcon.Big)
                {
                    // 대 아이콘
                    p.X += i.StringOffset1.X;
                    p.Y += i.StringOffset1.Y;
                }
                else
                {
                    // 소 아이콘
                    p.X += i.StringOffset2.X;
                    p.Y += i.StringOffset2.Y;
                }

                m_lib.device.sprites.AddDrawSpritesNC(new Vector3(p.X, p.Y, 0.3f), i.NameRect, i.angle, -1);
            }
        }
示例#2
0
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public map_mark(gvt_lib lib, string fname)
        {
            m_lib   = lib;
            m_datas = new hittest_list();

            // 읽기
            load(fname);
        }
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public setting_window(gvt_lib lib, GvoDatabase db, gvtrademap_cs_form form)
            : base(lib.device, new Vector2(WINDOW_POS_X, WINDOW_POS_Y), new Vector2(WINDOW_SIZE_X, WINDOW_SIZE_Y), WINDOW_POS_Z)
        {
            base.title = "設定ウインドウ";

            m_form = form;
            m_lib  = lib;
            m_db   = db;

            // アイテム追加
            m_hittest_list = new hittest_list();

            // 設定
            m_hittest_list.Add(new hittest());
            // 設定ボタン
            m_hittest_list.Add(new hittest());
        }
示例#4
0
        private void draw_iconrects(Vector2 offset, LoopXImage image, hittest_list list)
        {
            foreach (GvoWorldInfo.Info i in list)
            {
                Vector2 p = image.GlobalPos2LocalPos(transform.ToVector2(i.position), offset);

                d3d_sprite_rects.rect refRect;
                if (m_lib.setting.map_icon == MapIcon.Big)
                {
                    // 대 아이콘
                    refRect = i.IconRect;
                }
                else
                {
                    refRect = i.SmallIconRect;
                }

                if (refRect != null)
                {
                    m_lib.device.sprites.AddDrawSprites(new Vector3(p.X, p.Y, 0.3f), refRect);
                }
            }
        }
示例#5
0
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/

        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public info_windows(gvt_lib lib, GvoDatabase db, myship_info myship)
        {
            m_lib         = lib;
            m_db          = db;
            m_myship_info = myship;

            m_select_pos = new Point(0, 0);
            m_mouse_pos  = new Point(0, 0);

            m_windows = new hittest_list();

            // 속도윈도우
            m_windows.Add(new hittest());
            // 위치윈도우
            m_windows.Add(new hittest());
            // 항로공유윈도우
            m_windows.Add(new hittest());
            // 이자からの경과일수윈도우
            m_windows.Add(new hittest());
            // 조선からの경과일수윈도우
            m_windows.Add(new hittest());
            // TCP서버
            m_windows.Add(new hittest());
        }
示例#6
0
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/

        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public info_windows(gvt_lib lib, GvoDatabase db, myship_info myship)
        {
            m_lib         = lib;
            m_db          = db;
            m_myship_info = myship;

            m_select_pos = new Point(0, 0);
            m_mouse_pos  = new Point(0, 0);

            m_windows = new hittest_list();

            // 速度ウインドウ
            m_windows.Add(new hittest());
            // 位置ウインドウ
            m_windows.Add(new hittest());
            // 航路共有ウインドウ
            m_windows.Add(new hittest());
            // 利息からの経過日数ウインドウ
            m_windows.Add(new hittest());
            // 造船からの経過日数ウインドウ
            m_windows.Add(new hittest());
            // TCPサーバ
            m_windows.Add(new hittest());
        }
示例#7
0
        private void drawWorlds(ref int index, ref int xIndex, ref int yIndex, ref int xPos, ref int yPos, hittest_list list)
        {
            foreach (GvoWorldInfo.Info i in list)
            {
                String name = i.Name;
                if (i.InfoType == GvoWorldInfo.InfoType.GuildCity && i.CityInfo != null && i.CityInfo.HasNameImage == false)
                {
                    continue;
                }
                else if (i.InfoType == GvoWorldInfo.InfoType.GuildCity && i.CityInfo != null)
                {
                    name = i.Name.Substring(0, i.Name.Length - 1);
                }

                Rectangle rect = m_font.MeasureString(m_sprite, name, DrawTextFormat.Left, Color.White);

                xPos = (xIndex) * MAX_NAME_WIDTH + 1;
                yPos = (yIndex) * 16 + 1;

                Color color = Color.Black;
                if (i.InfoType == GvoWorldInfo.InfoType.Sea)
                {
                    color = Color.RoyalBlue;
                }
                else if (i.InfoType == GvoWorldInfo.InfoType.Shore)
                {
                    color = Color.SeaGreen;
                }
                else if (i.InfoType == GvoWorldInfo.InfoType.Shore2)
                {
                    color = Color.Navy;
                }
                else if (i.InfoType == GvoWorldInfo.InfoType.OutsideCity)
                {
                    color = Color.Chocolate;
                }
                else if (i.InfoType == GvoWorldInfo.InfoType.PF)
                {
                    color = Color.SaddleBrown;
                }

                m_font.DrawText(null, name, xPos - 1, yPos - 1, Color.FromArgb(190, Color.White));
                m_font.DrawText(null, name, xPos - 1, yPos + 1, Color.FromArgb(190, Color.White));
                m_font.DrawText(null, name, xPos + 1, yPos - 1, Color.FromArgb(190, Color.White));
                m_font.DrawText(null, name, xPos + 1, yPos + 1, Color.FromArgb(190, Color.White));
                m_font.DrawText(null, name, xPos - 1, yPos, Color.FromArgb(230, Color.White));
                m_font.DrawText(null, name, xPos + 1, yPos, Color.FromArgb(230, Color.White));
                m_font.DrawText(null, name, xPos, yPos - 1, Color.FromArgb(230, Color.White));
                m_font.DrawText(null, name, xPos, yPos + 1, Color.FromArgb(230, Color.White));
                m_font.DrawText(null, name, xPos + 0, yPos + 0, color);

                rect.X = xPos - 1;
                rect.Y = yPos - 1;

                rect.Width  += 3;
                rect.Height += 2;

                Vector2 leftTop = new Vector2(rect.X, rect.Y);
                Vector2 size    = new Vector2(rect.Width, rect.Height);

                if (i.NameRect != null)
                {
                    if (m_nameRect.ContainsKey(i.Name))
                    {
                        //i.NameRect = new d3d_sprite_rects.rect(m_textureSize, m_offset, rect);
                        //m_nameRect.Remove(i.Name);
                        //m_nameRect.Add(i.Name, i.NameRect);
                    }
                    else
                    {
                        i.NameRect = new d3d_sprite_rects.rect(m_textureSize, m_offset, rect);
                        m_nameRect.Add(i.Name, i.NameRect);
                    }
                }
                else
                {
                    i.NameRect = new d3d_sprite_rects.rect(m_textureSize, m_offset, rect);
                    m_nameRect.Add(i.Name, i.NameRect);
                }

                yIndex++;
                if (yIndex >= MAX_NAME_LINE)
                {
                    xIndex++;
                    yIndex = 0;
                }
                index++;
            }
        }