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

Commit

Permalink
3.6.0 - Tracking PR (#254)
Browse files Browse the repository at this point in the history
* init 3.6.0

* 3.6.0 strict typings (#256)

* Expiremental Strict Typings Migration

* Fix Small Bug

* Update login.ts (#255)

* Update login.ts

* Update package.json

* Add HUD Interfaces

* Add Changelog, Fix Barbershop for Female
  • Loading branch information
Stuyk committed Jul 27, 2022
1 parent bef7579 commit 47158a4
Show file tree
Hide file tree
Showing 56 changed files with 3,671 additions and 2,563 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.6.0

```
Refactoring for Strict Typing Support (WIP)
Changed Icon !important Strictness in src-webviews
Fix Female Barbershop Error
Redesigned Core HUD
+ Added Player ID
+ Added F2 to Cycle HUD Displays
+ Added Death State to Core HUD Updates
+ Added Player ID to Core HUD Updates
```

## 3.5.0

```
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altv-athena",
"version": "3.5.1",
"version": "3.6.0",
"description": "a roleplay framework for alt:V",
"author": "stuyk",
"type": "module",
Expand All @@ -23,10 +23,10 @@
"test": ""
},
"devDependencies": {
"@altv/types-client": "2.2.6",
"@altv/types-client": "^2.2.7",
"@altv/types-natives": "1.4.4",
"@altv/types-server": "2.4.1",
"@altv/types-shared": "1.2.6",
"@altv/types-server": "^2.4.1",
"@altv/types-shared": "^1.2.6",
"@altv/types-webview": "1.0.2",
"@altv/types-worker": "1.0.7",
"@babel/types": "^7.17.0",
Expand Down Expand Up @@ -84,4 +84,4 @@
"pre-commit": "lint"
}
}
}
}
16 changes: 8 additions & 8 deletions scripts/runtime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const serverBinary = process.platform === 'win32' ? 'altv-server.exe' : './altv-server';

const passedArguments = process.argv.slice(2);
const passedArguments = process.argv.slice(2).map(arg => arg.replace('--', ''));
const fileNameHashes = {};

if (NO_SPECIAL_CHARACTERS.test(process.cwd())) {
Expand Down Expand Up @@ -83,17 +83,17 @@ async function runFile(processName, ...args) {
async function handleConfiguration() {
let configName = 'prod';

if (passedArguments.includes('--dev')) {
if (passedArguments.includes('dev')) {
configName = 'dev';
} else if (passedArguments.includes('--devtest')) {
} else if (passedArguments.includes('devtest')) {
configName = 'devtest';
}

console.log(`===> Starting Configuration Build`);
const start = Date.now();
let promises = [];

if (!passedArguments.includes('--dev')) {
if (!passedArguments.includes('dev')) {
promises.push(runFile(npx, 'vite', 'build', './src-webviews'));
}

Expand Down Expand Up @@ -154,7 +154,7 @@ async function handleServerProcess(shouldAutoRestart = false) {
await runFile('chmod', '+x', `./altv-server`);
}

if (passedArguments.includes('--cdn')) {
if (passedArguments.includes('cdn')) {
lastServerProcess = spawn(serverBinary, ['--justpack'], { stdio: 'inherit' });
lastServerProcess.once('exit', () => {
const finalDestination = `${process.cwd()}/cdn_upload`.replace(/\\/g, '/');
Expand Down Expand Up @@ -249,7 +249,7 @@ async function devMode(firstRun = false) {
}

async function runServer() {
const isDev = passedArguments.includes('--dev');
const isDev = passedArguments.includes('dev');

//Update dependencies for all the things
console.log('===> Updating dependencies for plugins');
Expand All @@ -263,7 +263,7 @@ async function runServer() {
await coreBuildProcess();
await handleConfiguration();

if (passedArguments.includes('--dev')) {
if (passedArguments.includes('dev')) {
await sleep(50);
await devMode(true);
handleStreamerProcess(false);
Expand All @@ -276,7 +276,7 @@ async function runServer() {
handleServerProcess(true);
}

if (passedArguments.includes('--start')) {
if (passedArguments.includes('start')) {
for (const port of ports) {
try {
fkill(port, { force: true, ignoreCase: true, silent: true });
Expand Down
Binary file added src-webviews/public/assets/images/oil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src-webviews/src/components/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export default defineComponent({
required: false,
default: false,
},
shadowColor: {
type: String,
required: false,
default: 'black',
},
},
computed: {
dynamicClass() {
Expand All @@ -49,13 +54,13 @@ export default defineComponent({
let style = 'text-align: center !important;';
if (!this.size) {
style += ' font-size: 16px !important;';
style += ' font-size: 16px';
} else {
style += ` font-size: ${this.size}px !important;`;
style += ` font-size: ${this.size}px`;
}
if (this.shadow) {
style += `text-shadow: 1px 1px black !important;`;
style += `text-shadow: 1px 1px ${this.shadowColor} !important;`;
}
return style;
Expand Down
2 changes: 1 addition & 1 deletion src-webviews/src/defaultPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// This does not change anything in-game.
// It's solely for development mode only.

export default [{ name: 'Barbershop' }];
export default [{ name: 'SimpleHud' }];
8 changes: 8 additions & 0 deletions src/core/client/extensions/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ export interface Meta {
isDead: boolean; // Used to determine when a player is dead or not.
gridSpace: number; // Used to identify what part of the map the player is on. Based on Y Axis.

/**
* Check if in a voice channel.
*
* @type {boolean}
* @memberof Meta
*/
voice: boolean;

// Currency
bank: number;
cash: number;
Expand Down
9 changes: 8 additions & 1 deletion src/core/client/systems/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ export class CharacterSystem {
// Facial Features
for (let i = 0; i < appearance.structure.length; i++) {
const value = appearance.structure[i];
native.setPedFaceFeature(ped, i, value);

if (native['setPedFaceFeature']) {
native['setPedFaceFeature'](ped, i, value);
}

if (native['setPedMicroMorphValue']) {
native['setPedMicroMorphValue'](ped, i, value);
}
}

// Overlay Features - NO COLORS
Expand Down
45 changes: 29 additions & 16 deletions src/core/plugins/core-barbershop/server/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,24 @@ export class BarbershopView {
return;
}

const appearance = deepCloneObject<Appearance>(customer.data.appearance);
const hairOverlay = hairOverlayInfo[data.hairFullName];
if (customer.data.appearance) {
const appearance = deepCloneObject<Appearance>(customer.data.appearance);
appearance.hairDlc = data.dlc;
appearance.hair = data.hair;
appearance.hairColor1 = data.hairColor1;
appearance.hairColor2 = data.hairColor2;
appearance.hairOverlay = data.hairFullName
? hairOverlayInfo[data.hairFullName]
: { collection: '', overlay: '' };
appearance.eyebrows = data.eyeIndex;
appearance.eyebrowsOpacity = data.eyeOpacity;
appearance.eyebrowsColor1 = data.eyeColor1;
appearance.facialHair = data.beardIndex;
appearance.facialHairColor1 = data.beardColor1;
appearance.facialHairOpacity = data.beardOpacity;
await Athena.state.set(customer, 'appearance', appearance);
}

appearance.hairDlc = data.dlc;
appearance.hair = data.hair;
appearance.hairColor1 = data.hairColor1;
appearance.hairColor2 = data.hairColor2;
appearance.hairOverlay = hairOverlay;
appearance.eyebrows = data.eyeIndex;
appearance.eyebrowsOpacity = data.eyeOpacity;
appearance.eyebrowsColor1 = data.eyeColor1;
appearance.facialHair = data.beardIndex;
appearance.facialHairColor1 = data.beardColor1;
appearance.facialHairOpacity = data.beardOpacity;

await Athena.state.set(customer, 'appearance', appearance);
BarbershopView.close(hairDresser);
}

Expand Down Expand Up @@ -141,7 +143,11 @@ export class BarbershopView {
return;
}

Athena.player.sync.appearance(customer, customer.data.appearance);
if (!customer.data.appearance) {
return;
}

Athena.player.sync.appearance(customer, customer.data.appearance as Appearance);
Athena.player.sync.equipment(
customer,
customer.data.equipment as Item<ClothingComponent>[],
Expand Down Expand Up @@ -232,6 +238,11 @@ export class BarbershopView {
customer = Athena.systems.identifier.getPlayer(sessions[hairDresserID]);
}

if (!customer.data.appearance) {
BarbershopView.close(hairDresser);
return;
}

await Athena.player.inventory.unequip(customer, EQUIPMENT_TYPE.HAT);

const isSelfService = sessions[hairDresserID] === hairDresserID;
Expand All @@ -257,6 +268,8 @@ export class BarbershopView {
makeupOpacity: makeupInfo && makeupInfo.opacity ? makeupInfo.opacity : 0,
};

console.log(barberData);

customer.frozen = true;
alt.emitClient(hairDresser, BarbershopEvents.ServerClientEvents.OPEN, isSelfService, barberData);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/plugins/core-barbershop/shared/overlays.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const hairOverlayInfo = {
export const hairOverlayInfo: { [key: string]: { collection: string; overlay: string } } = {
'2-0-male-0': {
collection: '',
overlay: '',
Expand Down
6 changes: 5 additions & 1 deletion src/core/plugins/core-barbershop/webview/Barbershop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default defineComponent({
// Update Check
ready: false,
// Navigation
navIndex: 2,
navIndex: 0,
navigation: [
{ icon: 'icon-hair', type: 'hair', colors: 2, isHair: true, colorComponentType: 0 },
{ icon: 'icon-eye', type: 'eye', colors: 1, isEyebrows: true, colorComponentType: 0 },
Expand Down Expand Up @@ -204,6 +204,10 @@ export default defineComponent({
navigationOptions.splice(navIndex, 1);
this.navigation = navigationOptions;
}
if (navIndex >= this.navigation.length) {
this.navIndex = 0;
}
}
await nextTick();
Expand Down
2 changes: 1 addition & 1 deletion src/core/plugins/core-death/server/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ export class DeathCommands {
return;
}

Athena.player.set.respawned(player);
Athena.player.set.respawned(player, player.pos);
}
}
1 change: 1 addition & 0 deletions src/core/plugins/core-death/server/src/death.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class DeathSystem {

if (player.data.isDead) {
Athena.player.emit.meta(player, 'isDead', true);

if (!TimeOfDeath[player.data._id.toString()]) {
TimeOfDeath[player.data._id.toString()] = Date.now() + DEATH_CONFIG.RESPAWN_TIME;
}
Expand Down
Loading

0 comments on commit 47158a4

Please sign in to comment.