Skip to content

Commit

Permalink
✨ Implement boundary section
Browse files Browse the repository at this point in the history
  • Loading branch information
pleonex committed Jan 13, 2020
1 parent ec2b8c1 commit b98b276
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Clypo/Binary2Clyt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public Binary2Clyt()
{ "txt1", ReadText },
{ "pic1", ReadPicture },
{ "wnd1", ReadWindow },
{ "bnd1", ReadBoundary },
{ "usd1", ReadUserData },
{ "grp1", ReadGroup },
{ "grs1", ReadGroupStart },
Expand Down Expand Up @@ -345,6 +346,14 @@ void ReadWindow()
window.Unknown = reader.ReadBytes(unknownSize);
}

void ReadBoundary()
{
Boundary boundary = new Boundary();
ReadPanel(boundary);
boundary.Parent = currentPanel;
currentPanel.Children.Add(boundary);
}

void ReadUserData()
{
UserData data = new UserData();
Expand Down
7 changes: 7 additions & 0 deletions Clypo/Clyt2Binary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void WritePanelGroup(Panel panel)
WriteSection("pic1", () => WritePictureInfo(picture));
} else if (panel is Window window) {
WriteSection("wnd1", () => WriteWindow(window));
} else if (panel is Boundary boundary) {
WriteSection("bnd1", () => WriteBoundary(boundary));
} else {
WriteSection("pan1", () => WritePanel(panel));
}
Expand Down Expand Up @@ -352,5 +354,10 @@ void WriteWindow(Window window)
WritePanel(window);
writer.Write(window.Unknown);
}

void WriteBoundary(Boundary boundary)
{
WritePanel(boundary);
}
}
}
25 changes: 25 additions & 0 deletions Clypo/Layout/Boundary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2019 SceneGate

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace Clypo.Layout
{
public class Boundary : Panel
{
}
}

0 comments on commit b98b276

Please sign in to comment.