MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / refresh_patsocks

Function refresh_patsocks

src/SB/Game/zUI.cpp:1801–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1799}
1800
1801static void refresh_patsocks(U32 world)
1802{
1803 U32 count = globals.player.Inv_PatsSock[world];
1804 U32 max = globals.player.Inv_PatsSock_Max[world];
1805
1806 if (world != patsock_prev_world || count != patsock_prev_count)
1807 {
1808 // non-matching: instruction order
1809
1810 patsock_prev_world = world;
1811 patsock_prev_count = count;
1812
1813 if (max == 0)
1814 {
1815 disable_ui(patsock_ui);
1816 disable_ui(patsock_uif);
1817
1818 patsock_text_buffer[0] = '\0';
1819 }
1820 else
1821 {
1822 if (count > 99)
1823 {
1824 count = 99;
1825 }
1826
1827 if (max > 99)
1828 {
1829 max = 99;
1830 }
1831
1832 sprintf(patsock_text_buffer, "%d/%d", count, max);
1833
1834 enable_ui(patsock_ui);
1835 enable_ui(patsock_uif);
1836
1837 if (patsock_uif)
1838 {
1839 patsock_uif->text = patsock_text_buffer;
1840 }
1841 }
1842 }
1843}
1844
1845void zUI_PortalToKrabs(U32 taskNum)
1846{

Callers 1

zUI_ScenePortalUpdateFunction · 0.70

Calls 3

disable_uiFunction · 0.85
sprintfFunction · 0.85
enable_uiFunction · 0.85

Tested by

no test coverage detected