Working on phone ui

This commit is contained in:
Vladislav Khorev 2026-05-29 21:18:44 +03:00
parent 31130ec248
commit 3f5c4a381b
19 changed files with 608 additions and 28 deletions

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

@ -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

@ -81,7 +81,8 @@ 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);
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/w/ui/screen_journal.json", renderer, zipFile); questJournalRoot = loadUiFromFile("resources/w/ui/screen_journal.json", renderer, zipFile);
@ -201,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() {