Compare commits

...

2 Commits

Author SHA1 Message Date
Vladislav Khorev
3f5c4a381b Working on phone ui 2026-05-29 21:18:44 +03:00
Vladislav Khorev
31130ec248 Working on stuff 2026-05-29 14:05:16 +03:00
23 changed files with 922 additions and 132 deletions

View File

@ -47,44 +47,6 @@
{ "id": "search_tracks", "text": "Найти следы возле каменной ограды", "completed": false }, { "id": "search_tracks", "text": "Найти следы возле каменной ограды", "completed": false },
{ "id": "report_elder", "text": "Вернуться к старосте", "completed": false } { "id": "report_elder", "text": "Вернуться к старосте", "completed": false }
] ]
},
{
"id": "main_find_ghost",
"title": "Следы призрака",
"category": "Main",
"status": "Active",
"recommendedLevel": 1,
"description": "В заброшенной части деревни появился странный призрак. Местные жители говорят, что он появляется только ночью и исчезает возле старого колодца. Похоже, дух пытается привести кого-то к месту, где много лет назад случилась трагедия.",
"objectives": [
{ "id": "talk_to_ghost", "text": "Поговорить с призраком возле старого дома", "completed": false },
{ "id": "inspect_well", "text": "Осмотреть старый колодец", "completed": false },
{ "id": "return_to_elder", "text": "Вернуться к старосте", "completed": false }
]
},
{
"id": "main_black_letter",
"title": "Письмо с чёрной печатью",
"category": "Main",
"status": "Active",
"recommendedLevel": 3,
"description": "В руки героя попало письмо с чёрной восковой печатью. Имя отправителя стёрто, но на бумаге остался запах дыма и дорогих трав. Письмо упоминает встречу у северных ворот и человека, который знает правду о призраке.",
"objectives": [
{ "id": "read_letter", "text": "Прочитать письмо", "completed": true },
{ "id": "go_north_gate", "text": "Добраться до северных ворот", "completed": false },
{ "id": "find_contact", "text": "Найти человека с серебряным кольцом", "completed": false }
]
},
{
"id": "side_herbalist_help",
"title": "Травы для лекаря",
"category": "Side",
"status": "Available",
"recommendedLevel": 1,
"description": "Лекарю нужны редкие болотные травы, чтобы приготовить настой для больных детей. Он предупредил, что растение раскрывается только на рассвете, а рядом часто появляются дикие звери.",
"objectives": [
{ "id": "collect_herbs", "text": "Собрать болотные травы на рассвете", "completed": false },
{ "id": "bring_herbs", "text": "Отнести травы лекарю", "completed": false }
]
} }
] ]
} }

BIN
resources/w/ui/img/phone/CharHeader001.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/ChatListItem001.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/ChatListItem002.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/ChatListItem003.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/ChatListUnread1.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/Phone.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/Phone002.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/PhoneChat001.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/PhoneChatList001.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/PhoneTest001.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/PhoneTest002.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/chat01_01in.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
resources/w/ui/img/phone/chat01_02out.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -18,7 +18,7 @@
}, },
{ {
"type": "Button", "type": "Button",
"name": "inventoryExitButton", "name": "journalExitButton",
"horizontal_gravity": "center", "horizontal_gravity": "center",
"vertical_gravity": "center", "vertical_gravity": "center",
"width": 90, "width": 90,
@ -52,7 +52,7 @@
"text": "Главное Задание 1", "text": "Главное Задание 1",
"textPaddingY": 4.0, "textPaddingY": 4.0,
"textPaddingX": 16.0, "textPaddingX": 16.0,
"fontSize": 32, "fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf", "fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false, "textCentered": false,
"topAligned": true, "topAligned": true,
@ -79,7 +79,7 @@
"text": "Задание 2", "text": "Задание 2",
"textPaddingY": 4.0, "textPaddingY": 4.0,
"textPaddingX": 16.0, "textPaddingX": 16.0,
"fontSize": 32, "fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf", "fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false, "textCentered": false,
"topAligned": true, "topAligned": true,
@ -106,7 +106,7 @@
"text": "Задание 3", "text": "Задание 3",
"textPaddingY": 4.0, "textPaddingY": 4.0,
"textPaddingX": 16.0, "textPaddingX": 16.0,
"fontSize": 32, "fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf", "fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false, "textCentered": false,
"topAligned": true, "topAligned": true,
@ -122,6 +122,138 @@
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png", "hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png" "pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
} }
},
{
"type": "TextButton",
"name": "item4name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
},
{
"type": "TextButton",
"name": "item5name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
},
{
"type": "TextButton",
"name": "item6name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
},
{
"type": "TextButton",
"name": "item7name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
},
{
"type": "TextButton",
"name": "item8name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
},
{
"type": "TextButton",
"name": "item9name",
"x": 0.0,
"y": 0.0,
"width": 270.0,
"height": 60.0,
"text": "",
"textPaddingY": 4.0,
"textPaddingX": 16.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [0.996, 0.977, 0.761, 1.0],
"textures": {
"normal": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"hover": "resources/w/ui/img/journal/ButtonBkgTransparent001.png",
"pressed": "resources/w/ui/img/journal/ButtonBkgTransparent001.png"
}
} }
] ]
}, },
@ -169,7 +301,7 @@
"children": [ "children": [
{ {
"type": "StaticImage", "type": "StaticImage",
"name": "background", "name": "objective1checkbox",
"width": 40, "width": 40,
"height": 40, "height": 40,
"texture": "resources/w/ui/img/journal/quest_objective_completed.png" "texture": "resources/w/ui/img/journal/quest_objective_completed.png"
@ -206,7 +338,7 @@
"children": [ "children": [
{ {
"type": "StaticImage", "type": "StaticImage",
"name": "background", "name": "objective2checkbox",
"width": 40, "width": 40,
"height": 40, "height": 40,
"texture": "resources/w/ui/img/journal/quest_objective_blank.png" "texture": "resources/w/ui/img/journal/quest_objective_blank.png"
@ -231,20 +363,57 @@
] ]
} }
] ]
},
{
"type": "LinearLayout",
"orientation": "horizontal",
"spacing": 10,
"x": 0,
"y": 0,
"width": 800,
"height": 40,
"children": [
{
"type": "StaticImage",
"name": "objective3checkbox",
"width": 40,
"height": 40,
"texture": "resources/w/ui/img/journal/quest_objective_blank.png"
},
{
"type": "TextView",
"name": "objective3name",
"paddingY": 20,
"width": 740.0,
"height": 60.0,
"text": "Цель 3",
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": false,
"wrap": true,
"color": [
0.996,
0.977,
0.761,
0.9
]
}
]
} }
] ]
}, },
{ {
"type": "TextView", "type": "TextView",
"name": "quest_description", "name": "quest_description",
"x": 170.0, "x": 140.0,
"y": 390.0, "y": 390.0,
"width": 1000.0, "width": 950.0,
"height": 300.0, "height": 300.0,
"horizontal_gravity": "center", "horizontal_gravity": "center",
"vertical_gravity": "top", "vertical_gravity": "top",
"text": "А все бегут бегут бегут бегут бегут бегут бегут бегут бегут бегут бегут а мы идем.", "text": "А все бегут бегут бегут бегут бегут бегут бегут бегут бегут бегут бегут а мы идем.",
"fontSize": 32, "fontSize": 20,
"fontPath": "resources/fonts/DroidSans.ttf", "fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false, "textCentered": false,
"topAligned": false, "topAligned": false,

View File

@ -1,25 +0,0 @@
{
"root": {
"type": "FrameLayout",
"name": "hud_root",
"width": "match_parent",
"height": "match_parent",
"vertical_align": "center",
"horizontal_align": "center",
"children": [
{
"type": "Button",
"name": "phoneExitButton",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"width": 1232,
"height": 627,
"textures": {
"normal": "resources/w/ui/img/PhoneTest001.png",
"hover": "resources/w/ui/img/PhoneTest001.png",
"pressed": "resources/w/ui/img/PhoneTest001.png"
}
}
]
}
}

View File

@ -0,0 +1,90 @@
{
"root": {
"type": "FrameLayout",
"name": "hud_root",
"width": "match_parent",
"height": "match_parent",
"vertical_align": "center",
"horizontal_align": "center",
"children": [
{
"type": "Button",
"name": "phoneExitButton",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": 0,
"width": "match_parent",
"height": "match_parent",
"textures": {
"normal": "resources/transparent.png",
"hover": "resources/transparent.png",
"pressed": "resources/transparent.png"
}
},
{
"type": "Button",
"name": "phoneMain",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": -60,
"width": 617.4,
"height": 991.2,
"textures": {
"normal": "resources/w/ui/img/phone/PhoneChat001.png",
"hover": "resources/w/ui/img/phone/PhoneChat001.png",
"pressed": "resources/w/ui/img/phone/PhoneChat001.png"
}
},
{
"type": "TextButton",
"name": "chatTitleButton",
"horizontal_gravity": "center",
"x": 0.0,
"y": 20.0,
"width": 446.25,
"height": 78.4,
"text": "Мама",
"textPaddingY": 16.0,
"textPaddingX": 140.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/CharHeader001.png",
"hover": "resources/w/ui/img/phone/CharHeader001.png",
"pressed": "resources/w/ui/img/phone/CharHeader001.png"
}
},
{
"type": "StaticImage",
"name": "message01in",
"width": 320.6,
"height": 103.6,
"x" : 430,
"y" : 100,
"horizontal_gravity": "left",
"vertical_gravity": "top",
"texture": "resources/w/ui/img/phone/chat01_01in.png"
},
{
"type": "StaticImage",
"name": "message02out",
"width": 116.2,
"height": 43.4,
"x" : 430,
"y" : 203.6,
"horizontal_gravity": "right",
"vertical_gravity": "top",
"texture": "resources/w/ui/img/phone/chat01_02out.png"
}
]
}
}

View File

@ -0,0 +1,241 @@
{
"root": {
"type": "FrameLayout",
"name": "hud_root",
"width": "match_parent",
"height": "match_parent",
"vertical_align": "center",
"horizontal_align": "center",
"children": [
{
"type": "Button",
"name": "phoneExitButton",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": 0,
"width": "match_parent",
"height": "match_parent",
"textures": {
"normal": "resources/transparent.png",
"hover": "resources/transparent.png",
"pressed": "resources/transparent.png"
}
},
{
"type": "Button",
"name": "phoneMain",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": -60,
"width": 617.4,
"height": 991.2,
"textures": {
"normal": "resources/w/ui/img/phone/Phone002.png",
"hover": "resources/w/ui/img/phone/Phone002.png",
"pressed": "resources/w/ui/img/phone/Phone002.png"
}
},
{
"type": "LinearLayout",
"orientation": "vertical",
"vertical_align": "top",
"horizontal_align": "center",
"spacing": 0,
"x": 0,
"y": 100,
"width": "match_parent",
"height": 800,
"children": [
{
"type": "FrameLayout",
"name": "chat1frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat1button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Мама",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem001.png",
"hover": "resources/w/ui/img/phone/ChatListItem001.png",
"pressed": "resources/w/ui/img/phone/ChatListItem001.png"
}
},
{
"type": "TextView",
"name": "chat1msg",
"x": 20.0,
"y": 30.0,
"width": 446.25,
"height": 88.2,
"text": "Я перевела тебе ...",
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
]
}
]
},
{
"type": "FrameLayout",
"name": "chat2frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat2button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Бишкек.Новости",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem002.png",
"hover": "resources/w/ui/img/phone/ChatListItem002.png",
"pressed": "resources/w/ui/img/phone/ChatListItem002.png"
}
},
{
"type": "TextButton",
"name": "chat2secondButton",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "В последнее время ...",
"textPaddingY": 40.0,
"textPaddingX": 100.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
],
"textures": {
"normal": "resources/transparent.png",
"hover": "resources/transparent.png",
"pressed": "resources/transparent.png"
}
}
]
},
{
"type": "FrameLayout",
"name": "chat3frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat3button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Айпери",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem003.png",
"hover": "resources/w/ui/img/phone/ChatListItem003.png",
"pressed": "resources/w/ui/img/phone/ChatListItem003.png"
}
},
{
"type": "StaticImage",
"name": "chat3Unread",
"x" : 408,
"y" : 24,
"width": 28.7,
"height": 28.7,
"texture": "resources/w/ui/img/phone/ChatListUnread1.png"
},
{
"type": "TextButton",
"name": "chat3secondButton",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Бекзат, ты должен ...",
"textPaddingY": 40.0,
"textPaddingX": 100.0,
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
],
"textures": {
"normal": "resources/transparent.png",
"hover": "resources/transparent.png",
"pressed": "resources/transparent.png"
}
}
]
}
]
}
]
}
}

View File

@ -0,0 +1,227 @@
{
"root": {
"type": "FrameLayout",
"name": "hud_root",
"width": "match_parent",
"height": "match_parent",
"vertical_align": "center",
"horizontal_align": "center",
"children": [
{
"type": "Button",
"name": "phoneExitButton",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": 0,
"width": "match_parent",
"height": "match_parent",
"textures": {
"normal": "resources/transparent.png",
"hover": "resources/transparent.png",
"pressed": "resources/transparent.png"
}
},
{
"type": "Button",
"name": "phoneMain",
"horizontal_gravity": "center",
"vertical_gravity": "center",
"y": -60,
"width": 617.4,
"height": 991.2,
"textures": {
"normal": "resources/w/ui/img/phone/PhoneChatList001.png",
"hover": "resources/w/ui/img/phone/PhoneChatList001.png",
"pressed": "resources/w/ui/img/phone/PhoneChatList001.png"
}
},
{
"type": "LinearLayout",
"orientation": "vertical",
"vertical_align": "top",
"horizontal_align": "center",
"spacing": 0,
"x": 0,
"y": 100,
"width": "match_parent",
"height": 800,
"children": [
{
"type": "FrameLayout",
"name": "chat1frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat1button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Мама",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem001.png",
"hover": "resources/w/ui/img/phone/ChatListItem001.png",
"pressed": "resources/w/ui/img/phone/ChatListItem001.png"
}
},
{
"type": "TextView",
"name": "chat1msg",
"x": 100.0,
"y": 36.0,
"width": 446.25,
"height": 88.2,
"text": "Я перевела тебе ...",
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
]
}
]
},
{
"type": "FrameLayout",
"name": "chat2frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat2button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Бишкек.Новости",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem002.png",
"hover": "resources/w/ui/img/phone/ChatListItem002.png",
"pressed": "resources/w/ui/img/phone/ChatListItem002.png"
}
},
{
"type": "TextView",
"name": "chat2msg",
"x": 100.0,
"y": 36.0,
"width": 446.25,
"height": 88.2,
"text": "В последнее время ...",
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
]
}
]
},
{
"type": "FrameLayout",
"name": "chat3frame",
"width": 446.25,
"height": 88.2,
"children": [
{
"type": "TextButton",
"name": "chat3button",
"x": 0.0,
"y": 0.0,
"width": 446.25,
"height": 88.2,
"text": "Айпери",
"textPaddingY": 0.0,
"textPaddingX": 100.0,
"fontSize": 32,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
1.0,
1.0,
1.0,
1.0
],
"textures": {
"normal": "resources/w/ui/img/phone/ChatListItem003.png",
"hover": "resources/w/ui/img/phone/ChatListItem003.png",
"pressed": "resources/w/ui/img/phone/ChatListItem003.png"
}
},
{
"type": "StaticImage",
"name": "chat3Unread",
"x" : 408,
"y" : 24,
"width": 28.7,
"height": 28.7,
"texture": "resources/w/ui/img/phone/ChatListUnread1.png"
},
{
"type": "TextView",
"name": "chat2msg",
"x": 100.0,
"y": 36.0,
"width": 446.25,
"height": 88.2,
"text": "Бекзат, ты должен ...",
"fontSize": 24,
"fontPath": "resources/fonts/DroidSans.ttf",
"textCentered": false,
"topAligned": true,
"wrap": true,
"color": [
0.8,
0.8,
0.8,
1.0
]
}
]
}
]
}
]
}
}

View File

@ -196,6 +196,7 @@ namespace ZL
uniInteriorParams.npcsJsonPath = "resources/config2/npcs_uni_interior.json"; uniInteriorParams.npcsJsonPath = "resources/config2/npcs_uni_interior.json";
uniInteriorParams.dialoguesJsonPath = "resources/dialogue/uni_interior_dialogues.json"; uniInteriorParams.dialoguesJsonPath = "resources/dialogue/uni_interior_dialogues.json";
/* /*
uniInteriorParams.navigationJsonPaths = { uniInteriorParams.navigationJsonPaths = {
"resources/navigation/uni_interior0_all_locked.txt", "resources/navigation/uni_interior0_all_locked.txt",
@ -703,9 +704,8 @@ namespace ZL
//if (audioPlayer) audioPlayer->stopMusicAsync(); //if (audioPlayer) audioPlayer->stopMusicAsync();
break; break;
case SDLK_f: case SDLK_f:
//currentLocation->dialogueSystem.startDialogue("test_choice_dialogue"); currentLocation->dialogueSystem.startDialogue("dialog_start001");
break; break;
case SDLK_e: case SDLK_e:
currentLocation->dialogueSystem.startCutscene("test_cutscene_01"); //.startDialogue("test_cutscene_pan_dialogue"); currentLocation->dialogueSystem.startCutscene("test_cutscene_01"); //.startDialogue("test_cutscene_pan_dialogue");
break; break;

View File

@ -1,4 +1,5 @@
#include "MenuManager.h" #include "MenuManager.h"
#include "render/TextRenderer.h"
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <string> #include <string>
@ -15,6 +16,44 @@ namespace ZL {
} }
} }
static int countWrappedLines(const std::string& text, const TextRenderer& tr, float maxWidth) {
if (text.empty()) return 1;
int lines = 0;
std::string currentLine;
auto flushLine = [&]() { ++lines; currentLine.clear(); };
auto pushWord = [&](const std::string& word) {
if (word.empty()) return;
if (currentLine.empty()) {
currentLine = word;
} else {
const std::string candidate = currentLine + " " + word;
if (tr.measureTextWidth(candidate) <= maxWidth) {
currentLine = candidate;
} else {
flushLine();
currentLine = word;
}
}
};
std::string currentWord;
for (char ch : text) {
if (ch == '\n') {
pushWord(currentWord); currentWord.clear(); flushLine();
} else if (ch == ' ' || ch == '\t' || ch == '\r') {
pushWord(currentWord); currentWord.clear();
} else {
currentWord.push_back(ch);
}
}
pushWord(currentWord);
if (!currentLine.empty()) flushLine();
return max(1, lines);
}
static std::array<float, 4> questStatusColor(Quest::QuestStatus status) { static std::array<float, 4> questStatusColor(Quest::QuestStatus status) {
switch (status) { switch (status) {
case Quest::QuestStatus::Completed: return { 0.25f, 0.95f, 0.35f, 1.0f }; case Quest::QuestStatus::Completed: return { 0.25f, 0.95f, 0.35f, 1.0f };
@ -42,10 +81,15 @@ namespace ZL {
hudStep5aRoot = loadUiFromFile("resources/w/ui/hud_step5a.json", renderer, zipFile); hudStep5aRoot = loadUiFromFile("resources/w/ui/hud_step5a.json", renderer, zipFile);
hudStep5bRoot = loadUiFromFile("resources/w/ui/hud_step5b.json", renderer, zipFile); hudStep5bRoot = loadUiFromFile("resources/w/ui/hud_step5b.json", renderer, zipFile);
hudStep5abRoot = loadUiFromFile("resources/w/ui/hud_step5ab.json", renderer, zipFile); hudStep5abRoot = loadUiFromFile("resources/w/ui/hud_step5ab.json", renderer, zipFile);
phoneScreenRoot = loadUiFromFile("resources/w/ui/screen_phone.json", renderer, zipFile); //phoneScreenRoot = loadUiFromFile("resources/w/ui/screen_phone_chat_list.json", renderer, zipFile);
journalScreenRoot= loadUiFromFile("resources/w/ui/screen_journal.json", renderer, zipFile); phoneScreenRoot = loadUiFromFile("resources/w/ui/screen_phone_chat.json", renderer, zipFile);
newInventoryRoot = loadUiFromFile("resources/w/ui/screen_inventory.json", renderer, zipFile); newInventoryRoot = loadUiFromFile("resources/w/ui/screen_inventory.json", renderer, zipFile);
questJournalRoot = loadUiFromFile("resources/config2/ui_quest_journal.json", renderer, zipFile); questJournalRoot = loadUiFromFile("resources/w/ui/screen_journal.json", renderer, zipFile);
texObjectiveCompleted_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/quest_objective_completed.png", zipFile, true);
texObjectiveBlank_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/quest_objective_blank.png", zipFile, true);
texItemSelected_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/ButtonBkg001.png", zipFile, true);
texItemTransparent_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/ButtonBkgTransparent001.png", zipFile, true);
questJournal.loadFromFile("resources/quests/quests.json", zipFile); questJournal.loadFromFile("resources/quests/quests.json", zipFile);
@ -104,17 +148,23 @@ namespace ZL {
void MenuManager::openQuestJournal() { void MenuManager::openQuestJournal() {
state = GameState::QuestJournal; state = GameState::QuestJournal;
tutorialJournalScreenOpened = true;
uiManager.setNodeVisible("hint6b", false);
uiManager.pushMenuFromSavedRoot(questJournalRoot); uiManager.pushMenuFromSavedRoot(questJournalRoot);
uiManager.setTextButtonCallback("quest_close_button", [this](const std::string&) { uiManager.setButtonCallback("journalExitButton", [this](const std::string&) {
closeQuestJournal(); closeQuestJournal();
}); });
static const char* kItemNames[9] = {
"item1name","item2name","item3name",
"item4name","item5name","item6name",
"item7name","item8name","item9name"
};
for (int i = 0; i < 9; ++i) { for (int i = 0; i < 9; ++i) {
const std::string slotName = "quest_slot_" + std::to_string(i); uiManager.setTextButtonCallback(kItemNames[i], [this, i](const std::string&) {
uiManager.setTextButtonCallback(slotName, [this, i](const std::string&) {
selectQuestByIndex(i); selectQuestByIndex(i);
}); });
} }
refreshQuestJournalUi(); refreshQuestJournalUi();
@ -152,6 +202,13 @@ namespace ZL {
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) { uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
closePhoneScreen(); closePhoneScreen();
}); });
uiManager.setButtonCallback("phoneMain", [this](const std::string&) {
//Keep the callback
});
uiManager.setTextButtonCallback("chat1button", [this](const std::string&) {
std::cout << "Hello test " << std::endl;
});
} }
void MenuManager::closePhoneScreen() { void MenuManager::closePhoneScreen() {
@ -159,22 +216,6 @@ namespace ZL {
uiManager.popMenu(); uiManager.popMenu();
} }
void MenuManager::openJournalScreen() {
state = GameState::JournalScreen;
tutorialJournalScreenOpened = true;
// Hide the journal hint on the current HUD so it stays hidden when we return.
uiManager.setNodeVisible("hint6b", false);
uiManager.pushMenuFromSavedRoot(journalScreenRoot);
uiManager.setButtonCallback("journalExitButton", [this](const std::string&) {
closeJournalScreen();
});
}
void MenuManager::closeJournalScreen() {
state = GameState::Gameplay;
uiManager.popMenu();
}
// Registers phoneButton / journalButton callbacks on the current HUD root // Registers phoneButton / journalButton callbacks on the current HUD root
// and hides any hints that have already been completed. // and hides any hints that have already been completed.
// Called after every replaceRoot during step 5. // Called after every replaceRoot during step 5.
@ -186,7 +227,7 @@ namespace ZL {
} }
if (uiManager.findButton("journalButton")) { if (uiManager.findButton("journalButton")) {
uiManager.setButtonCallback("journalButton", [this](const std::string&) { uiManager.setButtonCallback("journalButton", [this](const std::string&) {
openJournalScreen(); openQuestJournal();
}); });
} }
if (tutorialPhoneScreenOpened) uiManager.setNodeVisible("hint6a", false); if (tutorialPhoneScreenOpened) uiManager.setNodeVisible("hint6a", false);
@ -269,26 +310,57 @@ namespace ZL {
const int pb = questStatusPriority(b->status); const int pb = questStatusPriority(b->status);
if (pa != pb) return pa < pb; if (pa != pb) return pa < pb;
return a->orderIndex > b->orderIndex; return a->orderIndex > b->orderIndex;
}); });
static const char* kItemNames[9] = {
"item1name","item2name","item3name",
"item4name","item5name","item6name",
"item7name","item8name","item9name"
};
for (int i = 0; i < 9; ++i) { for (int i = 0; i < 9; ++i) {
const std::string slotName = "quest_slot_" + std::to_string(i);
if (i < static_cast<int>(quests.size())) { if (i < static_cast<int>(quests.size())) {
const auto* quest = quests[i]; const auto* quest = quests[i];
visibleQuestIds.push_back(quest->definition.id); visibleQuestIds.push_back(quest->definition.id);
const bool selected = (i == selectedQuestIndex); const bool selected = (i == selectedQuestIndex);
const std::string prefix = selected ? "> " : " ";
uiManager.setTextButtonText(slotName, prefix + quest->definition.title); std::array<float, 4> color;
uiManager.setTextButtonColor(slotName, questStatusColor(quest->status)); if (selected) {
uiManager.setNodeVisible(slotName, true); color = { 0.996f, 0.977f, 0.761f, 1.0f };
} } else if (quest->status == Quest::QuestStatus::Completed) {
else { color = { 0.02f, 0.875f, 0.447f, 0.6f };
uiManager.setTextButtonText(slotName, ""); } else if (quest->status == Quest::QuestStatus::Failed) {
uiManager.setNodeVisible(slotName, false); color = { 1.0f, 0.25f, 0.25f, 0.6f };
} else {
color = { 0.996f, 0.977f, 0.761f, 0.7f };
}
auto tb = uiManager.findTextButton(kItemNames[i]);
if (tb) {
auto tex = selected ? texItemSelected_ : texItemTransparent_;
tb->texNormal = tb->texHover = tb->texPressed = tex;
}
uiManager.setTextButtonText(kItemNames[i], quest->definition.title);
uiManager.setTextButtonColor(kItemNames[i], color);
uiManager.setNodeVisible(kItemNames[i], true);
auto node = uiManager.findNode(kItemNames[i]);
if (node && tb && tb->textRenderer) {
const float availW = node->width - 2.0f * tb->textPaddingX;
const int numLines = countWrappedLines(quest->definition.title, *tb->textRenderer, availW);
node->height = numLines * 30.0f + 30.0f;
}
} else {
uiManager.setTextButtonText(kItemNames[i], "");
uiManager.setNodeVisible(kItemNames[i], false);
auto node = uiManager.findNode(kItemNames[i]);
if (node) node->height = 60.0f;
} }
} }
uiManager.updateAllLayouts();
} }
void MenuManager::selectQuestByIndex(int index) { void MenuManager::selectQuestByIndex(int index) {
@ -304,28 +376,38 @@ namespace ZL {
const auto& def = quest->definition; const auto& def = quest->definition;
uiManager.setText("quest_middle_title_text", def.title); uiManager.setText("quest_title", def.title);
uiManager.setTextColor("quest_middle_title_text", questStatusColor(quest->status));
const std::string meta = std::string("Category: ") + Quest::toString(def.category) static const char* kCheckboxes[3] = { "objective1checkbox", "objective2checkbox", "objective3checkbox" };
+ " | Status: " + Quest::toString(quest->status) static const char* kObjNames[3] = { "objective1name", "objective2name", "objective3name" };
+ " | Level: " + std::to_string(def.recommendedLevel);
uiManager.setText("quest_meta_text", meta);
std::string objectivesText; for (int i = 0; i < 3; ++i) {
for (size_t i = 0; i < def.objectives.size(); ++i) { if (i < static_cast<int>(def.objectives.size())) {
const auto& obj = def.objectives[i]; const auto& obj = def.objectives[i];
const bool isActive = static_cast<int>(i) == quest->activeObjectiveIndex; const bool isActive = (i == quest->activeObjectiveIndex);
const std::string mark = obj.completed ? "[x] " : (isActive ? "> [ ] " : "[ ] ");
objectivesText += mark + obj.text; auto img = uiManager.findStaticImage(kCheckboxes[i]);
if (i + 1 < def.objectives.size()) { if (img) img->texture = obj.completed ? texObjectiveCompleted_ : texObjectiveBlank_;
objectivesText += "\n";
std::array<float, 4> color;
if (obj.completed) {
color = { 0.02f, 0.875f, 0.447f, 0.6f };
} else if (isActive) {
color = { 0.996f, 0.977f, 0.761f, 1.0f };
} else {
color = { 0.996f, 0.977f, 0.761f, 0.9f };
}
uiManager.setText(kObjNames[i], obj.text);
uiManager.setTextColor(kObjNames[i], color);
uiManager.setNodeVisible(kCheckboxes[i], true);
uiManager.setNodeVisible(kObjNames[i], true);
} else {
uiManager.setNodeVisible(kCheckboxes[i], false);
uiManager.setNodeVisible(kObjNames[i], false);
} }
} }
uiManager.setText("quest_objectives_text", objectivesText);
uiManager.setText("quest_lore_title_text", "Описание задания"); uiManager.setText("quest_description", def.description);
uiManager.setText("quest_description_text", def.description);
refreshQuestJournalUi(); refreshQuestJournalUi();
} }

View File

@ -17,8 +17,7 @@ namespace ZL {
Gameplay, Gameplay,
Inventory, Inventory,
QuestJournal, QuestJournal,
PhoneScreen, PhoneScreen
JournalScreen
}; };
enum class TutorialStep { enum class TutorialStep {
@ -51,8 +50,6 @@ namespace ZL {
void openPhoneScreen(); void openPhoneScreen();
void closePhoneScreen(); void closePhoneScreen();
void openJournalScreen();
void closeJournalScreen();
void advanceTutorialStep(); void advanceTutorialStep();
void onItemPickedUp(const std::string& itemId); void onItemPickedUp(const std::string& itemId);
@ -89,10 +86,14 @@ namespace ZL {
std::shared_ptr<UiNode> hudStep5bRoot; std::shared_ptr<UiNode> hudStep5bRoot;
std::shared_ptr<UiNode> hudStep5abRoot; std::shared_ptr<UiNode> hudStep5abRoot;
std::shared_ptr<UiNode> phoneScreenRoot; std::shared_ptr<UiNode> phoneScreenRoot;
std::shared_ptr<UiNode> journalScreenRoot;
std::shared_ptr<UiNode> newInventoryRoot; std::shared_ptr<UiNode> newInventoryRoot;
std::shared_ptr<UiNode> questJournalRoot; std::shared_ptr<UiNode> questJournalRoot;
std::shared_ptr<Texture> texObjectiveCompleted_;
std::shared_ptr<Texture> texObjectiveBlank_;
std::shared_ptr<Texture> texItemSelected_;
std::shared_ptr<Texture> texItemTransparent_;
int selectedQuestIndex = -1; int selectedQuestIndex = -1;
std::vector<std::string> visibleQuestIds; std::vector<std::string> visibleQuestIds;
}; };

View File

@ -194,6 +194,9 @@ namespace ZL {
if (tex && *tex) { if (tex && *tex) {
renderer.shaderManager.PushShader(defaultShaderName); renderer.shaderManager.PushShader(defaultShaderName);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
renderer.PushMatrix(); renderer.PushMatrix();
renderer.TranslateMatrix({ animOffsetX, animOffsetY, 0.0f }); renderer.TranslateMatrix({ animOffsetX, animOffsetY, 0.0f });
renderer.ScaleMatrix({ animScaleX, animScaleY, 1.0f }); renderer.ScaleMatrix({ animScaleX, animScaleY, 1.0f });
@ -204,6 +207,7 @@ namespace ZL {
renderer.PopMatrix(); renderer.PopMatrix();
renderer.shaderManager.PopShader(); renderer.shaderManager.PopShader();
glDisable(GL_BLEND);
} }