mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-23 14:46:41 +00:00
Changed consolex to console logging (#1036)
## Description: Changed from consolex to console ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: @qqkedsi
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { consolex } from "../../core/Consolex";
|
||||
import { EventBus } from "../../core/EventBus";
|
||||
import { GameView } from "../../core/game/GameView";
|
||||
import { GameStartingModal } from "../GameStartingModal";
|
||||
@@ -51,7 +50,7 @@ export function createRenderer(
|
||||
// TODO maybe append this to dcoument instead of querying for them?
|
||||
const emojiTable = document.querySelector("emoji-table") as EmojiTable;
|
||||
if (!emojiTable || !(emojiTable instanceof EmojiTable)) {
|
||||
consolex.error("EmojiTable element not found in the DOM");
|
||||
console.error("EmojiTable element not found in the DOM");
|
||||
}
|
||||
emojiTable.eventBus = eventBus;
|
||||
emojiTable.transformHandler = transformHandler;
|
||||
@@ -60,28 +59,28 @@ export function createRenderer(
|
||||
|
||||
const buildMenu = document.querySelector("build-menu") as BuildMenu;
|
||||
if (!buildMenu || !(buildMenu instanceof BuildMenu)) {
|
||||
consolex.error("BuildMenu element not found in the DOM");
|
||||
console.error("BuildMenu element not found in the DOM");
|
||||
}
|
||||
buildMenu.game = game;
|
||||
buildMenu.eventBus = eventBus;
|
||||
|
||||
const leaderboard = document.querySelector("leader-board") as Leaderboard;
|
||||
if (!emojiTable || !(leaderboard instanceof Leaderboard)) {
|
||||
consolex.error("EmojiTable element not found in the DOM");
|
||||
console.error("EmojiTable element not found in the DOM");
|
||||
}
|
||||
leaderboard.eventBus = eventBus;
|
||||
leaderboard.game = game;
|
||||
|
||||
const teamStats = document.querySelector("team-stats") as TeamStats;
|
||||
if (!emojiTable || !(teamStats instanceof TeamStats)) {
|
||||
consolex.error("EmojiTable element not found in the DOM");
|
||||
console.error("EmojiTable element not found in the DOM");
|
||||
}
|
||||
teamStats.eventBus = eventBus;
|
||||
teamStats.game = game;
|
||||
|
||||
const controlPanel = document.querySelector("control-panel") as ControlPanel;
|
||||
if (!(controlPanel instanceof ControlPanel)) {
|
||||
consolex.error("ControlPanel element not found in the DOM");
|
||||
console.error("ControlPanel element not found in the DOM");
|
||||
}
|
||||
controlPanel.eventBus = eventBus;
|
||||
controlPanel.uiState = uiState;
|
||||
@@ -91,14 +90,14 @@ export function createRenderer(
|
||||
"events-display",
|
||||
) as EventsDisplay;
|
||||
if (!(eventsDisplay instanceof EventsDisplay)) {
|
||||
consolex.error("events display not found");
|
||||
console.error("events display not found");
|
||||
}
|
||||
eventsDisplay.eventBus = eventBus;
|
||||
eventsDisplay.game = game;
|
||||
|
||||
const chatDisplay = document.querySelector("chat-display") as ChatDisplay;
|
||||
if (!(chatDisplay instanceof ChatDisplay)) {
|
||||
consolex.error("chat display not found");
|
||||
console.error("chat display not found");
|
||||
}
|
||||
chatDisplay.eventBus = eventBus;
|
||||
chatDisplay.game = game;
|
||||
@@ -107,7 +106,7 @@ export function createRenderer(
|
||||
"player-info-overlay",
|
||||
) as PlayerInfoOverlay;
|
||||
if (!(playerInfo instanceof PlayerInfoOverlay)) {
|
||||
consolex.error("player info overlay not found");
|
||||
console.error("player info overlay not found");
|
||||
}
|
||||
playerInfo.eventBus = eventBus;
|
||||
playerInfo.transform = transformHandler;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { consolex } from "../../../core/Consolex";
|
||||
import { PlayerView } from "../../../core/game/GameView";
|
||||
import { AnimatedSprite } from "../AnimatedSprite";
|
||||
import { AnimatedSpriteLoader } from "../AnimatedSpriteLoader";
|
||||
@@ -62,7 +61,7 @@ export class SpriteFx implements Fx {
|
||||
theme,
|
||||
);
|
||||
if (!this.animatedSprite) {
|
||||
consolex.error("Could not load animated sprite", fxType);
|
||||
console.error("Could not load animated sprite", fxType);
|
||||
} else {
|
||||
this.duration = duration ?? this.animatedSprite.lifeTime() ?? 1000;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import disabledIcon from "../../../../resources/images/DisabledIcon.svg";
|
||||
import infoIcon from "../../../../resources/images/InfoIcon.svg";
|
||||
import swordIcon from "../../../../resources/images/SwordIconWhite.svg";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIconWhite.svg";
|
||||
import { consolex } from "../../../core/Consolex";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
Cell,
|
||||
@@ -341,7 +340,7 @@ export class RadialMenu implements Layer {
|
||||
|
||||
const myPlayer = this.g.myPlayer();
|
||||
if (myPlayer === null) {
|
||||
consolex.warn("my player not found");
|
||||
console.warn("my player not found");
|
||||
return;
|
||||
}
|
||||
if (myPlayer && !myPlayer.isAlive() && !this.g.inSpawnPhase()) {
|
||||
@@ -453,7 +452,7 @@ export class RadialMenu implements Layer {
|
||||
if (!this.isCenterButtonEnabled) {
|
||||
return;
|
||||
}
|
||||
consolex.log("Center button clicked");
|
||||
console.log("Center button clicked");
|
||||
if (this.clickedCell === null) return;
|
||||
const clicked = this.g.ref(this.clickedCell.x, this.clickedCell.y);
|
||||
if (this.g.inSpawnPhase()) {
|
||||
|
||||
Reference in New Issue
Block a user