Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Update to v1.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Reqwey committed Jun 7, 2023
1 parent 476b102 commit 31a1536
Show file tree
Hide file tree
Showing 4 changed files with 1,986 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gennia",
"version": "1.0.10patch2",
"version": "1.0.11",
"description": "Yet another portable generals.io server & client",
"main": "main.js",
"scripts": {
Expand All @@ -23,7 +23,7 @@
"build": {
"appId": "com.reqwey.gennia",
"productName": "Gennia",
"copyright": "© 2022 Gennia Developing Team",
"copyright": "© 2023 Gennia Developing Team",
"win": {
"icon": "assets/img/favicon-new.png"
}
Expand Down
4 changes: 2 additions & 2 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*/
const { contextBridge, ipcRenderer, app, Menu, dialog } = require('electron')
const { Titlebar, Color } = require("custom-electron-titlebar");
const { Titlebar, TitlebarColor } = require("custom-electron-titlebar");
const { getIPAdress } = require('./util')
const path = require('path');
var titlebar;
Expand All @@ -24,7 +24,7 @@ window.addEventListener('DOMContentLoaded', async () => {
console.log('content loaded');
titlebar = new Titlebar({
icon: path.join(__dirname, 'assets/img/favicon-new.png'),
backgroundColor: Color.fromHex('#596975b3')
backgroundColor: TitlebarColor.fromHex('#596975b3')
// menu: menu
});

Expand Down
17 changes: 15 additions & 2 deletions src/server/map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
Gennia Map Constructor
@Author: Reqwey(hi@reqwey.com)
Jackiexiao(707610215@qq.com)
GitHub Copilot
*/
const Block = require('./block');
const Point = require('./point');

Expand All @@ -19,8 +28,8 @@ function getRandomInt(min, max) {

class GameMap {
constructor(width, height, mountain, city, swamp, kings) {
this.width = parseInt(kings.length * 2.7 + 10 * width);
this.height = parseInt(kings.length * 2.7 + 10 * height);
this.width = parseInt(kings.length * 5 + 6 * width);
this.height = parseInt(kings.length * 5 + 6 * height);
if (mountain + city === 0) {
this.mountain = this.city = 0
} else {
Expand Down Expand Up @@ -120,6 +129,7 @@ class GameMap {
}
}
}
console.log('Kings generated successfully');
// Generate the mountain
for (let i = 1; i <= this.mountain; ++i) {
let generated = false
Expand All @@ -139,6 +149,7 @@ class GameMap {
}
if (!generated) { this.mountain = i - 1; console.log("Mountain Interrupted", i); break }
}
console.log('Mountains generated successfully');
// Generate the city
for (let i = 1; i <= this.city; ++i) {
let generated = false
Expand All @@ -159,6 +170,7 @@ class GameMap {
}
if (!generated) { this.city = i - 1; console.log("City Interrupted", i); break }
}
console.log('Cities generated successfully');
// Generate the swamp.
for (let i = 1, x, y; i <= this.swamp; ++i) {
while (true) {
Expand All @@ -168,6 +180,7 @@ class GameMap {
}
this.map[x][y].type = 'Swamp'
}
console.log('Swamps generated successfully');
let kings = this.kings
return new Promise(function (resolve, reject) {
console.log('Map generated successfully')
Expand Down

0 comments on commit 31a1536

Please sign in to comment.