MCPcopy Create free account
hub / github.com/crossuo/crossuo / Save

Method Save

src/Managers/GumpManager.cpp:1566–1807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564};
1565
1566void CGumpManager::Save(const fs_path &path)
1567{
1568 Wisp::CBinaryFileWriter writer;
1569
1570 writer.Open(path);
1571 writer.WriteInt8(VERSION); // version
1572 writer.WriteBuffer();
1573 uint16_t count = 0;
1574
1575 // custom blob static data
1576 {
1577 writer.WriteUInt32LE(0x33221100); // blobMarker
1578 writer.WriteUInt8(0x01); // some gump extra data
1579 writer.WriteUInt8(GT_RESOURCETRACKER);
1580 ResourceTracker_SaveStaticContents(writer);
1581 }
1582
1583 std::vector<CGump *> containerList;
1584 std::vector<CGump *> spellInGroupList;
1585 QFOR(gump, m_Items, CGump *)
1586 {
1587 switch (gump->GumpType)
1588 {
1589 case GT_PAPERDOLL:
1590 case GT_STATUSBAR:
1591 if (gump->Serial != g_PlayerSerial)
1592 {
1593 break;
1594 }
1595 case GT_MINIMAP:
1596 case GT_SKILLS:
1597 case GT_JOURNAL:
1598 case GT_WORLD_MAP:
1599 case GT_RESOURCETRACKER:
1600 case GT_PROPERTY_ICON:
1601 {
1602 uint8_t size = 12;
1603 if (gump->GumpType == GT_JOURNAL)
1604 {
1605 size += 2;
1606 }
1607 else if (gump->GumpType == GT_SKILLS)
1608 {
1609 size += 2;
1610 }
1611 else if (gump->GumpType == GT_WORLD_MAP)
1612 {
1613 size += 11;
1614 }
1615
1616 SaveDefaultGumpProperties(writer, gump, size);
1617 if (gump->GumpType == GT_JOURNAL)
1618 {
1619 writer.WriteUInt16LE(((CGumpJournal *)gump)->Height);
1620 }
1621 else if (gump->GumpType == GT_SKILLS)
1622 {
1623 writer.WriteUInt16LE(((CGumpSkills *)gump)->Height);

Callers

nothing calls this directly

Calls 15

WriteInt8Method · 0.80
WriteBufferMethod · 0.80
WriteUInt32LEMethod · 0.80
WriteUInt8Method · 0.80
eraseMethod · 0.80
FindWorldObjectMethod · 0.80
GetTopSpellMethod · 0.80
WriteInt16LEMethod · 0.80
WriteUInt16LEMethod · 0.80
OpenMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected