diff --git a/resources/config2/items.json b/resources/config2/items.json index 49ee77b..d4da837 100644 --- a/resources/config2/items.json +++ b/resources/config2/items.json @@ -4,43 +4,50 @@ "id": "phone", "name": "Телефон", "description": "Я не могу себе представить жизнь без своего телефона.", - "icon": "resources/w/ui/img/inv/ItemPhone001.png" + "icon": "resources/w/ui/img/inv/ItemPhone001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelPhone001.png" }, { "id": "journal", "name": "Журнал", "description": "Это мой журнал куда я вношу свои заметки.", - "icon": "resources/w/ui/img/inv/ItemJournal001.png" + "icon": "resources/w/ui/img/inv/ItemJournal001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelJournal001.png" }, { "id": "knife", "name": "Серебряный нож", "description": "Этот серебряный нож я одолжил у Айпери, и я должен его вернуть.", - "icon": "resources/w/ui/img/inv/ItemKnife001.png" + "icon": "resources/w/ui/img/inv/ItemKnife001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelKnife001.png" }, { "id": "book", "name": "Книга", "description": "Это книга о манасчи Жусупе Мамае.", - "icon": "resources/w/ui/img/inv/ItemBook001.png" + "icon": "resources/w/ui/img/inv/ItemBook001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelBook001.png" }, { "id": "note_spell", "name": "Записка", "description": "Тут написано \"Прочитай вслух когда настанет ночь, сквозь двери сможешь ты пройти.\" и текст заклинания.", - "icon": "resources/w/ui/img/inv/ItemNote001.png" + "icon": "resources/w/ui/img/inv/ItemNote001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelNote001.png" }, { "id": "report_card", "name": "Зачетка Бегимай", "description": "Это зачетная книжка Бегимай. Сюда нужно поставить оценку за курсовую работу.", - "icon": "resources/w/ui/img/inv/ItemSelReportCard001.png" + "icon": "resources/w/ui/img/inv/ItemReportCard001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelReportCard001.png" }, { "id": "coursework", "name": "Курсовая Бегимай", "description": "Это курсовая работа Бегимай, из-за которой она выбросилась из окна.", - "icon": "resources/w/ui/img/inv/ItemCoursework001.png" + "icon": "resources/w/ui/img/inv/ItemCoursework001.png", + "selectedIcon": "resources/w/ui/img/inv/ItemSelCoursework001.png" } ] } diff --git a/resources/config2/ui_inventory.json b/resources/config2/ui_inventory.json deleted file mode 100644 index b7a7e12..0000000 --- a/resources/config2/ui_inventory.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "root": { - "type": "FrameLayout", - "name": "inventory_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "FrameLayout", - "name": "inventory_items_panel", - "x": 50.0, - "y": 150.0, - "width": 320.0, - "height": 420.0, - "children": [ - { - "type": "StaticImage", - "name": "panel_background", - "x": 0.0, - "y": 0.0, - "width": 320.0, - "height": 420.0, - "texture": "resources/w/red.png" - }, - { - "type": "TextView", - "name": "inventory_title_text", - "x": 20.0, - "y": 18.0, - "width": 230.0, - "height": 34.0, - "text": "Inventory", - "fontSize": 24, - "fontPath": "resources/fonts/DroidSans.ttf", - "centered": false, - "topAligned": true, - "paddingX": 0.0, - "paddingY": 0.0, - "color": [1.0, 1.0, 1.0, 1.0] - }, - { - "type": "TextView", - "name": "inventory_items_text", - "x": 20.0, - "y": 70.0, - "width": 280.0, - "height": 320.0, - "text": "Inventory (Empty)", - "fontSize": 18, - "fontPath": "resources/fonts/DroidSans.ttf", - "centered": false, - "topAligned": true, - "wrap": true, - "paddingX": 0.0, - "paddingY": 0.0, - "maxLines": 14, - "color": [1.0, 1.0, 1.0, 1.0] - }, - { - "type": "TextButton", - "name": "close_inventory_button", - "x": 266.0, - "y": 16.0, - "width": 40.0, - "height": 40.0, - "text": "X", - "fontSize": 20, - "fontPath": "resources/fonts/DroidSans.ttf", - "textCentered": true, - "color": [1.0, 1.0, 1.0, 1.0], - "textures": { - "normal": "resources/w/blue.png", - "hover": "resources/w/blue.png", - "pressed": "resources/w/blue.png" - } - } - ] - } - ] - } -} diff --git a/resources/w/ui/hud_regular.json b/resources/w/ui/hud_regular.json deleted file mode 100644 index 76d8faa..0000000 --- a/resources/w/ui/hud_regular.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "children": [ - { - "type": "Button", - "name": "phoneButton", - "width": 229, - "height": 229, - "textures": { - "normal": "resources/w/ui/img/Phone001_State=Default.png", - "hover": "resources/w/ui/img/Phone001_State=Selected.png", - "pressed": "resources/w/ui/img/Phone001_State=Tap.png" - } - }, - { - "type": "Button", - "name": "journalButton", - "width": 229, - "height": 229, - "textures": { - "normal": "resources/w/ui/img/Phone001_State=Default.png", - "hover": "resources/w/ui/img/Phone001_State=Selected.png", - "pressed": "resources/w/ui/img/Phone001_State=Tap.png" - } - } - - ] - }] - } -} diff --git a/resources/w/ui/hud_step0.json b/resources/w/ui/hud_step0.json index ca625b8..10e949e 100644 --- a/resources/w/ui/hud_step0.json +++ b/resources/w/ui/hud_step0.json @@ -48,10 +48,10 @@ "name": "settingsButton", "horizontal_gravity": "right", "vertical_gravity": "top", - "x": -60, - "y": -60, - "width": 352, - "height": 352, + "x": -23, + "y": -35, + "width": 200, + "height": 200, "clickZoneWidth": 176, "clickZoneHeight": 176, "textures": { @@ -59,23 +59,6 @@ "hover": "resources/w/ui/img/Settings001_State=Selected001.png", "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" } - }, - { - "type": "Button", - "name": "inventoryButton", - "horizontal_gravity": "right", - "vertical_gravity": "top", - "x": 160, - "y": -48, - "width": 326, - "height": 326, - "clickZoneWidth": 151, - "clickZoneHeight": 151, - "textures": { - "normal": "resources/w/ui/img/Inventory001_State=Default001.png", - "hover": "resources/w/ui/img/Inventory001_State=Selected001.png", - "pressed": "resources/w/ui/img/Inventory001_State=Tap001.png" - } }, { "type": "StaticImage", diff --git a/resources/w/ui/hud_step1.json b/resources/w/ui/hud_step1.json index d5ef955..602511d 100644 --- a/resources/w/ui/hud_step1.json +++ b/resources/w/ui/hud_step1.json @@ -1,45 +1,47 @@ { - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "y" : 300, - "children": [ - { - "type": "StaticImage", - "name": "hint2", - "width": 440, - "height": 134, - "horizontal_gravity": "center", - "texture": "resources/w/ui/img/Hint2.png", - "pulse": { - "minScale": 0.92, - "maxScale": 1.08, - "periodMs": 1500 - }, - "fadeIn": { "durationMs": 600 } - } - ] - }, - { + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "vertical", + "vertical_align": "center", + "horizontal_align": "center", + "spacing": 0, + "width": "match_parent", + "height": 600, + "y": 300, + "children": [ + { + "type": "StaticImage", + "name": "hint2", + "width": 440, + "height": 134, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint2.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + } + ] + }, + { "type": "Button", "name": "settingsButton", "horizontal_gravity": "right", "vertical_gravity": "top", - "x": -60, - "y": -60, - "width": 352, - "height": 352, + "x": -23, + "y": -35, + "width": 200, + "height": 200, "clickZoneWidth": 176, "clickZoneHeight": 176, "textures": { @@ -48,32 +50,16 @@ "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" } }, - { - "type": "Button", - "name": "inventoryButton", - "horizontal_gravity": "right", - "vertical_gravity": "top", - "x": 160, - "y": -48, - "width": 326, - "height": 326, - "clickZoneWidth": 151, - "clickZoneHeight": 151, - "textures": { - "normal": "resources/w/ui/img/Inventory001_State=Default001.png", - "hover": "resources/w/ui/img/Inventory001_State=Selected001.png", - "pressed": "resources/w/ui/img/Inventory001_State=Tap001.png" - } - }, - { + { "type": "StaticImage", "name": "location", "width": 380, "height": 64, - "y" : 30, - "horizontal_gravity": "center", - "vertical_align": "top", + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", "texture": "resources/w/ui/img/Location_dorm.png" - }] - } -} + } + ] + } +} \ No newline at end of file diff --git a/resources/w/ui/hud_step2.json b/resources/w/ui/hud_step2.json index 493ce51..2c630dc 100644 --- a/resources/w/ui/hud_step2.json +++ b/resources/w/ui/hud_step2.json @@ -1,35 +1,65 @@ { - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "y" : 300, - "children": [ - { + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "vertical", + "vertical_align": "center", + "horizontal_align": "center", + "spacing": 0, + "width": "match_parent", + "height": 600, + "y": 300, + "children": [ + { + "type": "StaticImage", + "name": "hint3", + "width": 692, + "height": 312, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint3.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + } + ] + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { "type": "StaticImage", - "name": "hint3", - "width": 692, - "height": 312, - "horizontal_gravity": "center", - "texture": "resources/w/ui/img/Hint3.png", - "pulse": { - "minScale": 0.92, - "maxScale": 1.08, - "periodMs": 1500 - }, - "fadeIn": { "durationMs": 600 } + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" } - ] - }] - } -} + ] + } +} \ No newline at end of file diff --git a/resources/w/ui/hud_step3.json b/resources/w/ui/hud_step3.json index 2c377a9..31af76e 100644 --- a/resources/w/ui/hud_step3.json +++ b/resources/w/ui/hud_step3.json @@ -1,35 +1,65 @@ { - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "y" : 300, - "children": [ - { + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "vertical", + "vertical_align": "center", + "horizontal_align": "center", + "spacing": 0, + "width": "match_parent", + "height": 600, + "y": 300, + "children": [ + { + "type": "StaticImage", + "name": "hint4", + "width": 440, + "height": 134, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint4.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + } + ] + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { "type": "StaticImage", - "name": "hint4", - "width": 440, - "height": 134, - "horizontal_gravity": "center", - "texture": "resources/w/ui/img/Hint4.png", - "pulse": { - "minScale": 0.92, - "maxScale": 1.08, - "periodMs": 1500 - }, - "fadeIn": { "durationMs": 600 } + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" } - ] - }] - } -} + ] + } +} \ No newline at end of file diff --git a/resources/w/ui/hud_step4.json b/resources/w/ui/hud_step4.json index 1f11b20..c53fcb7 100644 --- a/resources/w/ui/hud_step4.json +++ b/resources/w/ui/hud_step4.json @@ -1,35 +1,65 @@ { - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "y" : 300, - "children": [ - { + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "vertical", + "vertical_align": "center", + "horizontal_align": "center", + "spacing": 0, + "width": "match_parent", + "height": 600, + "y": 300, + "children": [ + { + "type": "StaticImage", + "name": "hint5", + "width": 692, + "height": 312, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint5.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + } + ] + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { "type": "StaticImage", - "name": "hint5", - "width": 692, - "height": 312, - "horizontal_gravity": "center", - "texture": "resources/w/ui/img/Hint5.png", - "pulse": { - "minScale": 0.92, - "maxScale": 1.08, - "periodMs": 1500 - }, - "fadeIn": { "durationMs": 600 } + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" } - ] - }] - } -} + ] + } +} \ No newline at end of file diff --git a/resources/w/ui/hud_step5a.json b/resources/w/ui/hud_step5a.json index b80bad9..e527fb3 100644 --- a/resources/w/ui/hud_step5a.json +++ b/resources/w/ui/hud_step5a.json @@ -13,8 +13,8 @@ "spacing": 0, "width": "match_parent", "height": 600, - "y" : -250, - "x" : 300, + "y": -250, + "x": 300, "children": [ { "type": "StaticImage", @@ -34,24 +34,67 @@ } ] }, - { - "type": "Button", - "name": "phoneButton", - "horizontal_gravity": "right", - "vertical_gravity": "top", - "x": -46, - "y" :-46, - "width": 229, - "height": 229, - "clickZoneWidth": 104, - "clickZoneHeight": 104, - "textures": { - "normal": "resources/w/ui/img/Phone001_State=Default.png", - "hover": "resources/w/ui/img/Phone001_State=Selected.png", - "pressed": "resources/w/ui/img/Phone001_State=Tap.png" - } - } - + { + "type": "Button", + "name": "phoneButton", + "horizontal_gravity": "right", + "vertical_gravity": "bottom", + "x": -46, + "y": -46, + "width": 229, + "height": 229, + "clickZoneWidth": 104, + "clickZoneHeight": 104, + "textures": { + "normal": "resources/w/ui/img/Phone001_State=Default.png", + "hover": "resources/w/ui/img/Phone001_State=Selected.png", + "pressed": "resources/w/ui/img/Phone001_State=Tap.png" + } + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { + "type": "Button", + "name": "inventoryButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 110, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 151, + "clickZoneHeight": 151, + "textures": { + "normal": "resources/w/ui/img/Inventory001_State=Default001.png", + "hover": "resources/w/ui/img/Inventory001_State=Selected001.png", + "pressed": "resources/w/ui/img/Inventory001_State=Tap001.png" + } + }, + { + "type": "StaticImage", + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" + } ] } } \ No newline at end of file diff --git a/resources/w/ui/hud_step5ab.json b/resources/w/ui/hud_step5ab.json new file mode 100644 index 0000000..779fe25 --- /dev/null +++ b/resources/w/ui/hud_step5ab.json @@ -0,0 +1,132 @@ +{ + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "horizontal", + "vertical_align": "center", + "horizontal_align": "right", + "spacing": 16, + "width": "match_parent", + "height": 600, + "y": -200, + "children": [ + { + "type": "StaticImage", + "name": "hint6a", + "width": 440, + "height": 134, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint6a.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + }, + { + "type": "StaticImage", + "name": "hint6b", + "width": 440, + "height": 134, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint6b.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 + } + } + ] + }, + { + "type": "Button", + "name": "phoneButton", + "horizontal_gravity": "right", + "vertical_gravity": "bottom", + "x": -46, + "y": -46, + "width": 229, + "height": 229, + "clickZoneWidth": 104, + "clickZoneHeight": 104, + "textures": { + "normal": "resources/w/ui/img/Phone001_State=Default.png", + "hover": "resources/w/ui/img/Phone001_State=Selected.png", + "pressed": "resources/w/ui/img/Phone001_State=Tap.png" + } + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { + "type": "Button", + "name": "inventoryButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 110, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 151, + "clickZoneHeight": 151, + "textures": { + "normal": "resources/w/ui/img/Inventory001_State=Default001.png", + "hover": "resources/w/ui/img/Inventory001_State=Selected001.png", + "pressed": "resources/w/ui/img/Inventory001_State=Tap001.png" + } + }, + { + "type": "Button", + "name": "journalButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 220, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 89, + "clickZoneHeight": 89, + "textures": { + "normal": "resources/w/ui/img/Journal001_State=Default.png", + "hover": "resources/w/ui/img/Journal001_State=Selected.png", + "pressed": "resources/w/ui/img/Journal001_State=Tap.png" + } + }, + { + "type": "StaticImage", + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" + } + ] + } +} \ No newline at end of file diff --git a/resources/w/ui/hud_step5b.json b/resources/w/ui/hud_step5b.json index d52fb6a..318a81a 100644 --- a/resources/w/ui/hud_step5b.json +++ b/resources/w/ui/hud_step5b.json @@ -1,54 +1,99 @@ { - "root": { - "type": "FrameLayout", - "name": "hud_root", - "width": "match_parent", - "height": "match_parent", - "children": [ - { - "type": "LinearLayout", - "orientation": "vertical", - "vertical_align": "center", - "horizontal_align": "center", - "spacing": 0, - "width": "match_parent", - "height": 600, - "y" : -250, - "children": [ - { - "type": "StaticImage", - "name": "hint6b", - "width": 440, - "height": 134, - "horizontal_gravity": "center", - "texture": "resources/w/ui/img/Hint6b.png", - "pulse": { - "minScale": 0.92, - "maxScale": 1.08, - "periodMs": 1500 - }, - "fadeIn": { "durationMs": 600 } - } - ] - }, - { - "type": "Button", - "name": "journalButton", - "horizontal_gravity": "right", - "vertical_gravity": "top", - "x": -13, - "y" :-13, - "width": 163, - "height": 163, - "clickZoneWidth": 89, - "clickZoneHeight": 89, - "horizontal_gravity": "right", - "vertical_gravity": "top", - "textures": { - "normal": "resources/w/ui/img/Journal001_State=Default.png", - "hover": "resources/w/ui/img/Journal001_State=Selected.png", - "pressed": "resources/w/ui/img/Journal001_State=Tap.png" + "root": { + "type": "FrameLayout", + "name": "hud_root", + "width": "match_parent", + "height": "match_parent", + "children": [ + { + "type": "LinearLayout", + "orientation": "vertical", + "vertical_align": "center", + "horizontal_align": "center", + "spacing": 0, + "width": "match_parent", + "height": 600, + "y": -250, + "children": [ + { + "type": "StaticImage", + "name": "hint6b", + "width": 440, + "height": 134, + "horizontal_gravity": "center", + "texture": "resources/w/ui/img/Hint6b.png", + "pulse": { + "minScale": 0.92, + "maxScale": 1.08, + "periodMs": 1500 + }, + "fadeIn": { + "durationMs": 600 } - }] - } -} + } + ] + }, + { + "type": "Button", + "name": "settingsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": -23, + "y": -35, + "width": 200, + "height": 200, + "clickZoneWidth": 176, + "clickZoneHeight": 176, + "textures": { + "normal": "resources/w/ui/img/Settings001_State=Default001.png", + "hover": "resources/w/ui/img/Settings001_State=Selected001.png", + "pressed": "resources/w/ui/img/Settings001_State=Tap001.png" + } + }, + { + "type": "Button", + "name": "inventoryButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 110, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 151, + "clickZoneHeight": 151, + "textures": { + "normal": "resources/w/ui/img/Inventory001_State=Default001.png", + "hover": "resources/w/ui/img/Inventory001_State=Selected001.png", + "pressed": "resources/w/ui/img/Inventory001_State=Tap001.png" + } + }, + { + "type": "Button", + "name": "journalButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 220, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 89, + "clickZoneHeight": 89, + "textures": { + "normal": "resources/w/ui/img/Journal001_State=Default.png", + "hover": "resources/w/ui/img/Journal001_State=Selected.png", + "pressed": "resources/w/ui/img/Journal001_State=Tap.png" + } + }, + { + "type": "StaticImage", + "name": "location", + "width": 380, + "height": 64, + "y": 30, + "horizontal_gravity": "center", + "vertical_align": "top", + "texture": "resources/w/ui/img/Location_dorm.png" + } + ] + } +} \ No newline at end of file diff --git a/src/Game.cpp b/src/Game.cpp index 3afb58a..3d0382b 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -519,6 +519,7 @@ namespace ZL renderer.shaderManager.PushShader(defaultShaderName); renderer.RenderUniform1i(textureUniformName, 0); + renderer.RenderUniform1f("uAlpha", 1.0); float width = Environment::projectionWidth; float height = Environment::projectionHeight; @@ -749,6 +750,7 @@ namespace ZL case SDLK_l: //x = x - 1; //std::cout << "current x: " << x << std::endl; + std::cout << "Azimuth: " << currentLocation->cameraAzimuth << std::endl; std::cout << "Inclination: " << currentLocation->cameraInclination << std::endl; break; diff --git a/src/MenuManager.cpp b/src/MenuManager.cpp index 7c51e74..22d2050 100644 --- a/src/MenuManager.cpp +++ b/src/MenuManager.cpp @@ -32,6 +32,7 @@ namespace ZL { void MenuManager::setup(Inventory& inv, const std::string& zipFile) { inventory = &inv; + zipFile_ = zipFile; //hudRoot = loadUiFromFile("resources/config2/hud.json", renderer, zipFile); hudRoot = loadUiFromFile("resources/w/ui/hud_step0.json", renderer, zipFile); @@ -44,7 +45,6 @@ namespace ZL { hudStep5abRoot = loadUiFromFile("resources/w/ui/hud_step5ab.json", renderer, zipFile); phoneScreenRoot = loadUiFromFile("resources/w/ui/screen_phone.json", renderer, zipFile); journalScreenRoot= loadUiFromFile("resources/w/ui/screen_journal.json", renderer, zipFile); - inventoryRoot = loadUiFromFile("resources/config2/ui_inventory.json", renderer, zipFile); newInventoryRoot = loadUiFromFile("resources/w/ui/screen_inventory.json", renderer, zipFile); questJournalRoot = loadUiFromFile("resources/config2/ui_quest_journal.json", renderer, zipFile); @@ -76,26 +76,71 @@ namespace ZL { uiManager.pushMenuFromSavedRoot(newInventoryRoot); uiManager.setButtonCallback("inventoryExitButton", [this](const std::string&) { closeInventory(); - }); - /* - uiManager.pushMenuFromSavedRoot(inventoryRoot); - - uiManager.setTextButtonCallback("close_inventory_button", [this](const std::string&) { - closeInventory(); - }); + }); const auto& items = inventory->getItems(); - std::string itemText; - if (items.empty()) { - itemText = "Inventory (Empty)"; - } - else { - itemText = "Inventory (" + std::to_string(items.size()) + " items)\n\n"; - for (size_t i = 0; i < items.size(); ++i) { - itemText += std::to_string(i + 1) + ". " + items[i].name + "\n"; + const int maxSlots = 7; + + for (int i = 0; i < maxSlots; ++i) { + const std::string btnName = "item" + std::to_string(i + 1) + "Button"; + if (i < static_cast(items.size())) { + uiManager.setNodeVisible(btnName, true); + + auto btn = uiManager.findButton(btnName); + if (btn) { + auto tex = renderer.textureManager.LoadFromPng(items[i].icon, zipFile_, true); + btn->texNormal = btn->texHover = btn->texPressed = tex; + } + + uiManager.setButtonCallback(btnName, [this, i](const std::string&) { + selectInventoryItem(i); + }); + } else { + uiManager.setNodeVisible(btnName, false); } } - uiManager.setText("inventory_items_text", itemText);*/ + + inventorySelectedIndex_ = -1; + if (!items.empty()) { + selectInventoryItem(0); + } + } + + void MenuManager::selectInventoryItem(int index) { + const auto& items = inventory->getItems(); + if (index < 0 || index >= static_cast(items.size())) return; + + // Revert previously selected button to its regular icon + if (inventorySelectedIndex_ >= 0 && inventorySelectedIndex_ < static_cast(items.size())) { + const std::string prevBtnName = "item" + std::to_string(inventorySelectedIndex_ + 1) + "Button"; + auto prevBtn = uiManager.findButton(prevBtnName); + if (prevBtn) { + auto tex = renderer.textureManager.LoadFromPng(items[inventorySelectedIndex_].icon, zipFile_, true); + prevBtn->texNormal = prevBtn->texHover = prevBtn->texPressed = tex; + } + } + + inventorySelectedIndex_ = index; + const auto& item = items[index]; + + // Highlight newly selected button with its selected icon + const std::string btnName = "item" + std::to_string(index + 1) + "Button"; + auto btn = uiManager.findButton(btnName); + if (btn) { + const std::string& selPath = item.selectedIcon.empty() ? item.icon : item.selectedIcon; + auto tex = renderer.textureManager.LoadFromPng(selPath, zipFile_, true); + btn->texNormal = btn->texHover = btn->texPressed = tex; + } + + // Update the large selected picture on the right panel + auto img = uiManager.findStaticImage("selectedItemPic"); + if (img) { + const std::string& path = item.selectedIcon.empty() ? item.icon : item.selectedIcon; + img->texture = renderer.textureManager.LoadFromPng(path, zipFile_, true); + } + + uiManager.setText("selectedText", item.name); + uiManager.setText("selectedDescription", item.description); } void MenuManager::closeInventory() { @@ -180,6 +225,11 @@ namespace ZL { // and hides any hints that have already been completed. // Called after every replaceRoot during step 5. void MenuManager::setupStep5Callbacks() { + if (uiManager.findButton("inventoryButton")) { + uiManager.setButtonCallback("inventoryButton", [this](const std::string&) { + openInventory(); + }); + } if (uiManager.findButton("phoneButton")) { uiManager.setButtonCallback("phoneButton", [this](const std::string&) { openPhoneScreen(); diff --git a/src/MenuManager.h b/src/MenuManager.h index 2f9fa20..5efa547 100644 --- a/src/MenuManager.h +++ b/src/MenuManager.h @@ -66,11 +66,14 @@ namespace ZL { void enterGameplay(); void refreshQuestJournalUi(); void selectQuestByIndex(int index); + void selectInventoryItem(int index); void refreshItemPickupHud(); void setupStep5Callbacks(); GameState state = GameState::Gameplay; Inventory* inventory = nullptr; + std::string zipFile_; + int inventorySelectedIndex_ = -1; bool tutorialPhonePickedUp = false; bool tutorialJournalPickedUp = false; @@ -87,7 +90,6 @@ namespace ZL { std::shared_ptr hudStep5abRoot; std::shared_ptr phoneScreenRoot; std::shared_ptr journalScreenRoot; - std::shared_ptr inventoryRoot; std::shared_ptr newInventoryRoot; std::shared_ptr questJournalRoot; diff --git a/src/items/Item.h b/src/items/Item.h index 68a2c1c..ea2ff89 100644 --- a/src/items/Item.h +++ b/src/items/Item.h @@ -11,6 +11,7 @@ namespace ZL { std::string name; std::string description; std::string icon; + std::string selectedIcon; Item() = default; Item(const std::string& _id, const std::string& _name, const std::string& _desc, const std::string& _icon) diff --git a/src/items/ItemRegistry.cpp b/src/items/ItemRegistry.cpp index ad71600..cf992a1 100644 --- a/src/items/ItemRegistry.cpp +++ b/src/items/ItemRegistry.cpp @@ -54,6 +54,7 @@ void ItemRegistry::loadFromJson(const std::string& jsonPath, const std::string& entry.value("description", ""), entry.value("icon", "") ); + item.selectedIcon = entry.value("selectedIcon", ""); items_[id] = std::move(item); }