diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index d8de7fc..9b3a8b2 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -168,7 +168,7 @@ func (pR *Room) updateScore() { pR.Score = calRoomScore(pR.EffectivePlayerCount, pR.Capacity, pR.State) } -func (pR *Room) AddPlayerIfPossible(pPlayerFromDbInit *Player, session *websocket.Conn, signalToCloseConnOfThisPlayer SignalToCloseConnCbType) bool { +func (pR *Room) AddPlayerIfPossible(pPlayerFromDbInit *Player, speciesId int, session *websocket.Conn, signalToCloseConnOfThisPlayer SignalToCloseConnCbType) bool { playerId := pPlayerFromDbInit.Id // TODO: Any thread-safety concern for accessing "pR" here? if RoomBattleStateIns.IDLE != pR.State && RoomBattleStateIns.WAITING != pR.State { @@ -180,7 +180,7 @@ func (pR *Room) AddPlayerIfPossible(pPlayerFromDbInit *Player, session *websocke return false } - defer pR.onPlayerAdded(playerId) + defer pR.onPlayerAdded(playerId, speciesId) pPlayerFromDbInit.UdpAddr = nil pPlayerFromDbInit.BattleUdpTunnelAddr = nil @@ -416,15 +416,6 @@ func (pR *Room) StartBattle() { pR.RenderFrameId = 0 - for _, player := range pR.Players { - speciesId := int(player.JoinIndex - 1) // FIXME: Hardcoded the values for now - if player.JoinIndex == 1 { - speciesId = 4096 - } - chosenCh := battle.Characters[speciesId] - pR.CharacterConfigsArr[player.JoinIndex-1] = chosenCh - pR.SpeciesIdList[player.JoinIndex-1] = int32(speciesId) - } Logger.Info("[StartBattle] ", zap.Any("roomId", pR.Id), zap.Any("roomState", pR.State), zap.Any("SpeciesIdList", pR.SpeciesIdList)) // Initialize the "collisionSys" as well as "RenderFrameBuffer" @@ -954,7 +945,7 @@ func (pR *Room) clearPlayerNetworkSession(playerId int32) { } } -func (pR *Room) onPlayerAdded(playerId int32) { +func (pR *Room) onPlayerAdded(playerId int32, speciesId int) { pR.EffectivePlayerCount++ if 1 == pR.EffectivePlayerCount { @@ -966,8 +957,9 @@ func (pR *Room) onPlayerAdded(playerId int32) { pR.Players[playerId].JoinIndex = int32(index) + 1 pR.JoinIndexBooleanArr[index] = true - speciesId := index // FIXME + pR.SpeciesIdList[index] = int32(speciesId) chosenCh := battle.Characters[speciesId] + pR.CharacterConfigsArr[index] = chosenCh pR.Players[playerId].Speed = chosenCh.Speed // Lazily assign the initial position of "Player" for "RoomDownsyncFrame". diff --git a/battle_srv/ws/serve.go b/battle_srv/ws/serve.go index 93efea9..e90da18 100644 --- a/battle_srv/ws/serve.go +++ b/battle_srv/ws/serve.go @@ -50,7 +50,17 @@ func Serve(c *gin.Context) { boundRoomId := 0 expectedRoomId := 0 + speciesId := 0 var err error + if speciesIdStr, hasSpeciesId := c.GetQuery("speciesId"); hasSpeciesId { + speciesId, err = strconv.Atoi(speciesIdStr) + if err != nil { + // TODO: Abort with specific message. + c.AbortWithStatus(http.StatusBadRequest) + return + } + } + if boundRoomIdStr, hasBoundRoomId := c.GetQuery("boundRoomId"); hasBoundRoomId { boundRoomId, err = strconv.Atoi(boundRoomIdStr) if err != nil { @@ -195,7 +205,7 @@ func Serve(c *gin.Context) { if pRoom.ReAddPlayerIfPossible(pPlayer, conn, signalToCloseConnOfThisPlayer) { playerSuccessfullyAddedToRoom = true - } else if pRoom.AddPlayerIfPossible(pPlayer, conn, signalToCloseConnOfThisPlayer) { + } else if pRoom.AddPlayerIfPossible(pPlayer, speciesId, conn, signalToCloseConnOfThisPlayer) { playerSuccessfullyAddedToRoom = true } else { Logger.Warn("Failed to get:\n", zap.Any("roomId", pRoom.Id), zap.Any("playerId", playerId), zap.Any("forExpectedRoomId", expectedRoomId)) @@ -219,7 +229,7 @@ func Serve(c *gin.Context) { } else { pRoom = tmpRoom Logger.Info("Successfully popped:\n", zap.Any("roomId", pRoom.Id), zap.Any("forPlayerId", playerId)) - res := pRoom.AddPlayerIfPossible(pPlayer, conn, signalToCloseConnOfThisPlayer) + res := pRoom.AddPlayerIfPossible(pPlayer, speciesId, conn, signalToCloseConnOfThisPlayer) if !res { signalToCloseConnOfThisPlayer(Constants.RetCode.PlayerNotAddableToRoom, fmt.Sprintf("AddPlayerIfPossible returns false for roomId == %v, playerId == %v!", pRoom.Id, playerId)) } diff --git a/frontend/assets/resources/animation/MonkGirl/Idle1.anim b/frontend/assets/resources/animation/MonkGirl/Idle1.anim index 9078bff..92459dc 100644 --- a/frontend/assets/resources/animation/MonkGirl/Idle1.anim +++ b/frontend/assets/resources/animation/MonkGirl/Idle1.anim @@ -59,6 +59,12 @@ "__uuid__": "0ecf4a0c-0f13-42fa-a214-b4826acd8556" } }, + { + "frame": 0.3, + "value": { + "__uuid__": "cabf9cb6-99ca-426d-9a23-95cdec6f06b9" + } + }, { "frame": 0.3333333333333333, "value": { diff --git a/frontend/assets/resources/prefabs/GameRule.prefab b/frontend/assets/resources/prefabs/GameRule.prefab index ca2174c..0e41b79 100644 --- a/frontend/assets/resources/prefabs/GameRule.prefab +++ b/frontend/assets/resources/prefabs/GameRule.prefab @@ -22,19 +22,22 @@ }, { "__id__": 5 + }, + { + "__id__": 68 } ], "_active": true, "_components": [ { - "__id__": 12 + "__id__": 75 }, { - "__id__": 13 + "__id__": 76 } ], "_prefab": { - "__id__": 14 + "__id__": 77 }, "_opacity": 255, "_color": { @@ -59,7 +62,7 @@ "ctor": "Float64Array", "array": [ 480, - 320, + 480, 0, 0, 0, @@ -194,7 +197,7 @@ }, { "__type__": "cc.Node", - "_name": "modeButton", + "_name": "Characters", "_objFlags": 0, "_parent": { "__id__": 1 @@ -202,13 +205,293 @@ "_children": [ { "__id__": 6 + }, + { + "__id__": 26 + }, + { + "__id__": 46 } ], "_active": true, "_components": [ { - "__id__": 9 + "__id__": 66 + } + ], + "_prefab": { + "__id__": 67 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 588, + "height": 150 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 116.744, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "MonkGirl", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 7 }, + { + "__id__": 17 + }, + { + "__id__": 21 + } + ], + "_active": true, + "_components": [ + { + "__id__": 24 + } + ], + "_prefab": { + "__id__": 25 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 194, + "height": 200 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -194, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "ChooseBtn", + "_objFlags": 0, + "_parent": { + "__id__": 6 + }, + "_children": [ + { + "__id__": 8 + } + ], + "_active": true, + "_components": [ + { + "__id__": 15 + } + ], + "_prefab": { + "__id__": 16 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 9 + } + ], + "_active": true, + "_components": [ + { + "__id__": 12 + }, + { + "__id__": 13 + } + ], + "_prefab": { + "__id__": 14 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Name", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_children": [], + "_active": true, + "_components": [ { "__id__": 10 } @@ -217,6 +500,2121 @@ "__id__": 11 }, "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 9 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "", + "_N$string": "", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "dcL55ieMNIgKCpGsALV0Eq", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ce319857-81b8-4ff7-b5b2-032e4faa3227" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "725c90f9-56f8-48ea-9159-4d2949cd3ce0" + }, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": false, + "alignMode": 1, + "_target": null, + "_alignFlags": 18, + "_left": 10, + "_right": 10, + "_top": 50, + "_bottom": 50, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "8e9F29QYxK9qQTPsrTUmq0", + "sync": false + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "_normalMaterial": { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + }, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 1, + "transition": 1, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "ce319857-81b8-4ff7-b5b2-032e4faa3227" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 8 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "bfMEUUAw5M+aOTyAOHhxP7", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "Anim", + "_objFlags": 0, + "_parent": { + "__id__": 6 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 18 + }, + { + "__id__": 19 + } + ], + "_prefab": { + "__id__": 20 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 58, + "height": 95 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -150, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "104ab450-fec3-4ea8-b6c0-aca74a826f5a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "725c90f9-56f8-48ea-9159-4d2949cd3ce0" + }, + "_id": "" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_defaultClip": { + "__uuid__": "a0d8b9a6-7bf7-4cf5-aecb-54b2908cbfb3" + }, + "_clips": [ + { + "__uuid__": "a0d8b9a6-7bf7-4cf5-aecb-54b2908cbfb3" + } + ], + "playOnLoad": true, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "0a/sIwORRJhqJLTlp4L8JS", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "ChosenFlag", + "_objFlags": 0, + "_parent": { + "__id__": 6 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 22 + } + ], + "_prefab": { + "__id__": 23 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 56, + "height": 64 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 45, + 55, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "69fa5b02-211c-4f30-8518-764440265567" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "12b+GZp1BBq5DEuBpW5fHJ", + "sync": false + }, + { + "__type__": "6dd2cBH+lxAgIIhJ/q/0nXW", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 6 + }, + "_enabled": true, + "panelNode": { + "__id__": 1 + }, + "chosenFlag": { + "__id__": 22 + }, + "avatarNode": { + "__id__": 15 + }, + "animNode": { + "__id__": 17 + }, + "speciesId": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "1b4/upSuJFnJLNcMhuHcVZ", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "KnifeGirl", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 27 + }, + { + "__id__": 37 + }, + { + "__id__": 41 + } + ], + "_active": true, + "_components": [ + { + "__id__": 44 + } + ], + "_prefab": { + "__id__": 45 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 194, + "height": 200 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "ChooseBtn", + "_objFlags": 0, + "_parent": { + "__id__": 26 + }, + "_children": [ + { + "__id__": 28 + } + ], + "_active": true, + "_components": [ + { + "__id__": 35 + } + ], + "_prefab": { + "__id__": 36 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 27 + }, + "_children": [ + { + "__id__": 29 + } + ], + "_active": true, + "_components": [ + { + "__id__": 32 + }, + { + "__id__": 33 + } + ], + "_prefab": { + "__id__": 34 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Name", + "_objFlags": 0, + "_parent": { + "__id__": 28 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 30 + } + ], + "_prefab": { + "__id__": 31 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "", + "_N$string": "", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "a4jAC/hoFFDL8D0SxnZbHV", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "53302a34-1aa0-4a3b-b7ee-41ced3fa4eb0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "579bc0c1-f5e2-4a5d-889b-9d567e53b0e6" + }, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": false, + "alignMode": 1, + "_target": null, + "_alignFlags": 18, + "_left": 10, + "_right": 10, + "_top": 50, + "_bottom": 50, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "33PRQOq6dMZ5bgDxrjVCKY", + "sync": false + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "_normalMaterial": { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + }, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 1, + "transition": 1, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "ce319857-81b8-4ff7-b5b2-032e4faa3227" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 28 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "3cL98O6UNGaZthkvikzZuk", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "Anim", + "_objFlags": 0, + "_parent": { + "__id__": 26 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 38 + }, + { + "__id__": 39 + } + ], + "_prefab": { + "__id__": 40 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 70, + "height": 128 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -150, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "b0f1ecf7-be41-46a8-bccb-92ee53b4ef88" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "579bc0c1-f5e2-4a5d-889b-9d567e53b0e6" + }, + "_id": "" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_defaultClip": { + "__uuid__": "5afe50e0-d03f-4d48-a7c0-a350c36e14d4" + }, + "_clips": [ + { + "__uuid__": "5afe50e0-d03f-4d48-a7c0-a350c36e14d4" + } + ], + "playOnLoad": true, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "797PtT02FPuY+3XUpGIBai", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "ChosenFlag", + "_objFlags": 0, + "_parent": { + "__id__": 26 + }, + "_children": [], + "_active": false, + "_components": [ + { + "__id__": 42 + } + ], + "_prefab": { + "__id__": 43 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 56, + "height": 64 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 45, + 55, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 41 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "69fa5b02-211c-4f30-8518-764440265567" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "9f+0f8+mdP1Y+7eivQxZwW", + "sync": false + }, + { + "__type__": "6dd2cBH+lxAgIIhJ/q/0nXW", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 26 + }, + "_enabled": true, + "panelNode": { + "__id__": 1 + }, + "chosenFlag": { + "__id__": 42 + }, + "avatarNode": { + "__id__": 35 + }, + "animNode": { + "__id__": 37 + }, + "speciesId": 1, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "f1bShkrMBFyI6EtwcV3o5j", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "Monk", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 47 + }, + { + "__id__": 57 + }, + { + "__id__": 61 + } + ], + "_active": true, + "_components": [ + { + "__id__": 64 + } + ], + "_prefab": { + "__id__": 65 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 194, + "height": 200 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 194, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "ChooseBtn", + "_objFlags": 0, + "_parent": { + "__id__": 46 + }, + "_children": [ + { + "__id__": 48 + } + ], + "_active": true, + "_components": [ + { + "__id__": 55 + } + ], + "_prefab": { + "__id__": 56 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 47 + }, + "_children": [ + { + "__id__": 49 + } + ], + "_active": true, + "_components": [ + { + "__id__": 52 + }, + { + "__id__": 53 + } + ], + "_prefab": { + "__id__": 54 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Name", + "_objFlags": 0, + "_parent": { + "__id__": 48 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 50 + } + ], + "_prefab": { + "__id__": 51 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 49 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "", + "_N$string": "", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "fai9f0eZFGFYzr5Kdn/WLF", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 48 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "98ac57b8-5e7b-4b57-82f5-812ffac396ec" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "6dcd5722-8ef9-47fd-9520-861d2713e274" + }, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 48 + }, + "_enabled": false, + "alignMode": 1, + "_target": null, + "_alignFlags": 18, + "_left": 10, + "_right": 10, + "_top": 50, + "_bottom": 50, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "4dGE6yxC1IhbLG4lQnzaCT", + "sync": false + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 47 + }, + "_enabled": true, + "_normalMaterial": { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + }, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 1, + "transition": 1, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "ce319857-81b8-4ff7-b5b2-032e4faa3227" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 48 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "986p1ZOI9IrqDiw9iYxCFG", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "Anim", + "_objFlags": 0, + "_parent": { + "__id__": 46 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 58 + }, + { + "__id__": 59 + } + ], + "_prefab": { + "__id__": 60 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 78, + "height": 111 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -150, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "a5c02b13-8d8b-42d1-830b-81b37d37afe5" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "6dcd5722-8ef9-47fd-9520-861d2713e274" + }, + "_id": "" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "_defaultClip": { + "__uuid__": "2d402c67-e47d-4de0-8a80-40bc12073ffc" + }, + "_clips": [ + { + "__uuid__": "2d402c67-e47d-4de0-8a80-40bc12073ffc" + } + ], + "playOnLoad": true, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "74YvNf/9lMJLDCnA/wp9Fp", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "ChosenFlag", + "_objFlags": 0, + "_parent": { + "__id__": 46 + }, + "_children": [], + "_active": false, + "_components": [ + { + "__id__": 62 + } + ], + "_prefab": { + "__id__": 63 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 56, + "height": 64 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 45, + 55, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 61 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "69fa5b02-211c-4f30-8518-764440265567" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "41e2dpmfBJiqiPaPZmw2j/", + "sync": false + }, + { + "__type__": "6dd2cBH+lxAgIIhJ/q/0nXW", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 46 + }, + "_enabled": true, + "panelNode": { + "__id__": 1 + }, + "chosenFlag": { + "__id__": 62 + }, + "avatarNode": { + "__id__": 55 + }, + "animNode": { + "__id__": 57 + }, + "speciesId": 4096, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "25zQsgABZLBqn+0VF9LlA+", + "sync": false + }, + { + "__type__": "cc.Layout", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_layoutSize": { + "__type__": "cc.Size", + "width": 588, + "height": 150 + }, + "_resize": 1, + "_N$layoutType": 1, + "_N$padding": 0, + "_N$cellSize": { + "__type__": "cc.Size", + "width": 40, + "height": 40 + }, + "_N$startAxis": 0, + "_N$paddingLeft": 3, + "_N$paddingRight": 3, + "_N$paddingTop": 0, + "_N$paddingBottom": 0, + "_N$spacingX": 0, + "_N$spacingY": 0, + "_N$verticalDirection": 1, + "_N$horizontalDirection": 0, + "_N$affectedByScale": false, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109" + }, + "fileId": "2acl3HXdlC3rBmEHk7YxIz", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "modeButton", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 69 + } + ], + "_active": true, + "_components": [ + { + "__id__": 72 + }, + { + "__id__": 73 + } + ], + "_prefab": { + "__id__": 74 + }, + "_opacity": 255, "_color": { "__type__": "cc.Color", "r": 255, @@ -239,7 +2637,7 @@ "ctor": "Float64Array", "array": [ 0, - -90.495, + -210.625, 0, 0, 0, @@ -268,17 +2666,17 @@ "_name": "Label", "_objFlags": 0, "_parent": { - "__id__": 5 + "__id__": 68 }, "_children": [], "_active": true, "_components": [ { - "__id__": 7 + "__id__": 70 } ], "_prefab": { - "__id__": 8 + "__id__": 71 }, "_opacity": 255, "_color": { @@ -332,7 +2730,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 6 + "__id__": 69 }, "_enabled": true, "_materials": [ @@ -373,7 +2771,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 5 + "__id__": 68 }, "_enabled": true, "_materials": [ @@ -407,7 +2805,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 5 + "__id__": 68 }, "_enabled": true, "_normalMaterial": null, @@ -470,7 +2868,7 @@ "hoverSprite": null, "_N$disabledSprite": null, "_N$target": { - "__id__": 5 + "__id__": 68 }, "_id": "" }, @@ -494,9 +2892,10 @@ }, "_enabled": true, "modeButton": { - "__id__": 10 + "__id__": 73 }, "mapNode": null, + "characterSelectCells": [], "_id": "" }, { diff --git a/frontend/assets/scenes/login.fire b/frontend/assets/scenes/login.fire index 1845bbb..76ce9c0 100644 --- a/frontend/assets/scenes/login.fire +++ b/frontend/assets/scenes/login.fire @@ -461,7 +461,7 @@ "array": [ 0, 0, - 216.50635094610968, + 223.42897822823446, 0, 0, 0, diff --git a/frontend/assets/scenes/offline_map.fire b/frontend/assets/scenes/offline_map.fire index 2ff806d..98b112c 100644 --- a/frontend/assets/scenes/offline_map.fire +++ b/frontend/assets/scenes/offline_map.fire @@ -547,7 +547,7 @@ "array": [ 0, 0, - 216.05530045313827, + 209.61049002258042, 0, 0, 0, diff --git a/frontend/assets/scripts/CharacterSelectCell.js b/frontend/assets/scripts/CharacterSelectCell.js new file mode 100644 index 0000000..2a940d9 --- /dev/null +++ b/frontend/assets/scripts/CharacterSelectCell.js @@ -0,0 +1,41 @@ +cc.Class({ + extends: cc.Component, + properties: { + panelNode: { + type: cc.Node, + default: null + }, + chosenFlag: { + type: cc.Sprite, + default: null + }, + avatarNode: { + type: cc.Button, + default: null + }, + animNode: { + type: cc.Node, + default: null + }, + speciesId: { + type: cc.Integer, + default: 0 + }, + }, + + ctor() {}, + + setInteractable(enabled) { + this.avatarNode.interactable = enabled; + }, + + onLoad() { + const avatarNodeClickEventHandler = new cc.Component.EventHandler(); + avatarNodeClickEventHandler.target = this.panelNode; + avatarNodeClickEventHandler.component = "GameRule"; + avatarNodeClickEventHandler.handler = "onSpeciesSelected"; + avatarNodeClickEventHandler.customEventData = this.speciesId; + this.avatarNode.clickEvents.push(avatarNodeClickEventHandler); + }, +}); + diff --git a/frontend/assets/scripts/CharacterSelectCell.js.meta b/frontend/assets/scripts/CharacterSelectCell.js.meta new file mode 100644 index 0000000..84362d1 --- /dev/null +++ b/frontend/assets/scripts/CharacterSelectCell.js.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "6dd2c047-fa5c-4080-8221-27fabfd275d6", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/frontend/assets/scripts/GameRule.js b/frontend/assets/scripts/GameRule.js index 5934d8d..4e98837 100644 --- a/frontend/assets/scripts/GameRule.js +++ b/frontend/assets/scripts/GameRule.js @@ -10,15 +10,29 @@ cc.Class({ type: cc.Node, default: null }, + characterSelectCells: { + type: cc.Node, + default: [] + }, }, // LIFE-CYCLE CALLBACKS: onLoad() { const modeBtnClickEventHandler = new cc.Component.EventHandler(); - modeBtnClickEventHandler.target = this.mapNode; + modeBtnClickEventHandler.target = this.mapNode; modeBtnClickEventHandler.component = "Map"; modeBtnClickEventHandler.handler = "onGameRule1v1ModeClicked"; this.modeButton.clickEvents.push(modeBtnClickEventHandler); - } - + }, + + onSpeciesSelected(val) { + for (let cell of this.characterSelectCells) { + const comp = cell.getComponent("CharacterSelectCell"); + if (cell.speciesId != val) { + cell.chosenFlag.active = false; + } else { + cell.chosenFlag.active = true; + } + } + }, }); diff --git a/nginx-templates/tsrht.lokcol.conf b/nginx-templates/tsrht.lokcol.conf index a223f1a..04ced7c 100644 --- a/nginx-templates/tsrht.lokcol.conf +++ b/nginx-templates/tsrht.lokcol.conf @@ -1,3 +1,5 @@ +# TODO: For websocket traffic, use a "consistent hash" on "expectedRoomId" and "boundRoomId"! + server { listen 80; server_name tsrht.lokcol.com;