Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dzsunyec committed Apr 30, 2024
2 parents 582533a + a123e47 commit f259066
Show file tree
Hide file tree
Showing 186 changed files with 6,323 additions and 394 deletions.
1 change: 1 addition & 0 deletions assets/scene/main.composite
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"components":[{"name":"core::Transform","jsonSchema":{"type":"object","properties":{"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}}},"scale":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}}},"rotation":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"},"w":{"type":"number"}}},"parent":{"type":"integer"}},"serializationType":"transform"},"data":{"512":{"json":{"position":{"x":8,"y":1,"z":8},"scale":{"x":1,"y":1,"z":1},"rotation":{"x":0,"y":0,"z":0,"w":1},"parent":0}}}},{"name":"core::MeshRenderer","jsonSchema":{"type":"object","properties":{},"serializationType":"protocol-buffer","protocolBuffer":"PBMeshRenderer"},"data":{"512":{"json":{"mesh":{"$case":"box","box":{"uvs":[]}}}}}},{"name":"core-schema::Name","jsonSchema":{"type":"object","properties":{"value":{"type":"string","serializationType":"utf8-string"}},"serializationType":"map"},"data":{"512":{"json":{"value":"Magic Cube"}}}},{"name":"inspector::Scene","jsonSchema":{"type":"object","properties":{"layout":{"type":"object","properties":{"base":{"type":"object","properties":{"x":{"type":"integer","serializationType":"int32"},"y":{"type":"integer","serializationType":"int32"}},"serializationType":"map"},"parcels":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer","serializationType":"int32"},"y":{"type":"integer","serializationType":"int32"}},"serializationType":"map"},"serializationType":"array"}},"serializationType":"map"}},"serializationType":"map"},"data":{"0":{"json":{"layout":{"base":{"x":0,"y":0},"parcels":[{"x":0,"y":0}]}}}}},{"name":"cube-id","jsonSchema":{"type":"object","properties":{},"serializationType":"map"},"data":{"512":{"json":{}}}}]}
Binary file modified images/genesis-plaza.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified models/TheWhale_Action_Elevator.glb
Binary file not shown.
Binary file modified models/agora.glb
Binary file not shown.
Binary file modified models/artichoke.glb
Binary file not shown.
Binary file modified models/auditorium.glb
Binary file not shown.
Binary file modified models/basketball/basketball_hoop.glb
Binary file not shown.
Binary file modified models/garden.glb
Binary file not shown.
Binary file modified models/hallway.glb
Binary file not shown.
Binary file added models/lobby/hover_arrow_E.glb
Binary file not shown.
Binary file added models/lobby/hover_arrow_F.glb
Binary file not shown.
Binary file modified models/mountains.glb
Binary file not shown.
Binary file modified models/shell.glb
Binary file not shown.
Binary file modified models/trading_center.glb
Binary file not shown.
Binary file added models/wearables/AvatarWearables_TX 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Avatar_FemaleSkinBase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Blood.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/CyberSkiGlasses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Genesis_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Genesis_TX_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Suits.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Xmas_Emissive_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Xmas_TP_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/Xmas_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/A/Cyberlens_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added models/wearables/first_floor/A/Eyewear_Raver.glb
Binary file not shown.
Binary file added models/wearables/first_floor/A/Genesis_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/A/MANA_Eyewear.glb
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/first_floor/B/DCL_Black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/B/F_Hat_Foam.glb
Binary file not shown.
Binary file added models/wearables/first_floor/B/Image_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/B/Image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/B/MaleHat_DCL.glb
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/B/sunhat.glb
Binary file not shown.
Binary file added models/wearables/first_floor/C/Ddm_Mask2-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/wearables/first_floor/C/Genesis_TX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/first_floor/E/F_Hat_Elf.glb
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/first_floor/E/Xmas_TP_TX.png
Binary file added models/wearables/first_floor/E/Xmas_TX.png
Binary file not shown.
Binary file added models/wearables/first_floor/F/MaleHat_MANA.glb
Binary file not shown.
Binary file added models/wearables/first_floor/F/Umbrella_Hat.glb
Binary file not shown.
Binary file added models/wearables/first_floor/F/dcl-20.20.20.png
Binary file added models/wearables/first_floor/F/hat_of_wonder.png
Binary file added models/wearables/first_floor/FirstFloor.png
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/first_floor/G/Genesis_TX.png
Binary file added models/wearables/first_floor/G/Tiara_Bee.glb
Binary file not shown.
Binary file added models/wearables/halloween_stand.glb
Binary file not shown.
Binary file added models/wearables/second_floor/A/Blood.png
Binary file added models/wearables/second_floor/A/Genesis_TX.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/B/T_Fox001.png
Binary file added models/wearables/second_floor/B/Xmas_TX.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/C/Genesis_TX.png
Binary file added models/wearables/second_floor/C/asian_fox.glb
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/C/tropical_mask.glb
Binary file not shown.
Binary file added models/wearables/second_floor/D/DCL_Black.png
Binary file added models/wearables/second_floor/D/Genesis_TX.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/E/Genesis_TX.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/F/Genesis_TX.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/G/Genesis_TX.png
Binary file not shown.
Binary file added models/wearables/second_floor/J/Xmas_TX.png
Binary file not shown.
Binary file added models/wearables/second_floor/J/dcl-20.20.20.png
Binary file not shown.
Binary file added models/wearables/second_floor/J/fancy_jacket.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/wearables/second_floor/J/tuxedo-tx.png
Binary file not shown.
Binary file added models/wearables/second_floor/J/福沢諭吉.png
Binary file added models/wearables/second_floor/SecondFloor.png
Binary file added models/wearables/xmas_pullover.png
Binary file added models/wearables/xmas_stand.glb
Binary file not shown.
Binary file modified models/whale.glb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@dcl-sdk/utils": "latest",
"cannon": "latest",
"colyseus.js": "^0.14.15-alpha.0",
"dcl-npc-toolkit": "latest",
"dcl-npc-toolkit": "^1.2.2",
"dcl-ui-toolkit": "latest"
},
"bundleDependencies": [
Expand Down
Binary file added sounds/zenquencer/a3.mp3
Binary file not shown.
Binary file added sounds/zenquencer/a4.mp3
Binary file not shown.
Binary file added sounds/zenquencer/c3.mp3
Binary file not shown.
Binary file added sounds/zenquencer/e4.mp3
Binary file not shown.
Binary file added sounds/zenquencer/f3.mp3
Binary file not shown.
Binary file added sounds/zenquencer/f4.mp3
Binary file not shown.
Binary file added sounds/zenquencer/g4.mp3
Binary file not shown.
7 changes: 4 additions & 3 deletions src/connection/onConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,10 @@ function onLevelConnect(room: Room<clientState.NpcGameRoomState>) {
streamedMsgs.started = true
streamedMsgs.waitingForMore = false

streamedMsgsUiControl.start()
streamedMsgsUiControl.showNextText(nextPart)

utils.timers.setTimeout(() => {
streamedMsgsUiControl.start()
streamedMsgsUiControl.showNextText(nextPart)
}, 500)
// const dialog = createDialog(nextPart)
// let hasEmotion = nextPart.emotion ? true : false
// console.log("Emotions", "Do we have emotions?", hasEmotion, ":", nextPart);
Expand Down
45 changes: 33 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as sceneDataHelper from './utils/sceneDataHelper'
import { lowerVolume, outOfBar, placeJukeBox, setBarMusicOff, setBarMusicOn } from './modules/bar/jukebox'
import { addRepeatTrigger } from './modules/Utils'
import { log } from './back-ports/backPorts'
import { TRIGGER_LAYER_REGISTER_WITH_NO_LAYERS, barOffset, coreBuildingOffset } from './lobby/resources/globals'
import { TRIGGER_LAYER_REGISTER_WITH_NO_LAYERS, barOffset, basketballOffset, coreBuildingOffset, lobbyCenter } from './lobby/resources/globals'
import { initBarNpcs, initOutsideNpcs } from './modules/bar/npcs/barNpcs'
import { setupUi } from './ui'
import { placeDoors } from './modules/bar/doors'
Expand All @@ -30,6 +30,17 @@ import { isMovePlayerInProgress } from './back-ports/movePlayer'
import * as resources from './lobby/resources/resources'
import { getAndSetUserData, getAndSetUserDataIfNullNoWait, getUserDataFromLocal } from './utils/userData'
import { loadBeamMesh } from './lobby/beamPortal'
import { placeMuseumPieces } from './modules/museumItems'
import { addNFTs } from './modules/nftBuilder'
import { addRobots } from './modules/npcRobotBuilder'
import { addBarVideo } from './modules/barVideoScreen'
import { addAuditoriumVideo } from './modules/auditoriumScreen'
import { startArtichoke } from './modules/artichoke'
import { addWearables } from './modules/wearables'
import { addZenquencer } from './modules/zenquencer/zenquencer'
// import { addNFTs } from './modules/nftBuilder'
// import { placeMuseumPieces } from './modules/museumItems'
//import { placeMuseumPieces } from './modules/museumItems'

// export all the functions required to make the scene work
export * from '@dcl/sdk'
Expand All @@ -52,14 +63,9 @@ function insideBar() {
}

placeJukeBox()
addBarVideo()

if (!isBasketballAdded) {

// ADD BASKETBALL GAME

let physicsManager = new PhysicsManager(3)
isBasketballAdded = true
}

}

function exitBar() {
Expand All @@ -71,14 +77,29 @@ function exitBar() {
function addOutsideOfIfPlayerOutsideOnGround(){
const doIt = ()=>{
const playerPos = Transform.getOrNull(engine.PlayerEntity)
if(playerPos.position.y < 10){
// if(playerPos.position.y < 10){
console.log("index.ts", "addOutsideOfIfPlayerOutsideOnGround", "player on ground, init anything outside ground level")
const spawnDealy = 1000
initOutsideNpcs(spawnDealy)
placePlatforms()
}else{
console.log("index.ts", "addOutsideOfIfPlayerOutsideOnGround", "player not on ground")
}
placeMuseumPieces()
addNFTs()
addRobots()
addAuditoriumVideo()
startArtichoke()
addWearables()
addZenquencer()

if (!isBasketballAdded) {

// ADD BASKETBALL GAME

let physicsManager = new PhysicsManager(1)
isBasketballAdded = true
}
// }else{
// console.log("index.ts", "addOutsideOfIfPlayerOutsideOnGround", "player not on ground")
// }
}
//use timer to wait for player data
const timerId = utils.timers.setInterval(() => {
Expand Down
42 changes: 21 additions & 21 deletions src/lobby/beamPortal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,27 @@ export class TeleportController {

getRealm({}).then(
(value:GetRealmResponse) => {
if(value.realmInfo?.isPreview){
console.log("beamPortal.ts","temp.planes","getRealm is preview, adding planes for spawn and ceiling")
//START find the max height, help with visualizing how high we can go
let spawnAreaPlane = engine.addEntity()
//PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
const parcelMaxHeight = (Math.log((ParcelCountX*ParcelCountZ)) * Math.LOG2E) * 20
Transform.create(spawnAreaPlane,{
position: { x: triggerUpSpawnArea.x + (spawnRandomX/2) , y: lobbyHeight, z: triggerUpSpawnArea.z + (spawnRandomZ/2)},
scale: Vector3.create(spawnRandomX,spawnRandomZ,.1),
rotation: Quaternion.fromEulerDegrees(90,0,0)
})
//MeshCollider.setPlane(findCeilingPlane)
MeshRenderer.setPlane(spawnAreaPlane)
Material.setPbrMaterial(spawnAreaPlane, {
//texture: Material.Texture.,
albedoColor: Color4.fromHexString("#00000088"),
specularIntensity: 0,
metallic: 0,
roughness: 1
})
}
// if(value.realmInfo?.isPreview){
// console.log("beamPortal.ts","temp.planes","getRealm is preview, adding planes for spawn and ceiling")
// //START find the max height, help with visualizing how high we can go
// let spawnAreaPlane = engine.addEntity()
// //PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
// const parcelMaxHeight = (Math.log((ParcelCountX*ParcelCountZ)) * Math.LOG2E) * 20
// Transform.create(spawnAreaPlane,{
// position: { x: triggerUpSpawnArea.x + (spawnRandomX/2) , y: lobbyHeight, z: triggerUpSpawnArea.z + (spawnRandomZ/2)},
// scale: Vector3.create(spawnRandomX,spawnRandomZ,.1),
// rotation: Quaternion.fromEulerDegrees(90,0,0)
// })
// //MeshCollider.setPlane(findCeilingPlane)
// MeshRenderer.setPlane(spawnAreaPlane)
// Material.setPbrMaterial(spawnAreaPlane, {
// //texture: Material.Texture.,
// albedoColor: Color4.fromHexString("#00000088"),
// specularIntensity: 0,
// metallic: 0,
// roughness: 1
// })
// }
}
)

Expand Down
100 changes: 50 additions & 50 deletions src/lobby/cloudLobby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,55 +56,55 @@ export function addCloudLobby(){



getRealm({}).then(
(value:GetRealmResponse) => {
if(value.realmInfo?.isPreview){
console.log("cloudLobby.ts","temp.planes","getRealm is preview, adding planes for spawn and ceiling")
//START find the max height, help with visualizing how high we can go
let findCeilingPlane = engine.addEntity()
//PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
const parcelMaxHeight = (Math.log((ParcelCountX*ParcelCountZ)) * Math.LOG2E) * 20
Transform.create(findCeilingPlane,{
position: Vector3.create(lobbyCenter.x - coreBuildingOffset.x, parcelMaxHeight-.1, lobbyCenter.z - coreBuildingOffset.z),
scale: Vector3.create(30,30,.1),
rotation: Quaternion.fromEulerDegrees(90,0,0)
})
//MeshCollider.setPlane(findCeilingPlane)
MeshRenderer.setPlane(findCeilingPlane)
Material.setPbrMaterial(findCeilingPlane, {
//texture: Material.Texture.,
albedoColor: Color4.fromHexString("#00000088"),
specularIntensity: 0,
metallic: 0,
roughness: 1
})
//END find the max height, help with visualizing how high we can go

//START temporary spawn area
let cloudSpawnTempPlane = engine.addEntity()
//PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
//const parcelMaxHeight = lobbyHeight//(Math.log((4*5) + 1) * Math.LOG2E) * 20
Transform.create(cloudSpawnTempPlane,{
//taken from scene.json spawn to make sure is good spot
position: Vector3.create((36.5+27.5)/2, lobbyHeight, (30+26)/2),
scale: Vector3.create(30-26,36.5-27.5,.1),
rotation: Quaternion.fromEulerDegrees(90,0,90)
})
//MeshCollider.setPlane(cloudSpawnTempPlane)
MeshRenderer.setPlane(cloudSpawnTempPlane)
Material.setPbrMaterial(cloudSpawnTempPlane, {
//texture: Material.Texture.,
albedoColor: Color4.fromHexString("#00000088"),
specularIntensity: 0,
metallic: 0,
roughness: 1
})
//END temporary spawn
}else{
console.log("cloudLobby.ts","temp.planes","getRealm is NOT preview, NO temp planes for spawn and ceiling")
}
}
)
// getRealm({}).then(
// (value:GetRealmResponse) => {
// if(value.realmInfo?.isPreview){
// console.log("cloudLobby.ts","temp.planes","getRealm is preview, adding planes for spawn and ceiling")
// //START find the max height, help with visualizing how high we can go
// let findCeilingPlane = engine.addEntity()
// //PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
// const parcelMaxHeight = (Math.log((ParcelCountX*ParcelCountZ)) * Math.LOG2E) * 20
// Transform.create(findCeilingPlane,{
// position: Vector3.create(lobbyCenter.x - coreBuildingOffset.x, parcelMaxHeight-.1, lobbyCenter.z - coreBuildingOffset.z),
// scale: Vector3.create(30,30,.1),
// rotation: Quaternion.fromEulerDegrees(90,0,0)
// })
// //MeshCollider.setPlane(findCeilingPlane)
// MeshRenderer.setPlane(findCeilingPlane)
// Material.setPbrMaterial(findCeilingPlane, {
// //texture: Material.Texture.,
// albedoColor: Color4.fromHexString("#00000088"),
// specularIntensity: 0,
// metallic: 0,
// roughness: 1
// })
// //END find the max height, help with visualizing how high we can go

// //START temporary spawn area
// let cloudSpawnTempPlane = engine.addEntity()
// //PUT PARCEL SIZE HERE 4X5 FOR EXAMPLE
// //const parcelMaxHeight = lobbyHeight//(Math.log((4*5) + 1) * Math.LOG2E) * 20
// Transform.create(cloudSpawnTempPlane,{
// //taken from scene.json spawn to make sure is good spot
// position: Vector3.create((36.5+27.5)/2, lobbyHeight, (30+26)/2),
// scale: Vector3.create(30-26,36.5-27.5,.1),
// rotation: Quaternion.fromEulerDegrees(90,0,90)
// })
// //MeshCollider.setPlane(cloudSpawnTempPlane)
// MeshRenderer.setPlane(cloudSpawnTempPlane)
// Material.setPbrMaterial(cloudSpawnTempPlane, {
// //texture: Material.Texture.,
// albedoColor: Color4.fromHexString("#00000088"),
// specularIntensity: 0,
// metallic: 0,
// roughness: 1
// })
// //END temporary spawn
// }else{
// console.log("cloudLobby.ts","temp.planes","getRealm is NOT preview, NO temp planes for spawn and ceiling")
// }
// }
// )


/*
Expand Down Expand Up @@ -231,7 +231,7 @@ export function addCloudLobby(){
Quaternion.fromEulerDegrees(0,46,0),
getRegisteredAnalyticsEntity(ANALYTICS_ELEMENTS_IDS.eventsSlider),
menuManager,
1
2
)
crowdsMenu.updateCrowdsMenu(10)

Expand Down
4 changes: 2 additions & 2 deletions src/lobby/clouds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ function addCloudRotate(entity:Entity,left: boolean, speed: number) {

export function initClouds(){
addClouds(
16,
20,
8,
25,
Vector3.create(lobbyCenter.x - coreBuildingOffset.x, lobbyHeight, lobbyCenter.z - coreBuildingOffset.z)
)

Expand Down
16 changes: 12 additions & 4 deletions src/lobby/eventDetailsUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ let eventAnimFactor: number = 0
let tieredModalScale = 1
let tieredFontScale = 1
let tieredModalTextWrapScale = 1
let textWarpLimit = 43

export function setupEventDetailsUIScaling(inModalScale: number, inFontScale: number, inModalTextWrapScale: number) {
tieredModalScale = inModalScale
tieredFontScale = inFontScale
tieredModalTextWrapScale = inModalTextWrapScale
tieredModalTextWrapScale = inModalTextWrapScale
// textWarpLimit = 20

console.log("FONT SCALE: " + tieredFontScale )

// if(inModalScale > 1.0){
// textWarpLimit = 43
// }
}

export const uiEventDettails = () => (
Expand Down Expand Up @@ -178,11 +186,11 @@ export function displayEventUI(event: any) {

let rawTitle: string = event.name
rawTitle = cleanString(rawTitle)
rawTitle = wordWrap(rawTitle, 32 * tieredModalTextWrapScale, 2)
rawTitle = wordWrap(rawTitle, 28 , 2)

eventTitleText = rawTitle

eventDetailText = '\n\n' + wordWrap(cleanString(event.description), 43 * tieredModalTextWrapScale, 18) + '</cspace>'
eventDetailText = '\n\n' + wordWrap(cleanString(event.description), textWarpLimit , 18) + '</cspace>'

eventThumbnail = event.image

Expand All @@ -201,7 +209,7 @@ export function hideEventUI() {
let factor = 0
engine.addSystem((dt: number) => {
// hide event card ui if player is furhter from the slider menu
if (Transform.get(engine.PlayerEntity).position.z > 40) {
if (Transform.get(engine.PlayerEntity).position.z > 150) {
if (factor < 1) {
factor += dt * 4
if (factor > 1) {
Expand Down
Loading

0 comments on commit f259066

Please sign in to comment.