Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update worldmap ui #20

Merged
merged 4 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions bp-bgt-worldmap/UI/BG2/menu/world_map.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function getWorldmapAreaSize()
local screenWidth, screenHeight = Infinity_GetScreenSize()
Infinity_SetArea('map_backgrd', 20, 140, screenWidth-40, screenHeight-140)
Infinity_SetArea('map_painting', 40, 140+20, screenWidth-80, screenHeight-140-20-20)
Infinity_SetArea('backgrd_label', screenWidth/2-331, 20, 662, 100)
Infinity_SetArea('backgrd_text', screenWidth/2-331+8, 20+(100-74)/2, 184, 74)
Infinity_SetArea('backgrd_button', screenWidth/2-331+413, 20+(100-44)/2, 200, 44)
Infinity_SetArea('travel_button', screenWidth-300, screenHeight-120, 205, 44)
end

scaleWorldmap = {
{'SCALE_UI_LABEL',93704, 14, 0, 0, 0}
}
121 changes: 121 additions & 0 deletions bp-bgt-worldmap/UI/BG2/menu/world_map.menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
menu
{
name "WORLD_MAP"
align left top
onOpen
"
panelID = 6
selectedGraphicOpt = 1

for index, var in pairs(scaleWorldmap) do
var[5] = Infinity_GetOption(var[3], panelID)
var[6] = 0
if var[5] == 0 then
var[4] = 0
else
var[4] = 2
end
end
scaleWorldmap[selectedGraphicOpt][4] = toggleFrame(scaleWorldmap[selectedGraphicOpt][4])
if scaleWorldmap[selectedGraphicOpt][4] == 0 then
scaleWorldmap[selectedGraphicOpt][5] = 0
Infinity_ChangeOption(scaleWorldmap[selectedGraphicOpt][3], scaleWorldmap[selectedGraphicOpt][5], panelID )
scalewrld = 1
else
scaleWorldmap[selectedGraphicOpt][5] = 1
end
scaleWorldmap[selectedGraphicOpt][6] = 1
"
onClose
"
panelID = 6
selectedGraphicOpt = 1

for index, var in pairs(scaleWorldmap) do
var[5] = Infinity_GetOption(var[3], panelID)
var[6] = 0
if var[5] == 0 then
var[4] = 0
else
var[4] = 2
end
end
scaleWorldmap[selectedGraphicOpt][4] = toggleFrame(scaleWorldmap[selectedGraphicOpt][4])
if scaleWorldmap[selectedGraphicOpt][4] == 0 then
scaleWorldmap[selectedGraphicOpt][5] = 0
else
scaleWorldmap[selectedGraphicOpt][5] = 1
if scalewrld == 1 then
Infinity_ChangeOption(scaleWorldmap[selectedGraphicOpt][3], scaleWorldmap[selectedGraphicOpt][5], panelID )
scalewrld = 0
end
end
scaleWorldmap[selectedGraphicOpt][6] = 1
"
label
{
name "backgrd_label"
area 0 64 662 100
rectangle 4
rectangle opacity 150
text lua "getWorldmapAreaSize()"
}
text
{
name "backgrd_text"
area 701 72 184 74
text "WORLD_MAP_TITLE"
text style "label"
}
button
{
name "backgrd_button"
area 1106 88 200 44
bam GUIOSTLM
sequence 0
text style "button"
text "AREA_MAP_TITLE"
action
"
worldMapScreen:OnCancelButtonClick()
"
}
label
{
name "map_backgrd"
area 0 220 2048 1536
rectangle 4
rectangle opacity 150
}
map
{
name "map_painting"
area 20 240 2008 1496
worldmap
action
"
worldMapScreen:OnMapMouseDown(eventXCoord,eventYCoord)
"
actionDbl
"
worldMapScreen:TravelToSelected()
"
actionDrag
"
worldMapScreen:OnMapMouseMove(eventXCoord,eventYCoord)
"
}
button
{
name "travel_button"
area 1803 1690 205 44
enabled "worldMapScreen:IsTravelButtonVisible()"
bam GUIOSTUM
text "TRAVEL_BUTTON"
text style "button"
clickable lua "worldMapScreen:IsTravelButtonClickable()"
action "
worldMapScreen:TravelToSelected()
"
}
}
Binary file added bp-bgt-worldmap/UI/Dragonspear/DSBUT.BAM
Binary file not shown.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmpbg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmpbg2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmpl1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmplb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmplt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmprb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bp-bgt-worldmap/UI/Dragonspear/dswmprt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions bp-bgt-worldmap/UI/Dragonspear/menu/world_map.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
singleClickTravel = Infinity_GetINIValue('Game Options', 'Single Click Travel', 0) ~= 0
function getWorldmapAreaSize()
local screenWidth, screenHeight = Infinity_GetScreenSize()
factor = 0.02
left = screenWidth*factor
right = screenWidth*factor
top = screenWidth*factor
bottom = screenHeight*(1-factor)
rand = 4

Infinity_SetArea('map_painting', left+62+rand, top+81+rand, screenWidth-(left+62+rand)-(right+60+rand), bottom-(top+81+rand)-(70+rand))
Infinity_SetArea('backgrd_text', screenWidth/2-100, top+5, 200, 55) -- png 400x65
Infinity_SetArea('wmplt', left, top, screenWidth-(left)-(right+34), 410) -- png 3800x410
Infinity_SetArea('wmprt', screenWidth-(right+850), top, 850, bottom-top-screenHeight*0.05) -- png 850x2232
Infinity_SetArea('wmplb', left, bottom-385, screenWidth-(left+right+screenWidth*0.05), 385) -- png 3887x385
Infinity_SetArea('wmprb', screenWidth-(right+323), bottom-414, 323, 414) -- png 323x414
Infinity_SetArea('wmpl1', left, top+410, 72, bottom-top-410-screenHeight*0.05) -- png 72x1701
Infinity_SetArea('wmptext', screenWidth/2-200, top, 400, 65) -- png 348x56
Infinity_SetArea('traveltext', (screenWidth-left-right)*8/9-500, bottom-97, 500, 81) -- png 500x81
Infinity_SetArea('travel_button', (screenWidth-left-right)*8/9-440, bottom-79, 390, 44) -- bam 390x44
end
scaleWorldmap = {
{'SCALE_UI_LABEL',93704, 14, 0, 0, 0}
}
163 changes: 163 additions & 0 deletions bp-bgt-worldmap/UI/Dragonspear/menu/world_map.menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
menu
{
name "WORLD_MAP"
align left top
onOpen
"
panelID = 6
selectedGraphicOpt = 1

for index, var in pairs(scaleWorldmap) do
var[5] = Infinity_GetOption(var[3], panelID)
var[6] = 0
if var[5] == 0 then
var[4] = 0
else
var[4] = 2
end
end
scaleWorldmap[selectedGraphicOpt][4] = toggleFrame(scaleWorldmap[selectedGraphicOpt][4])
if scaleWorldmap[selectedGraphicOpt][4] == 0 then
scaleWorldmap[selectedGraphicOpt][5] = 0
Infinity_ChangeOption(scaleWorldmap[selectedGraphicOpt][3], scaleWorldmap[selectedGraphicOpt][5], panelID )
scalewrld = 1
else
scaleWorldmap[selectedGraphicOpt][5] = 1
end
scaleWorldmap[selectedGraphicOpt][6] = 1
"
onClose
"
panelID = 6
selectedGraphicOpt = 1

for index, var in pairs(scaleWorldmap) do
var[5] = Infinity_GetOption(var[3], panelID)
var[6] = 0
if var[5] == 0 then
var[4] = 0
else
var[4] = 2
end
end
scaleWorldmap[selectedGraphicOpt][4] = toggleFrame(scaleWorldmap[selectedGraphicOpt][4])
if scaleWorldmap[selectedGraphicOpt][4] == 0 then
scaleWorldmap[selectedGraphicOpt][5] = 0
else
scaleWorldmap[selectedGraphicOpt][5] = 1
if scalewrld == 1 then
Infinity_ChangeOption(scaleWorldmap[selectedGraphicOpt][3], scaleWorldmap[selectedGraphicOpt][5], panelID )
scalewrld = 0
end
end
scaleWorldmap[selectedGraphicOpt][6] = 1
"
label
{
name "map_backgrd"
area 0 220 2048 1536
-- rectangle 4
-- rectangle opacity 150
text lua "getWorldmapAreaSize()"
}
map
{
name "map_painting"
area 20 240 2008 1496
worldmap
action
"
worldMapScreen:OnMapMouseDown(eventXCoord,eventYCoord)
if singleClickTravel and worldMapScreen:IsTravelButtonClickable() then
worldMapScreen:TravelToSelected()
end
"
actionDbl
"
worldMapScreen:TravelToSelected()
"
actionDrag
"
worldMapScreen:OnMapMouseMove(eventXCoord,eventYCoord)
"
}
label
{
name "wmpl"
area 0 725 300 355
mosaic 'dswmpl'
align bottom left
}
label
{
name "wmplt"
area 0 725 3840 355
mosaic 'dswmplt'
align bottom left
}
label
{
name "wmprt"
area 0 725 3840 355
mosaic 'dswmprt'
align bottom left
}
label
{
name "wmplb"
area 0 725 3840 355
mosaic 'dswmplb'
align bottom left
}
label
{
name "wmprb"
area 0 725 3840 355
mosaic 'dswmprb'
align bottom left
}
label
{
name "wmpl1"
area 0 725 3840 355
mosaic 'dswmpl1'
align bottom left
}
label
{
name "wmptext"
area 0 725 3840 355
mosaic 'dswmpbg'
align bottom left
}
label
{
area 211 22 583 44
text "WORLD_MAP_TITLE"
text style "title"
name "backgrd_text"
align center center
}
label
{
name "traveltext"
area 0 725 3840 355
enabled "worldMapScreen:IsTravelButtonVisible()"
mosaic 'dswmpbg2'
align bottom left
}
button
{
name "travel_button"
area 783 715 230 40
enabled "worldMapScreen:IsTravelButtonVisible()"
bam DSBUT
text "TRAVEL_BUTTON"
text style "button"
clickable lua "worldMapScreen:IsTravelButtonClickable()"
action
"
worldMapScreen:TravelToSelected()
"
}
}
Binary file modified bp-bgt-worldmap/bam/bpbgtmap.bam
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1014.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1015.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1016.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1017.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1018.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1019.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1020.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1021.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1022.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1023.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1024.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1025.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1026.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1027.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1028.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1029.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1030.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1031.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1032.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1033.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1034.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1035.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1036.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/MOS1037.PVRZ
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/bpbgtmap.bam
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1000.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1001.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1002.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1003.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1004.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1005.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1006.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1007.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1008.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1009.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1010.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1011.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1012.pvrz
Binary file not shown.
Binary file modified bp-bgt-worldmap/bam/ee/mos1013.pvrz
Binary file not shown.