public FrmSOSortMap() { InitializeComponent(); Dictionary <string, object> settings = GlobeSettings.SystemSettings; if (settings.ContainsKey("地图类型")) { this._mapType = (EMapType)ConvertUtil.ToInt(settings["地图类型"]); } }
public void Switch(EMapType type) { this.curMapType = type; if (this._ownerForm != null) { GameObject widget = this._ownerForm.GetWidget(0x2d); if (widget != null) { if (this.curMapType == EMapType.Mini) { if (this.mmRoot != null) { CUICommonSystem.SetObjActive(this.mmRoot, true); } if (this.bmRoot != null) { CUICommonSystem.SetObjActive(this.bmRoot, false); } if (widget != null) { widget.CustomSetActive(true); } } else if (this.curMapType == EMapType.Big) { if (this.mmRoot != null) { CUICommonSystem.SetObjActive(this.mmRoot, false); } if (this.bmRoot != null) { CUICommonSystem.SetObjActive(this.bmRoot, true); } if (widget != null) { widget.CustomSetActive(false); } } else { if (this.mmRoot != null) { this.mmRoot.CustomSetActive(false); } if (this.bmRoot != null) { this.bmRoot.CustomSetActive(false); } } } } }
internal void UpdateTime(EMapType p_mapType, ETimeChangeReason p_reason) { switch (p_mapType) { case EMapType.OUTDOOR: UpdateTime(ConfigManager.Instance.Game.MinutesPerTurnOutdoor, p_reason); break; case EMapType.CITY: UpdateTime(ConfigManager.Instance.Game.MinutesPerTurnCity, p_reason); break; case EMapType.DUNGEON: UpdateTime(ConfigManager.Instance.Game.MinutesPerTurnDungeon, p_reason); break; default: throw new NotImplementedException("GameTime: unknow maptype " + p_mapType); } }
public Grid(Int32 p_width, Int32 p_height, EMapType p_mapType) { Width = p_width; Height = p_height; Type = p_mapType; ETerrainType defaultTerrain = GetDefaultTerrain(Type); m_slots = new GridSlot[Height][]; for (Int32 i = 0; i < Height; i++) { m_slots[i] = new GridSlot[Width]; for (Int32 j = 0; j < Width; j++) { GridSlot gridSlot = new GridSlot(); gridSlot.Position = new Position(j, i); gridSlot.TerrainType = defaultTerrain; gridSlot.InitTransitionTypes(); m_slots[i][j] = gridSlot; } } InitConnections(); }
public void Switch(EMapType type) { if (type != EMapType.None) { this.curMapType = type; GameObject widget = this.m_FormScript.GetWidget(0x2d); if (this.curMapType == EMapType.Mini) { if (this.miniMap_obj != null) { this.miniMap_obj.CustomSetActive(true); } if (this.bigMap_obj != null) { this.bigMap_obj.CustomSetActive(false); } if (widget != null) { widget.CustomSetActive(true); } } else { if (this.miniMap_obj != null) { this.miniMap_obj.CustomSetActive(false); } if (this.bigMap_obj != null) { this.bigMap_obj.CustomSetActive(true); } if (widget != null) { widget.CustomSetActive(false); } } } }
public FrmLoadingSortMap() { InitializeComponent(); Dictionary <string, object> settings = GlobeSettings.SystemSettings; if (settings.ContainsKey("地图类型")) { this._mapType = (EMapType)ConvertUtil.ToInt(settings["地图类型"]); } //整货仓使用新的地图功能,混合仓使用原来的地图功能; if (GlobeSettings.LoginedUser.WarehouseType == EWarehouseType.整货仓) { IsOldMap = false; } else { IsOldMap = true; } this.lineWay.Visible = !IsOldMap; //是否隐藏控件,新地图不需要隐藏 this.clearLine.Visible = !IsOldMap; //是否隐藏控件,新地图不需要隐藏 if (!IsOldMap) { HTML_URL_ADDRESS = "http://wms.api.huimin100.cn:8080/wmsCloud/baiduMap/orderMap"; } else { HTML_URL_ADDRESS = "http://upd.huimin.cn/OrderMap/Index"; } this.RefreshWeb(); this._webIsCompleted = false; }
///<summary>获取预定义的颜色</summary> public Color getColor(EMapType mtype, ECObjectType otype, string ctype, string cstatus) { Color color = Colors.Black; //if (string.IsNullOrWhiteSpace(ctype) || string.IsNullOrWhiteSpace(cstatus)) return color; SerializableDictionary <string, Color> dic; ECMapBackground enummap; if (mtype == EMapType.卫星 || mtype == EMapType.无) { enummap = ECMapBackground.卫星和无底图; } else { enummap = ECMapBackground.道路和地形; } if (colors.cs[enummap][otype].TryGetValue(ctype, out dic)) { dic.TryGetValue(cstatus, out color); } return(color); }
public void Init(CUIFormScript formObj, SLevelContext levelContext) { if (formObj != null) { this._ownerForm = formObj; this.mmRoot = Utility.FindChild(formObj.gameObject, "MapPanel/Mini"); this.bmRoot = Utility.FindChild(formObj.gameObject, "MapPanel/Big"); if ((this.mmRoot != null) && (this.bmRoot != null)) { if (!levelContext.IsMobaMode()) { this.mmRoot.SetActive(false); this.bmRoot.SetActive(false); } else if (levelContext != null) { this.regEvent(); this.mmpcAlies = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Alies"); this.mmpcHero = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Hero"); this.mmpcEnemy = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Enemy"); this.mmpcOrgan = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Organ"); this.mmpcSignal = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Signal"); this.mmpcDragon = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Dragon"); this.mmpcEffect = Utility.FindChild(this.mmRoot, "BigMapEffectRoot"); this.mmpcEye = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Eye"); this.bmpcAlies = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Alies"); this.bmpcHero = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Hero"); this.bmpcEnemy = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Enemy"); this.bmpcOrgan = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Organ"); this.bmpcSignal = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Signal"); this.bmpcDragon = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Dragon"); this.mmpcEffect = Utility.FindChild(this.bmRoot, "BigMapEffectRoot"); this.bmpcEye = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Eye"); this.mmRoot.CustomSetActive(true); this.bmRoot.CustomSetActive(true); RectTransform transform = null; if (levelContext.IsMobaMode()) { float num; this.Switch(EMapType.Mini); transform = this.initMap(this.bmRoot, levelContext, false, out num); transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f); transform = this.initMap(this.mmRoot, levelContext, true, out num); if (levelContext.m_pvpPlayerNum == 6) { transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y); GameObject obj2 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/DragonInfo"); GameObject obj3 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/Button_Signal_1"); if (obj2 != null) { RectTransform transform2 = obj2.gameObject.transform as RectTransform; transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y); } if (obj3 != null) { RectTransform transform3 = obj3.gameObject.transform as RectTransform; transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y); } } } else { this.Switch(EMapType.None); } this.curMapType = EMapType.Mini; bool flag = false; bool flag2 = false; if (levelContext.m_pveLevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE) { switch (levelContext.m_mapID) { case 2: flag = true; flag2 = false; break; case 3: case 6: case 7: flag = true; flag2 = true; break; } } else if ((levelContext.m_pvpPlayerNum == 6) || (levelContext.m_pvpPlayerNum == 10)) { flag = true; flag2 = levelContext.m_pvpPlayerNum == 10; } if (flag && (this.mmpcDragon != null)) { this.m_dragonIcon = new DragonIcon(); this.m_dragonIcon.Init(this.mmpcDragon, this.bmpcDragon, flag2); } GameObject gameObject = this.mmRoot.transform.Find("CameraFrame").gameObject; if (gameObject != null) { this.m_miniMapCameraFrame = new MiniMapCameraFrame(gameObject, transform.sizeDelta.x, transform.sizeDelta.y); this.m_miniMapCameraFrame.SetFrameSize((CameraHeightType)GameSettings.CameraHeight); } } } } }
/// <summary> /// 增加地图标识 /// </summary> /// <param name="_type">标识类型</param> /// <param name="_name">名称</param> /// <param name="_status">状态</param> /// <param name="_node">地图标识所对应的设备树节点</param> /// <param name="_pt">标识物所处位置</param> public void AddObject(EMapType _type, string _name, WatchStatue _status, TreeNode _node,Point _pt) { EMapObject obj = new EMapObject(); //linwei 2008-5-28 //初始化右键菜单 ObjectProperty _property = new ObjectProperty(); _property.Type = _type; _property.Name = _name; _property.Status = _status; _property.ParentSN = MapIndex; obj.Property = _property; obj.Node = _node; Map.AddObject(obj); obj.Location = _pt; obj.Property.X = _pt.X; obj.Property.Y = _pt.Y; if (_type == EMapType.ChildMap) { obj.Property.IsArea = true; } obj.LoadPropertyEvnet +=new EventHandler<EventArgs>(obj_LoadPropertyEvnet); obj.NextLevelEvent+=new EventHandler<EventArgs>(obj_NextLevelEvent); obj.WatchEvent += new EventHandler<WatchEvnetArgs>(obj_WatchEvent); InitObjectEvent(obj); objlist.Add(obj); Select(obj); GetTip(obj); m_IsSaved = false; }
public void Init(CUIFormScript formObj, ResDT_LevelCommonInfo pvp_level_cfg, SLevelContext levelContext) { if (((formObj != null) && (pvp_level_cfg != null)) && (levelContext != null)) { this.regEvent(); RectTransform transform = null; this.m_FormScript = formObj; this.miniMap_obj = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap"); this.bigMap_obj = Utility.FindChild(formObj.gameObject, "panelTopLeft/BigMap"); DebugHelper.Assert(this.miniMap_obj != null, "---MinimapSys miniMap_obj == null, check out..."); DebugHelper.Assert(this.bigMap_obj != null, "---MinimapSys bigMap_obj == null, check out..."); if ((this.miniMap_obj != null) && (this.bigMap_obj != null)) { this.miniMap_obj.CustomSetActive(true); this.bigMap_obj.CustomSetActive(false); this._init_view(this.miniMap_obj, this.bigMap_obj); Image component = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap").GetComponent <Image>(); DebugHelper.Assert(component != null, "---MinimapSys miniMapImage == null, check out..."); if (component != null) { if (levelContext.isPVPMode) { float num; transform = this.initMap(enBattleFormWidget.Bigmap, levelContext, false, out num); transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f); transform = this.initMap(enBattleFormWidget.Minimap, levelContext, true, out num); if ((pvp_level_cfg != null) && (pvp_level_cfg.bMaxAcntNum == 6)) { transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y); GameObject obj2 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/DragonInfo"); GameObject obj3 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/Button_Signal_1"); DebugHelper.Assert(obj2 != null, "---MinimapSys dragon_info == null, check out..."); DebugHelper.Assert(obj3 != null, "---MinimapSys button_signal_1 == null, check out..."); if (obj2 != null) { RectTransform transform2 = obj2.gameObject.transform as RectTransform; transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y); } if (obj3 != null) { RectTransform transform3 = obj3.gameObject.transform as RectTransform; transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y); } } } else { component.gameObject.CustomSetActive(false); } this.curMapType = EMapType.Mini; bool flag = false; bool flag2 = false; if (levelContext.LevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE) { switch (levelContext.iLevelID) { case 2: flag = true; flag2 = false; break; case 3: case 6: case 7: flag = true; flag2 = true; break; } } else if ((pvp_level_cfg != null) && ((pvp_level_cfg.bMaxAcntNum == 6) || (pvp_level_cfg.bMaxAcntNum == 10))) { flag = true; flag2 = pvp_level_cfg.bMaxAcntNum == 10; } if (flag) { GameObject node = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/MiniMap/Container_MiniMapPointer_Dragon"); DebugHelper.Assert(node != null, "---MinimapSys dragonicons == null, check out..."); if (node != null) { this.m_dragonIcon = new DragonIcon(); this.m_dragonIcon.Init(node, Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/BigMap/Container_BigMapPointer_Dragon"), flag2); } } } } } }