private static new StageInfo Create() { StageInfo result = PanelWithChildren.Create <StageInfo> (); result.gameObject.name = "panel_StageInfo"; RectTransform rt = result.gameObject.transform as RectTransform; rt.offsetMin = new Vector2(6, 0); rt.offsetMax = new Vector2(8, 6); result.items = new List <GameObject> (); result.LiScore = CreateScore(); result.items.Add(result.LiScore.gameObject); result.LiHitPoints = CreateHitPoints(); result.items.Add(result.LiHitPoints.gameObject); result.buffCaption = CreateBuffCaption(); result.items.Add(result.buffCaption.gameObject); result.buffZone = BuffZone.Create(); result.items.Add(result.buffZone.gameObject); result.alignDirection = Aligner.AlignDirection.adTop; result.SetAligner_Pivot(); result.Rebuild(); return(result); }
public static new BuffZone Create() { BuffZone result = PanelWithChildren.Create <BuffZone> (); RectTransform rt = result.gameObject.transform as RectTransform; rt.offsetMax = rt.offsetMin + selfSize; result.SetAligner_FixedTile(itemSize); result.alignDirection = Aligner.AlignDirection.adTop; return(result); }
public void LoadMisc(WzImage mapImage, Board mapBoard) { // All of the following properties are extremely esoteric features that only appear in a handful of maps. // They are implemented here for the sake of completeness, and being able to repack their maps without corruption. WzImageProperty clock = mapImage["clock"]; WzImageProperty ship = mapImage["shipObj"]; WzImageProperty area = mapImage["area"]; WzImageProperty healer = mapImage["healer"]; WzImageProperty pulley = mapImage["pulley"]; WzImageProperty BuffZone = mapImage["BuffZone"]; WzImageProperty swimArea = mapImage["swimArea"]; if (clock != null) { Clock clockInstance = new Clock(mapBoard, new Rectangle(InfoTool.GetInt(clock["x"]), InfoTool.GetInt(clock["y"]), InfoTool.GetInt(clock["width"]), InfoTool.GetInt(clock["height"]))); mapBoard.BoardItems.Add(clockInstance, false); } if (ship != null) { string objPath = InfoTool.GetString(ship["shipObj"]); string[] objPathParts = objPath.Split("/".ToCharArray()); string oS = WzInfoTools.RemoveExtension(objPathParts[objPathParts.Length - 4]); string l0 = objPathParts[objPathParts.Length - 3]; string l1 = objPathParts[objPathParts.Length - 2]; string l2 = objPathParts[objPathParts.Length - 1]; ObjectInfo objInfo = ObjectInfo.Get(oS, l0, l1, l2); ShipObject shipInstance = new ShipObject(objInfo, mapBoard, InfoTool.GetInt(ship["x"]), InfoTool.GetInt(ship["y"]), InfoTool.GetOptionalInt(ship["z"]), InfoTool.GetOptionalInt(ship["x0"]), InfoTool.GetInt(ship["tMove"]), InfoTool.GetInt(ship["shipKind"]), InfoTool.GetBool(ship["f"])); mapBoard.BoardItems.Add(shipInstance, false); } if (area != null) { foreach (WzImageProperty prop in area.WzProperties) { int x1 = InfoTool.GetInt(prop["x1"]); int x2 = InfoTool.GetInt(prop["x2"]); int y1 = InfoTool.GetInt(prop["y1"]); int y2 = InfoTool.GetInt(prop["y2"]); Area currArea = new Area(mapBoard, new Rectangle(Math.Min(x1, x2), Math.Min(y1, y2), Math.Abs(x2 - x1), Math.Abs(y2 - y1)), prop.Name); mapBoard.BoardItems.Add(currArea, false); } } if (healer != null) { string objPath = InfoTool.GetString(healer["healer"]); string[] objPathParts = objPath.Split("/".ToCharArray()); string oS = WzInfoTools.RemoveExtension(objPathParts[objPathParts.Length - 4]); string l0 = objPathParts[objPathParts.Length - 3]; string l1 = objPathParts[objPathParts.Length - 2]; string l2 = objPathParts[objPathParts.Length - 1]; ObjectInfo objInfo = ObjectInfo.Get(oS, l0, l1, l2); Healer healerInstance = new Healer(objInfo, mapBoard, InfoTool.GetInt(healer["x"]), InfoTool.GetInt(healer["yMin"]), InfoTool.GetInt(healer["yMax"]), InfoTool.GetInt(healer["healMin"]), InfoTool.GetInt(healer["healMax"]), InfoTool.GetInt(healer["fall"]), InfoTool.GetInt(healer["rise"])); mapBoard.BoardItems.Add(healerInstance, false); } if (pulley != null) { string objPath = InfoTool.GetString(pulley["pulley"]); string[] objPathParts = objPath.Split("/".ToCharArray()); string oS = WzInfoTools.RemoveExtension(objPathParts[objPathParts.Length - 4]); string l0 = objPathParts[objPathParts.Length - 3]; string l1 = objPathParts[objPathParts.Length - 2]; string l2 = objPathParts[objPathParts.Length - 1]; ObjectInfo objInfo = ObjectInfo.Get(oS, l0, l1, l2); Pulley pulleyInstance = new Pulley(objInfo, mapBoard, InfoTool.GetInt(pulley["x"]), InfoTool.GetInt(pulley["y"])); mapBoard.BoardItems.Add(pulleyInstance, false); } if (BuffZone != null) { foreach (WzImageProperty zone in BuffZone.WzProperties) { int x1 = InfoTool.GetInt(zone["x1"]); int x2 = InfoTool.GetInt(zone["x2"]); int y1 = InfoTool.GetInt(zone["y1"]); int y2 = InfoTool.GetInt(zone["y2"]); int id = InfoTool.GetInt(zone["ItemID"]); int interval = InfoTool.GetInt(zone["Interval"]); int duration = InfoTool.GetInt(zone["Duration"]); BuffZone currZone = new BuffZone(mapBoard, new Rectangle(Math.Min(x1, x2), Math.Min(y1, y2), Math.Abs(x2 - x1), Math.Abs(y2 - y1)), id, interval, duration, zone.Name); mapBoard.BoardItems.Add(currZone, false); } } if (swimArea != null) { foreach (WzImageProperty prop in swimArea.WzProperties) { int x1 = InfoTool.GetInt(prop["x1"]); int x2 = InfoTool.GetInt(prop["x2"]); int y1 = InfoTool.GetInt(prop["y1"]); int y2 = InfoTool.GetInt(prop["y2"]); SwimArea currArea = new SwimArea(mapBoard, new Rectangle(Math.Min(x1, x2), Math.Min(y1, y2), Math.Abs(x2 - x1), Math.Abs(y2 - y1)), prop.Name); mapBoard.BoardItems.Add(currArea, false); } } // Some misc items are not implemented here; these are copied byte-to-byte from the original. See VerifyMapPropsKnown for details. }