Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fallback values to creator names #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/resources/template/app/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ WurmMapGen.gui = new Vue({
for (i = 0; i < WurmMapGen.villages.length; i++) {
var village = WurmMapGen.villages[i];

// Fallback value if mayor name is null
if (village.mayor == null) {
village.mayor = "Unknown";
};

var name = escapeHtml(village.name);
var mayor = escapeHtml(village.mayor);

var label = '';

// Check if name matches query
Expand Down Expand Up @@ -106,6 +111,11 @@ WurmMapGen.gui = new Vue({
for (i = 0; i < WurmMapGen.structures.length; i++) {
var structure = WurmMapGen.structures[i];

// Fallback value if creator name is null
if (structure.creator == null) {
structure.creator = "Unknown";
};

var name = escapeHtml(structure.name);
var creator = escapeHtml(structure.creator);

Expand Down Expand Up @@ -157,6 +167,11 @@ WurmMapGen.gui = new Vue({
for (i = 0; i < WurmMapGen.guardtowers.length; i++) {
var tower = WurmMapGen.guardtowers[i];

// Fallback value if creator name is null
if (tower.creator == null) {
tower.creator = "Unknown";
};

var creator = escapeHtml(tower.creator);

// Check if player name matches query
Expand Down