Initial WhaleTown V2 frontend
This commit is contained in:
120
Config/RoomDecorCatalog.gd
Normal file
120
Config/RoomDecorCatalog.gd
Normal file
@@ -0,0 +1,120 @@
|
||||
class_name RoomDecorCatalog
|
||||
extends RefCounted
|
||||
|
||||
const ROOM_SCALE: float = 0.7
|
||||
const BED_DEFAULT_SCALE: float = ROOM_SCALE
|
||||
const BOOKSHELF_DEFAULT_SCALE: float = 0.12
|
||||
const FLOOR_RUG_DEFAULT_SCALE: float = 1.0
|
||||
const WALL_DECOR_DEFAULT_SCALE: float = 0.04
|
||||
|
||||
const DEFINITIONS: Dictionary = {
|
||||
"whale_floor_rug": {
|
||||
"decor_id": "whale_floor_rug",
|
||||
"name": "鲸浪地毯",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_whale_floor_rug.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_whale_floor_rug_roomfit.png",
|
||||
"default_position": Vector2(0, 161),
|
||||
"default_scale": FLOOR_RUG_DEFAULT_SCALE,
|
||||
"default_z_index": -8,
|
||||
},
|
||||
"whale_memory_board": {
|
||||
"decor_id": "whale_memory_board",
|
||||
"name": "鲸语记忆板",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_whale_memory_board.png",
|
||||
"default_position": Vector2(182, -207),
|
||||
"default_scale": 0.11,
|
||||
"default_z_index": -14,
|
||||
},
|
||||
"whale_tail_lamp": {
|
||||
"decor_id": "whale_tail_lamp",
|
||||
"name": "鲸尾暖灯",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_whale_tail_lamp.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_whale_tail_lamp_roomfit.png",
|
||||
"default_position": Vector2(231, -175),
|
||||
"default_scale": 1.0,
|
||||
"default_z_index": -10,
|
||||
"collision_size": Vector2(50, 32),
|
||||
"collision_offset": Vector2(0, 56),
|
||||
},
|
||||
"boat_cabin_bed": {
|
||||
"decor_id": "boat_cabin_bed",
|
||||
"name": "船舱小床",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_boat_cabin_bed.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_boat_cabin_bed_roomfit.png",
|
||||
"default_position": Vector2(-161, 25),
|
||||
"default_scale": BED_DEFAULT_SCALE,
|
||||
"default_z_index": -9,
|
||||
"collision_size": Vector2(220, 112),
|
||||
"collision_offset": Vector2(0, 52),
|
||||
},
|
||||
"low_wave_bed": {
|
||||
"decor_id": "low_wave_bed",
|
||||
"name": "海浪低床",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_low_wave_bed.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_low_wave_bed_roomfit.png",
|
||||
"default_position": Vector2(-98, 39),
|
||||
"default_scale": BED_DEFAULT_SCALE,
|
||||
"default_z_index": -9,
|
||||
"collision_size": Vector2(220, 112),
|
||||
"collision_offset": Vector2(0, 56),
|
||||
},
|
||||
"whale_tail_headboard_bed": {
|
||||
"decor_id": "whale_tail_headboard_bed",
|
||||
"name": "鲸尾床头床",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_whale_tail_headboard_bed.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_whale_tail_headboard_bed_roomfit.png",
|
||||
"default_position": Vector2(0, 32),
|
||||
"default_scale": BED_DEFAULT_SCALE,
|
||||
"default_z_index": -9,
|
||||
"collision_size": Vector2(214, 112),
|
||||
"collision_offset": Vector2(0, 62),
|
||||
},
|
||||
"dev_whale_bookshelf": {
|
||||
"decor_id": "dev_whale_bookshelf",
|
||||
"name": "程序员鲸书架",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_dev_whale_bookshelf.png",
|
||||
"texture": "res://assets/ui/mall/items/room_decor_dev_whale_bookshelf.png",
|
||||
"default_position": Vector2(-210, -39),
|
||||
"default_scale": BOOKSHELF_DEFAULT_SCALE,
|
||||
"default_z_index": -10,
|
||||
"collision_size": Vector2(626.667, 226.667),
|
||||
"collision_offset": Vector2(0, 580),
|
||||
},
|
||||
"datawhale_bug_feature_badge": {
|
||||
"decor_id": "datawhale_bug_feature_badge",
|
||||
"name": "BUG特性徽章",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_datawhale_bug_feature_badge.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_datawhale_bug_feature_badge_hires_clean.png",
|
||||
"default_position": Vector2(-210, -203),
|
||||
"default_scale": WALL_DECOR_DEFAULT_SCALE,
|
||||
"default_z_index": -14,
|
||||
},
|
||||
"datawhale_buddhist_learning_badge": {
|
||||
"decor_id": "datawhale_buddhist_learning_badge",
|
||||
"name": "佛系学习徽章",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_datawhale_buddhist_learning_badge.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_datawhale_buddhist_learning_badge_hires_clean.png",
|
||||
"default_position": Vector2(0, -203),
|
||||
"default_scale": WALL_DECOR_DEFAULT_SCALE,
|
||||
"default_z_index": -14,
|
||||
},
|
||||
"datawhale_ok_working_badge": {
|
||||
"decor_id": "datawhale_ok_working_badge",
|
||||
"name": "已经在做徽章",
|
||||
"icon": "res://assets/ui/mall/items/room_decor_datawhale_ok_working_badge.png",
|
||||
"texture": "res://assets/maps/personal_space/v1/decor/room_decor_datawhale_ok_working_badge_hires_clean.png",
|
||||
"default_position": Vector2(210, -203),
|
||||
"default_scale": WALL_DECOR_DEFAULT_SCALE,
|
||||
"default_z_index": -14,
|
||||
},
|
||||
}
|
||||
|
||||
static func get_definition(decorId: String) -> Dictionary:
|
||||
var definition: Variant = DEFINITIONS.get(decorId, {})
|
||||
return definition.duplicate(true) if definition is Dictionary else {}
|
||||
|
||||
static func get_all_definitions() -> Array[Dictionary]:
|
||||
var result: Array[Dictionary] = []
|
||||
for decorId in DEFINITIONS.keys():
|
||||
result.append(get_definition(str(decorId)))
|
||||
return result
|
||||
Reference in New Issue
Block a user