Lots of stuff

This commit is contained in:
Vortrex
2020-12-11 01:51:55 -06:00
parent ecc495de5c
commit fbaafa6c0c
67 changed files with 5755 additions and 4208 deletions

View File

@@ -8,45 +8,59 @@
// TYPE: Server (JavaScript)
// ===========================================================================
let serverColours = {
byType: {
talkMessage: toColour(200, 200, 200),
shoutMessage: toColour(255, 255, 200),
whisperMessage: toColour(130, 130, 130),
doActionMessage: toColour(153, 50, 204, 255),
meActionMessage: toColour(153, 50, 204, 255),
errorMessage: toColour(237, 67, 55, 255),
syntaxMessage: toColour(200, 200, 200, 255),
normalMessage: toColour(255, 255, 255, 255),
alertMessage: toColour(255, 255, 0, 255),
successMessage: toColour(0, 180, 0, 255),
clanChatMessage: toColour(0, 190, 0, 255),
},
byName: {
white: toColour(255, 255, 255, 255),
black: toColour(0, 0, 0, 255),
red: toColour(255, 0, 0, 255),
yellow: toColour(255, 255, 0, 255),
royalBlue: toColour(0, 0, 255, 255),
teal: toColour(0, 255, 255, 255),
orange: toColour(255, 128, 0, 255),
lightGrey: toColour(200, 200, 200, 255),
mediumGrey: toColour(150, 150, 150, 255),
darkGrey: toColour(64, 64, 64, 255),
policeBlue: toColour(70, 130, 180, 255),
medicPink: toColour(219, 112, 147, 255),
firefighterRed: toColour(205, 92, 92, 255),
busDriverGreen: toColour(50, 205, 50, 255),
taxiDriverYellow: toColour(240, 230, 140, 255),
burntYellow: toColour(210, 210, 0, 255),
burntOrange: toColour(210, 120, 0, 255),
bankGreen: toColour(0, 150, 0, 255),
softGreen: toColour(144, 255, 96, 255),
}
};
// ----------------------------------------------------------------------------
function getServerColours() {
return serverColours;
}
// ----------------------------------------------------------------------------
function getColourByType(typeName) {
return serverConfig.colour.byType[typeName];
return getServerColours().byType[typeName];
}
// ----------------------------------------------------------------------------
function getColourByName(colourName) {
return serverConfig.colour.byName[colourName];
}
// ---------------------------------------------------------------------------
function rgbToHex(red, green, blue) {
return "#" + componentToHex(red) + componentToHex(green) + componentToHex(blue);
}
// ---------------------------------------------------------------------------
function componentToHex(component) {
let hex = component.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
// ---------------------------------------------------------------------------
function hexToRGB(hex) {
let red = parseInt((cutHex(hex)).substring(0,2),16);
let green = parseInt((cutHex(hex)).substring(2,4),16);
let blue = parseInt((cutHex(hex)).substring(4,6),16);
return {r: red, g: green, b: blue};
}
// ---------------------------------------------------------------------------
function cutHex(hex) {
return (hex.charAt(0)=="#") ? hex.substring(1,7) : hex;
return getServerColours().byName[colourName];
}
// ---------------------------------------------------------------------------