quake2ts 0.0.211 → 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.
- package/package.json +1 -1
- package/packages/cgame/dist/index.cjs +37 -0
- package/packages/cgame/dist/index.cjs.map +1 -1
- package/packages/cgame/dist/index.d.cts +1 -0
- package/packages/cgame/dist/index.d.ts +1 -0
- package/packages/cgame/dist/index.js +37 -0
- package/packages/cgame/dist/index.js.map +1 -1
- package/packages/client/dist/browser/index.global.js +13 -13
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +1 -30
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +1 -30
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/hud.d.ts +1 -2
- package/packages/client/dist/types/hud.d.ts.map +1 -1
- package/packages/client/dist/types/index.d.ts.map +1 -1
- package/packages/client/dist/types/hud/subtitles.d.ts +0 -7
- package/packages/client/dist/types/hud/subtitles.d.ts.map +0 -1
|
@@ -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
|
|
|
@@ -6015,7 +5989,6 @@ function buildRenderableEntities(latestEntities, previousEntities, alpha, config
|
|
|
6015
5989
|
function createClient(imports) {
|
|
6016
5990
|
const prediction = new ClientPrediction(imports.engine.trace);
|
|
6017
5991
|
const view = new ViewEffects();
|
|
6018
|
-
const subtitleSystem = new SubtitleSystem();
|
|
6019
5992
|
const demoPlayback = new DemoPlaybackController();
|
|
6020
5993
|
const demoHandler = new ClientNetworkHandler(imports);
|
|
6021
5994
|
const menuSystem = new MenuSystem();
|
|
@@ -6366,7 +6339,6 @@ function createClient(imports) {
|
|
|
6366
6339
|
// playernum
|
|
6367
6340
|
playerState
|
|
6368
6341
|
);
|
|
6369
|
-
subtitleSystem.drawSubtitles(renderer, timeMs);
|
|
6370
6342
|
renderer.end2D();
|
|
6371
6343
|
}
|
|
6372
6344
|
if (menuSystem.isActive()) {
|
|
@@ -6417,8 +6389,7 @@ function createClient(imports) {
|
|
|
6417
6389
|
cg.NotifyMessage(0, msg, false);
|
|
6418
6390
|
},
|
|
6419
6391
|
showSubtitle(text, soundName) {
|
|
6420
|
-
|
|
6421
|
-
subtitleSystem.addSubtitle(text, timeMs);
|
|
6392
|
+
cg.ShowSubtitle(text, soundName);
|
|
6422
6393
|
},
|
|
6423
6394
|
ParseConfigString(index, value) {
|
|
6424
6395
|
configStrings.set(index, value);
|