@@ -1837,6 +1837,7 @@ void InGameUI::update( void )
18371837 // update the player money window if the money amount has changed
18381838 // this seems like as good a place as any to do the power hide/show
18391839 static Int lastMoney = -1 ;
1840+ static Int lastIncome = -1 ;
18401841 static NameKeyType moneyWindowKey = TheNameKeyGenerator->nameToKey ( " ControlBar.wnd:MoneyDisplay" );
18411842 static NameKeyType powerWindowKey = TheNameKeyGenerator->nameToKey ( " ControlBar.wnd:PowerWindow" );
18421843
@@ -1852,16 +1853,59 @@ void InGameUI::update( void )
18521853 Player* moneyPlayer = TheControlBar->getCurrentlyViewedPlayer ();
18531854 if ( moneyPlayer)
18541855 {
1855- Int currentMoney = moneyPlayer->getMoney ()->countMoney ();
1856- if ( lastMoney != currentMoney )
1856+ Money *money = moneyPlayer->getMoney ();
1857+ Bool showIncome = TheGlobalData->m_moneyPerMinute ;
1858+ if (!showIncome)
18571859 {
1858- UnicodeString buffer;
1860+ Int currentMoney = money->countMoney ();
1861+ if ( lastMoney != currentMoney )
1862+ {
1863+ UnicodeString buffer;
18591864
1860- buffer.format ( TheGameText->fetch ( " GUI:ControlBarMoneyDisplay" ), currentMoney );
1861- GadgetStaticTextSetText ( moneyWin, buffer );
1862- lastMoney = currentMoney;
1865+ buffer.format (TheGameText->fetch ( " GUI:ControlBarMoneyDisplay" ), currentMoney );
1866+ GadgetStaticTextSetText ( moneyWin, buffer );
1867+ lastMoney = currentMoney;
18631868
1864- } // end if
1869+ } // end if
1870+ }
1871+ else
1872+ {
1873+ // TheSuperHackers @feature L3-M 21/08/2025 player money per minute
1874+ money->updateIncomeBucket ();
1875+ UnsignedInt currentMoney = money->countMoney ();
1876+ UnsignedInt cashPerMin = money->getCashPerMinute ();
1877+ if (lastMoney != (Int)currentMoney || lastIncome != (Int)cashPerMin)
1878+ {
1879+ UnicodeString buffer;
1880+ UnicodeString moneyStr;
1881+ UnicodeString incomeStr;
1882+ if (currentMoney >= 100000 )
1883+ {
1884+ moneyStr.format (L" %dK" , currentMoney / 1000 );
1885+ }
1886+ else
1887+ {
1888+ moneyStr.format (L" %d" , currentMoney);
1889+ }
1890+ if (cashPerMin >= 10000 )
1891+ {
1892+ incomeStr.format (L" %dK" , cashPerMin / 1000 );
1893+ }
1894+ else if (cashPerMin >= 1000 )
1895+ {
1896+ UnsignedInt k = cashPerMin / 100 ;
1897+ incomeStr.format (L" %d.%dK" , k / 10 , k % 10 );
1898+ }
1899+ else
1900+ {
1901+ incomeStr.format (L" %d" , cashPerMin);
1902+ }
1903+ buffer.format (TheGameText->FETCH_OR_SUBSTITUTE_FORMAT (" GUI:ControlBarMoneyDisplayIncome" , L" %ls (%ls)" , moneyStr.str (), incomeStr.str ()));
1904+ GadgetStaticTextSetText (moneyWin, buffer);
1905+ lastMoney = currentMoney;
1906+ lastIncome = cashPerMin;
1907+ }
1908+ }
18651909 moneyWin->winHide (FALSE );
18661910 powerWin->winHide (FALSE );
18671911 }
0 commit comments