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.
@@ -4146,32 +4146,6 @@ var Init_Hud = async (renderer, assets) => {
4146
4146
  await Init_Damage(renderer, assets);
4147
4147
  };
4148
4148
 
4149
- // src/hud/subtitles.ts
4150
- var SUBTITLE_DURATION = 3e3;
4151
- var SubtitleSystem = class {
4152
- constructor() {
4153
- this.subtitle = null;
4154
- }
4155
- addSubtitle(text, now) {
4156
- this.subtitle = {
4157
- text,
4158
- startTime: now,
4159
- duration: SUBTITLE_DURATION
4160
- };
4161
- }
4162
- drawSubtitles(renderer, now) {
4163
- if (!this.subtitle) {
4164
- return;
4165
- }
4166
- if (now > this.subtitle.startTime + this.subtitle.duration) {
4167
- this.subtitle = null;
4168
- return;
4169
- }
4170
- const y = renderer.height - 40;
4171
- renderer.drawCenterString(y, this.subtitle.text);
4172
- }
4173
- };
4174
-
4175
4149
  // src/demo/handler.ts
4176
4150
  import { defaultPredictionState, interpolatePredictionState } from "@quake2ts/cgame";
4177
4151
 
@@ -4468,6 +4442,9 @@ var ClientNetworkHandler = class {
4468
4442
  }
4469
4443
  }
4470
4444
  onStuffText(msg) {
4445
+ if (this.imports?.engine.cmd) {
4446
+ this.imports.engine.cmd.executeText(msg);
4447
+ }
4471
4448
  }
4472
4449
  onPrint(level, msg) {
4473
4450
  if (this.callbacks?.onPrint) {
@@ -6012,7 +5989,6 @@ function buildRenderableEntities(latestEntities, previousEntities, alpha, config
6012
5989
  function createClient(imports) {
6013
5990
  const prediction = new ClientPrediction(imports.engine.trace);
6014
5991
  const view = new ViewEffects();
6015
- const subtitleSystem = new SubtitleSystem();
6016
5992
  const demoPlayback = new DemoPlaybackController();
6017
5993
  const demoHandler = new ClientNetworkHandler(imports);
6018
5994
  const menuSystem = new MenuSystem();
@@ -6363,7 +6339,6 @@ function createClient(imports) {
6363
6339
  // playernum
6364
6340
  playerState
6365
6341
  );
6366
- subtitleSystem.drawSubtitles(renderer, timeMs);
6367
6342
  renderer.end2D();
6368
6343
  }
6369
6344
  if (menuSystem.isActive()) {
@@ -6414,8 +6389,7 @@ function createClient(imports) {
6414
6389
  cg.NotifyMessage(0, msg, false);
6415
6390
  },
6416
6391
  showSubtitle(text, soundName) {
6417
- const timeMs = latestFrame?.timeMs ?? 0;
6418
- subtitleSystem.addSubtitle(text, timeMs);
6392
+ cg.ShowSubtitle(text, soundName);
6419
6393
  },
6420
6394
  ParseConfigString(index, value) {
6421
6395
  configStrings.set(index, value);