quake2ts 0.0.210 → 0.0.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4177,32 +4177,6 @@ var Init_Hud = async (renderer, assets) => {
4177
4177
  await Init_Damage(renderer, assets);
4178
4178
  };
4179
4179
 
4180
- // src/hud/subtitles.ts
4181
- var SUBTITLE_DURATION = 3e3;
4182
- var SubtitleSystem = class {
4183
- constructor() {
4184
- this.subtitle = null;
4185
- }
4186
- addSubtitle(text, now) {
4187
- this.subtitle = {
4188
- text,
4189
- startTime: now,
4190
- duration: SUBTITLE_DURATION
4191
- };
4192
- }
4193
- drawSubtitles(renderer, now) {
4194
- if (!this.subtitle) {
4195
- return;
4196
- }
4197
- if (now > this.subtitle.startTime + this.subtitle.duration) {
4198
- this.subtitle = null;
4199
- return;
4200
- }
4201
- const y = renderer.height - 40;
4202
- renderer.drawCenterString(y, this.subtitle.text);
4203
- }
4204
- };
4205
-
4206
4180
  // src/demo/handler.ts
4207
4181
  var import_cgame = require("@quake2ts/cgame");
4208
4182
 
@@ -4499,6 +4473,9 @@ var ClientNetworkHandler = class {
4499
4473
  }
4500
4474
  }
4501
4475
  onStuffText(msg) {
4476
+ if (this.imports?.engine.cmd) {
4477
+ this.imports.engine.cmd.executeText(msg);
4478
+ }
4502
4479
  }
4503
4480
  onPrint(level, msg) {
4504
4481
  if (this.callbacks?.onPrint) {
@@ -6040,7 +6017,6 @@ function buildRenderableEntities(latestEntities, previousEntities, alpha, config
6040
6017
  function createClient(imports) {
6041
6018
  const prediction = new import_cgame2.ClientPrediction(imports.engine.trace);
6042
6019
  const view = new import_cgame3.ViewEffects();
6043
- const subtitleSystem = new SubtitleSystem();
6044
6020
  const demoPlayback = new DemoPlaybackController();
6045
6021
  const demoHandler = new ClientNetworkHandler(imports);
6046
6022
  const menuSystem = new MenuSystem();
@@ -6391,7 +6367,6 @@ function createClient(imports) {
6391
6367
  // playernum
6392
6368
  playerState
6393
6369
  );
6394
- subtitleSystem.drawSubtitles(renderer, timeMs);
6395
6370
  renderer.end2D();
6396
6371
  }
6397
6372
  if (menuSystem.isActive()) {
@@ -6442,8 +6417,7 @@ function createClient(imports) {
6442
6417
  cg.NotifyMessage(0, msg, false);
6443
6418
  },
6444
6419
  showSubtitle(text, soundName) {
6445
- const timeMs = latestFrame?.timeMs ?? 0;
6446
- subtitleSystem.addSubtitle(text, timeMs);
6420
+ cg.ShowSubtitle(text, soundName);
6447
6421
  },
6448
6422
  ParseConfigString(index, value) {
6449
6423
  configStrings.set(index, value);