Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
- Log warn logs occurred count

See merge request minecraft/convert-minecraft-java-texture-to-bedrock/webapp!54
  • Loading branch information
ozelot379 committed Aug 16, 2020
2 parents 041218a + 9ea0ffa commit 86a1afa
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [4.0.3]
- Log warn logs occurred count
- Mark warning logs yellow

## [4.0.2]
- Fix `pack_format` `6`
- Remove convert piglin
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ozelot379/convert-minecraft-java-texture-to-bedrock-webapp",
"productName": "ConvertJavaTextureToBedrockWebApp",
"version": "4.0.2",
"version": "4.0.3",
"description": "Web app for convert Minecraft Java texture packs to Bedrock texture packs",
"keywords": [
"Minecraft",
Expand All @@ -23,7 +23,7 @@
"homepage": "https://github.com/ozelot379/ConvertJavaTextureToBedrock#readme",
"dependencies": {},
"devDependencies": {
"@ozelot379/convert-minecraft-java-texture-to-bedrock-api": "4.0.2",
"@ozelot379/convert-minecraft-java-texture-to-bedrock-api": "4.0.3",
"clean-webpack-plugin": "3.0.0",
"css-loader": "3.4.2",
"favicons-webpack-plugin": "1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ input[type="file"] {
.log {
.grey.lighten-3;
.black-text;
height: 150px;
height: 160px;
overflow: auto;
}

Expand Down
11 changes: 8 additions & 3 deletions src/js/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ document.addEventListener("DOMContentLoaded", () => {
* @returns {Promise<>}
*/
async function afterConvert(e) {
const {log, output} = e.data;
const {log, log_color_class, output} = e.data;

if (log) {
_log(log);
_log(log, log_color_class);
return;
}

Expand Down Expand Up @@ -210,13 +210,18 @@ document.addEventListener("DOMContentLoaded", () => {

/**
* @param {string|undefined} log
* @param {string|undefined} log_color_class
*/
function _log(log = undefined) {
function _log(log = undefined, log_color_class = undefined) {
if (log) {
const li = document.createElement("li");

li.innerText = log;

if (log_color_class) {
li.classList.add(`${log_color_class}-text`, "text-darken-3");
}

logs.appendChild(li);
}

Expand Down
10 changes: 7 additions & 3 deletions src/js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ addEventListener("message", async e => {
new class extends AbstractLog {
/**
* @inheritDoc
*
* @param {string|undefined} log_color_class
*/
log(log) {
postMessage({log})
log(log, log_color_class = undefined) {
postMessage({log, log_color_class})
}

/**
* @inheritDoc
*/
warn(log) {
this.log(`WARNING: ${log}`);
this.warnCount();

this.log(`WARNING: ${log}`, "yellow");
}
}(),
options
Expand Down

0 comments on commit 86a1afa

Please sign in to comment.