File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919$ settings = new ServerSetting ($ playersMax ); // must be first for correctly setting the global tickRate (Util::$TICK_RATE)
2020
2121$ logger = new ConsoleLogger ();
22- $ logger ->info ("Preparing game for launch... " );
22+ $ logger ->info ("Preparing game for launch, please wait ... " );
2323
2424$ game = ($ debug ? GameFactory::createDebug () : GameFactory::createDefaultCompetitive ());
2525$ game ->loadMap (new Maps \DefaultMap ());
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export class BuyMenu {
3535 } else if ( playerData . armorType === Enum . ArmorType . BODY_AND_HEAD ) {
3636 kevlarHeadPrice = 650
3737 }
38+ const grenadeCount = Enum . GrenadeSlots . reduce ( ( sum , slot ) => sum += playerData . slots [ slot ] ? playerData . slots [ slot ] [ 'pcs' ] || 1 : 0 , 0 )
3839
3940 this . #element. innerHTML = `
4041 <p class="title">${ teamName } Buy Store. Your money balance $ <strong>${ money } </strong></p>
@@ -51,8 +52,11 @@ export class BuyMenu {
5152 : ``
5253 }
5354 <h3>Grenades</h3>
54- <div class="menu-grenades">
55- <p${ money < 200 ? ' class="disabled"' : '' } ><a data-buy-menu-item-id="${ Enum . BuyMenuItem . GRENADE_FLASH } " class="hud-action action-buy">Flash for ${ this . #formatPrice( 200 ) } </a></p>
55+ <div class="menu-grenades${ grenadeCount >= 4 ? ' hidden' : '' } ">
56+ ${ playerData . slots [ Enum . InventorySlot . SLOT_GRENADE_FLASH ] === undefined || playerData . slots [ Enum . InventorySlot . SLOT_GRENADE_FLASH ] [ 'pcs' ] < 2
57+ ? `<p${ money < 200 ? ' class="disabled"' : '' } ><a data-buy-menu-item-id="${ Enum . BuyMenuItem . GRENADE_FLASH } " class="hud-action action-buy">Flash for ${ this . #formatPrice( 200 ) } </a></p>`
58+ : ``
59+ }
5660 ${ playerData . slots [ Enum . InventorySlot . SLOT_GRENADE_SMOKE ] === undefined
5761 ? `<p${ money < 300 ? ' class="disabled"' : '' } ><a data-buy-menu-item-id="${ Enum . BuyMenuItem . GRENADE_SMOKE } " class="hud-action action-buy">Smoke for ${ this . #formatPrice( 300 ) } </a></p>`
5862 : ``
You can’t perform that action at this time.
0 commit comments