| 4899 | } |
| 4900 | |
| 4901 | func (tc *TableContents) ReceiveMessage(msg *Message) { |
| 4902 | if msg.Type == MessageCardResizeCompleted { |
| 4903 | w := int(tc.Card.Rect.W / 32) |
| 4904 | h := int(tc.Card.Rect.H / 32) |
| 4905 | tc.TableData.Resize(w, h) |
| 4906 | tc.Card.Properties.Get("contents").SetRaw(tc.TableData.Serialize()) |
| 4907 | } else if msg.Type == MessageUndoRedo { |
| 4908 | tc.TableData.Deserialize(tc.Card.Properties.Get("contents").AsString()) |
| 4909 | tc.Card.Properties.Get("contents").SetRaw(tc.TableData.Serialize()) |
| 4910 | } else if msg.Type == MessageCardDeselected { |
| 4911 | |
| 4912 | msg := globals.MenuSystem.Get("table settings menu") |
| 4913 | if msg.Opened { |
| 4914 | msg.Close() |
| 4915 | } |
| 4916 | |
| 4917 | } |
| 4918 | } |
| 4919 | |
| 4920 | func (tc *TableContents) DefaultSize() Vector { |
| 4921 | gs := globals.GridSize |