using 3D positions for GUI elements

This commit is contained in:
devZoGok
2024-05-18 11:47:56 +03:00
parent b4891fd890
commit 2dcc1973ae
86 changed files with 238 additions and 250 deletions
+20 -30
View File
@@ -12,9 +12,8 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'refineds', name = 'refineds',
text = '', text = '',
pos = {x = 100, y = 100}, pos = {x = 100, y = 100, z = 0},
zIndex = 0, scale = {x = 1, y = 1},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
@@ -24,21 +23,19 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'wealth', name = 'wealth',
text = '', text = '',
pos = {x = 100, y = 200}, pos = {x = 100, y = 200, z = 0},
zIndex = 0, scale = {x = 1, y = 1},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
color = {x = 1, y = 1, z = 1, w = 1} color = {x = 1, y = 0, z = 1, w = 1}
}, },
{ {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'research', name = 'research',
text = '', text = '',
pos = {x = 100, y = 300}, pos = {x = 100, y = 300, z = 0},
zIndex = 0, scale = {x = 1, y = 1},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
@@ -46,22 +43,19 @@ gui = {
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 0, y = 0}, pos = {x = 0, y = 0, z = 0},
zIndex = .9,
size = {x = s, y = s}, size = {x = s, y = s},
imagePath = resIconBasePath .. 'refineds.jpg', imagePath = resIconBasePath .. 'refineds.png',
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 0, y = 100}, pos = {x = 0, y = 100, z = 0},
zIndex = .9,
size = {x = s, y = s}, size = {x = s, y = s},
imagePath = resIconBasePath .. 'wealth.jpg', imagePath = resIconBasePath .. 'wealth.jpg',
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 0, y = 200}, pos = {x = 0, y = 200, z = 0},
zIndex = .9,
size = {x = s, y = s}, size = {x = s, y = s},
imagePath = resIconBasePath .. 'research.jpg', imagePath = resIconBasePath .. 'research.jpg',
}, },
@@ -69,9 +63,8 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'depth', name = 'depth',
text = '', text = '',
pos = {x = 0, y = 400}, pos = {x = 0, y = 400, z = 0},
zIndex = 0, scale = {x = 1, y = 1},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
@@ -82,29 +75,26 @@ gui = {
buttonType = ButtonType.PLAYER_TRADE, buttonType = ButtonType.PLAYER_TRADE,
name = 'Trade', name = 'Trade',
guiScreen = 'tradingHub.lua', guiScreen = 'tradingHub.lua',
pos = {x = res.x - Size.x, y = 200}, pos = {x = res.x - Size.x, y = 200, z = 0},
size = Size, size = Size,
trigger = 10 trigger = 10
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = res.x - sz, y = res.y - sz}, pos = {x = res.x - sz, y = res.y - sz, z = 0},
zIndex = .9,
size = {x = sz, y = sz}, size = {x = sz, y = sz},
color = {x = .6, y = .6, z = .6, w = .6} color = {x = .6, y = .6, z = .6, w = .4}
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 0, y = res.y - sz}, pos = {x = 0, y = res.y - sz, z = 0},
zIndex = .9,
size = {x = sz, y = sz}, size = {x = sz, y = sz},
color = {x = .6, y = .6, z = .6, w = .6} color = {x = .6, y = .6, z = .6, w = .4}
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = sz, y = res.y - .75 * sz}, pos = {x = sz, y = res.y - .75 * sz, z = 0},
zIndex = .9,
size = {x = res.x - 2 * sz, y = sz * .75}, size = {x = res.x - 2 * sz, y = sz * .75},
color = {x = .6, y = .6, z = .6, w = .6} color = {x = .6, y = .6, z = .6, w = .4}
}, },
} }
+5 -5
View File
@@ -1,12 +1,12 @@
numGui = 5 numGui = 5
gui = { gui = {
{ {
pos = {x = 110, y = 90}, pos = {x = 110, y = 90, z = 0},
size = {x = 100, y = 10}, size = {x = 100, y = 10},
guiType = GuiType.TEXTBOX, guiType = GuiType.TEXTBOX,
}, },
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = {x = 100, y = 10}, size = {x = 100, y = 10},
guiType = GuiType.SLIDER, guiType = GuiType.SLIDER,
minValue = 0, minValue = 0,
@@ -17,21 +17,21 @@ gui = {
} }
}, },
{ {
pos = {x = 100, y = 400}, pos = {x = 100, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
buttonType = ButtonType.OK buttonType = ButtonType.OK
}, },
{ {
pos = {x = 260, y = 400}, pos = {x = 260, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Restore defaults', name = 'Restore defaults',
buttonType = ButtonType.DEFAULTS buttonType = ButtonType.DEFAULTS
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+3 -3
View File
@@ -1,7 +1,7 @@
numGui = 3 numGui = 3
gui = { gui = {
{ {
pos = {x = 100, y = 100}, pos = {x = 100, y = 100, z = 0},
size = {x = 300, y = 20}, size = {x = 300, y = 20},
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.CONSOLE, listboxType = ListboxType.CONSOLE,
@@ -9,12 +9,12 @@ gui = {
closable = false closable = false
}, },
{ {
pos = {x = 100, y = 510}, pos = {x = 100, y = 510, z = 0},
size = {x = 270, y = 20}, size = {x = 270, y = 20},
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 380, y = 510}, pos = {x = 380, y = 510, z = 0},
size = {x = 20, y = 20}, size = {x = 20, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.CONSOLE_COMMAND_OK, buttonType = ButtonType.CONSOLE_COMMAND_OK,
+4 -4
View File
@@ -1,28 +1,28 @@
numGui = 4 numGui = 4
gui = { gui = {
{ {
pos = {x = 110, y = 190}, pos = {x = 110, y = 190, z = 0},
size = {x = 360, y = 20}, size = {x = 360, y = 20},
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.CONTROLS, listboxType = ListboxType.CONTROLS,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = 100, y = 400}, pos = {x = 100, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
buttonType = ButtonType.OK buttonType = ButtonType.OK
}, },
{ {
pos = {x = 260, y = 400}, pos = {x = 260, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Restore defaults', name = 'Restore defaults',
buttonType = ButtonType.DEFAULTS buttonType = ButtonType.DEFAULTS
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+3 -5
View File
@@ -5,8 +5,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Defeat', text = 'Defeat',
name = 'D', name = 'D',
pos = {x = 100, y = 100}, pos = {x = 100, y = 100, z = 0},
zIndex = 0,
scale = 1, scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
@@ -15,13 +14,12 @@ gui = {
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 100, y = 200}, pos = {x = 100, y = 200, z = .1},
zIndex = 1,
size = {x = 600, y = 600}, size = {x = 600, y = 600},
color = {x = 0, y = 0, z = 0, w = 0.1} color = {x = 0, y = 0, z = 0, w = 0.1}
}, },
{ {
pos = {x = 110, y = 350}, pos = {x = 110, y = 350, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Leave', name = 'Leave',
+6 -6
View File
@@ -5,42 +5,42 @@ sz = {x = Size.x - margin, y = Size.y - margin}
gui = { gui = {
{ {
pos = {x = res.x - 3 * Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x - 3 * Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
trigger = 76, trigger = 76,
}, },
{ {
pos = {x = res.x - 2 * Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x - 2 * Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
trigger = 78, trigger = 78,
}, },
{ {
pos = {x = res.x - 1 * Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x - 1 * Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
trigger = 77, trigger = 77,
}, },
{ {
pos = {x = res.x - 3 * Size.x, y = res.y - 2 * Size.y}, pos = {x = res.x - 3 * Size.x, y = res.y - 2 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
trigger = 84, trigger = 84,
}, },
{ {
pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y}, pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
trigger = 68, trigger = 68,
}, },
{ {
pos = {x = res.x - 1 * Size.x, y = res.y - 2 * Size.y}, pos = {x = res.x - 1 * Size.x, y = res.y - 2 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BUILD, buttonType = ButtonType.BUILD,
+1 -1
View File
@@ -5,7 +5,7 @@ sz = {x = Size.x - margin, y = Size.y - margin}
gui = { gui = {
{ {
pos = {x = res.x - Size.x + .5 * margin, y = res.y - Size.y + .5 * margin}, pos = {x = res.x - Size.x + .5 * margin, y = res.y - Size.y + .5 * margin, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.FORT_TRAIN, buttonType = ButtonType.FORT_TRAIN,
+5 -5
View File
@@ -2,35 +2,35 @@ Size = {x = 150, y = 50}
numGui = 5 numGui = 5
gui = { gui = {
{ {
pos = {x = 100, y = 100}, pos = {x = 100, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.RESUME, buttonType = ButtonType.RESUME,
name = 'Resume' name = 'Resume'
}, },
{ {
pos = {x = 100, y = 100 + 1 * (Size.y + 10)}, pos = {x = 100, y = 100 + 1 * (Size.y + 10), z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.CONSOLE, buttonType = ButtonType.CONSOLE,
name = 'Console' name = 'Console'
}, },
{ {
pos = {x = 100, y = 100 + 2 * (Size.y + 10)}, pos = {x = 100, y = 100 + 2 * (Size.y + 10), z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.OPTIONS, buttonType = ButtonType.OPTIONS,
name = 'Options' name = 'Options'
}, },
{ {
pos = {x = 100, y = 100 + 3 * (Size.y + 10)}, pos = {x = 100, y = 100 + 3 * (Size.y + 10), z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.MAIN_MENU, buttonType = ButtonType.MAIN_MENU,
name = 'Main menu' name = 'Main menu'
}, },
{ {
pos = {x = 100, y = 100 + 4 * (Size.y + 10)}, pos = {x = 100, y = 100 + 4 * (Size.y + 10), z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.EXIT, buttonType = ButtonType.EXIT,
+6 -6
View File
@@ -3,42 +3,42 @@ Size = {x = 150, y = 40}
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40}, z = 0,
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Controls', name = 'Controls',
buttonType = ButtonType.CONTROLS_TAB buttonType = ButtonType.CONTROLS_TAB
}, },
{ {
pos = {x = 270, y = 40}, pos = {x = 270, y = 40}, z = 0,
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Mouse', name = 'Mouse',
buttonType = ButtonType.MOUSE_TAB buttonType = ButtonType.MOUSE_TAB
}, },
{ {
pos = {x = 430, y = 40}, pos = {x = 430, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Video', name = 'Video',
buttonType = ButtonType.VIDEO_TAB buttonType = ButtonType.VIDEO_TAB
}, },
{ {
pos = {x = 590, y = 40}, pos = {x = 590, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Audio', name = 'Audio',
buttonType = ButtonType.AUDIO_TAB buttonType = ButtonType.AUDIO_TAB
}, },
{ {
pos = {x = 750, y = 40}, pos = {x = 750, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Multiplayer', name = 'Multiplayer',
buttonType = ButtonType.MULTIPLAYER_TAB buttonType = ButtonType.MULTIPLAYER_TAB
}, },
{ {
pos = {x = 910, y = 100}, pos = {x = 910, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+3 -3
View File
@@ -5,21 +5,21 @@ sz = {x = Size.x - margin, y = Size.y - margin}
gui = { gui = {
{ {
pos = {x = res.x + .5 * margin - Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x + .5 * margin - Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.LAND_FACTORY_TRAIN, buttonType = ButtonType.LAND_FACTORY_TRAIN,
trigger = 87 trigger = 87
}, },
{ {
pos = {x = res.x + .5 * margin - 2 * Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x + .5 * margin - 2 * Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.LAND_FACTORY_TRAIN, buttonType = ButtonType.LAND_FACTORY_TRAIN,
trigger = 84 trigger = 84
}, },
{ {
pos = {x = res.x + .5 * margin - 3 * Size.x, y = res.y - 3 * Size.y}, pos = {x = res.x + .5 * margin - 3 * Size.x, y = res.y - 3 * Size.y, z = 0},
size = sz, size = sz,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.LAND_FACTORY_TRAIN, buttonType = ButtonType.LAND_FACTORY_TRAIN,
+3 -3
View File
@@ -1,14 +1,14 @@
numGui = 3 numGui = 3
gui = { gui = {
{ {
pos = {x = 110, y = 190}, pos = {x = 110, y = 190, z = 0},
size = {x = 360, y = 20}, size = {x = 360, y = 20},
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.MAPS, listboxType = ListboxType.MAPS,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = 110, y = 250}, pos = {x = 110, y = 250, z = 0},
size = {x = 140, y = 40}, size = {x = 140, y = 40},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
@@ -19,7 +19,7 @@ gui = {
} }
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 50}, size = {x = 150, y = 50},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+4 -4
View File
@@ -3,28 +3,28 @@ Size = {x = 150, y = 40}
numGui = 4 numGui = 4
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Single player', name = 'Single player',
buttonType = ButtonType.SINGLE_PLAYER buttonType = ButtonType.SINGLE_PLAYER
}, },
{ {
pos = {x = 110, y = 90}, pos = {x = 110, y = 90, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Map editor', name = 'Map editor',
buttonType = ButtonType.MAP_EDITOR buttonType = ButtonType.MAP_EDITOR
}, },
{ {
pos = {x = 110, y = 140}, pos = {x = 110, y = 140, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Options', name = 'Options',
buttonType = ButtonType.OPTIONS buttonType = ButtonType.OPTIONS
}, },
{ {
pos = {x = 110, y = 190}, pos = {x = 110, y = 190, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Exit', name = 'Exit',
+6 -6
View File
@@ -3,42 +3,42 @@ Size = {x = 150, y = 40}
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Controls', name = 'Controls',
buttonType = ButtonType.CONTROLS_TAB buttonType = ButtonType.CONTROLS_TAB
}, },
{ {
pos = {x = 270, y = 40}, pos = {x = 270, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Mouse', name = 'Mouse',
buttonType = ButtonType.MOUSE_TAB buttonType = ButtonType.MOUSE_TAB
}, },
{ {
pos = {x = 430, y = 40}, pos = {x = 430, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Video', name = 'Video',
buttonType = ButtonType.VIDEO_TAB buttonType = ButtonType.VIDEO_TAB
}, },
{ {
pos = {x = 590, y = 40}, pos = {x = 590, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Audio', name = 'Audio',
buttonType = ButtonType.AUDIO_TAB buttonType = ButtonType.AUDIO_TAB
}, },
{ {
pos = {x = 750, y = 40}, pos = {x = 750, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Multiplayer', name = 'Multiplayer',
buttonType = ButtonType.MULTIPLAYER_TAB buttonType = ButtonType.MULTIPLAYER_TAB
}, },
{ {
pos = {x = 910, y = 100}, pos = {x = 910, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+6 -6
View File
@@ -4,42 +4,42 @@ Size = {x = 140, y = 20}
startX = 100 startX = 100
gui = { gui = {
{ {
pos = {x = startX, y = 400}, pos = {x = startX, y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.EXPORT, buttonType = ButtonType.EXPORT,
name = 'Export' name = 'Export'
}, },
{ {
pos = {x = startX + Size.x + 10, y = 400}, pos = {x = startX + Size.x + 10, y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.VEHICLES, listboxType = ListboxType.VEHICLES,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = startX + 2 * (Size.x + 10), y = 400}, pos = {x = startX + 2 * (Size.x + 10), y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.STRUCTURES, listboxType = ListboxType.STRUCTURES,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = startX + 3 * (Size.x + 10), y = 400}, pos = {x = startX + 3 * (Size.x + 10), y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.RESOURCE_DEPOSITS, listboxType = ListboxType.RESOURCE_DEPOSITS,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = startX + 4 * (Size.x + 10), y = 400}, pos = {x = startX + 4 * (Size.x + 10), y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.SKYBOX_TEXTURES, listboxType = ListboxType.SKYBOX_TEXTURES,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = startX + 5 * (Size.x + 10), y = 400}, pos = {x = startX + 5 * (Size.x + 10), y = 400, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.LAND_TEXTURES, listboxType = ListboxType.LAND_TEXTURES,
+3 -3
View File
@@ -3,21 +3,21 @@ Size = {x = 150, y = 40}
numGui = 3 numGui = 3
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'New map', name = 'New map',
buttonType = ButtonType.NEW_MAP buttonType = ButtonType.NEW_MAP
}, },
{ {
pos = {x = 110, y = 90}, pos = {x = 110, y = 90, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Load map', name = 'Load map',
buttonType = ButtonType.LOAD_MAP buttonType = ButtonType.LOAD_MAP
}, },
{ {
pos = {x = 110, y = 140}, pos = {x = 110, y = 140, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+6 -6
View File
@@ -1,12 +1,12 @@
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 110, y = 80}, pos = {x = 110, y = 80, z = 0},
size = {x = 300, y = 10}, size = {x = 300, y = 10},
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = {x = 300, y = 10}, size = {x = 300, y = 10},
minValue = 0, minValue = 0,
maxValue = 2, maxValue = 2,
@@ -17,25 +17,25 @@ gui = {
} }
}, },
{ {
pos = {x = 110, y = 110}, pos = {x = 110, y = 110, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 100, y = 400}, pos = {x = 100, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
buttonType = ButtonType.OK buttonType = ButtonType.OK
}, },
{ {
pos = {x = 260, y = 400}, pos = {x = 260, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Restore defaults', name = 'Restore defaults',
buttonType = ButtonType.DEFAULTS buttonType = ButtonType.DEFAULTS
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+6 -6
View File
@@ -1,36 +1,36 @@
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = {x = 100, y = 20}, size = {x = 100, y = 20},
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 110, y = 70}, pos = {x = 110, y = 70, z = 0},
size = {x = 100, y = 20}, size = {x = 100, y = 20},
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 110, y = 100}, pos = {x = 110, y = 100, z = 0},
size = {x = 100, y = 20}, size = {x = 100, y = 20},
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 100, y = 400}, pos = {x = 100, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
buttonType = ButtonType.OK buttonType = ButtonType.OK
}, },
{ {
pos = {x = 260, y = 400}, pos = {x = 260, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Restore defaults', name = 'Restore defaults',
buttonType = ButtonType.DEFAULTS buttonType = ButtonType.DEFAULTS
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+1 -1
View File
@@ -3,7 +3,7 @@ Size = {x = 70, y = 70}
gui = { gui = {
{ {
pos = {x = res.x - Size.x, y = res.y - Size.y}, pos = {x = res.x - Size.x, y = res.y - Size.y, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.NAVAL_FACTORY_TRAIN, buttonType = ButtonType.NAVAL_FACTORY_TRAIN,
+5 -5
View File
@@ -3,22 +3,22 @@ Size = {x = 140, y = 40}
numGui = 5 numGui = 5
gui = { gui = {
{ {
pos = {x = 110, y = 150}, pos = {x = 110, y = 150, z = 0},
size = Size, size = Size,
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 110, y = 190}, pos = {x = 110, y = 190, z = 0},
size = Size, size = Size,
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 110, y = 220}, pos = {x = 110, y = 220, z = 0},
size = Size, size = Size,
guiType = GuiType.TEXTBOX guiType = GuiType.TEXTBOX
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 50}, size = {x = 150, y = 50},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
@@ -31,7 +31,7 @@ gui = {
} }
}, },
{ {
pos = {x = 250, y = 400}, pos = {x = 250, y = 400, z = 0},
size = {x = 150, y = 50}, size = {x = 150, y = 50},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+6 -6
View File
@@ -3,42 +3,42 @@ Size = {x = 150, y = 40}
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Controls', name = 'Controls',
buttonType = ButtonType.CONTROLS_TAB buttonType = ButtonType.CONTROLS_TAB
}, },
{ {
pos = {x = 270, y = 40}, pos = {x = 270, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Mouse', name = 'Mouse',
buttonType = ButtonType.MOUSE_TAB buttonType = ButtonType.MOUSE_TAB
}, },
{ {
pos = {x = 430, y = 40}, pos = {x = 430, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Video', name = 'Video',
buttonType = ButtonType.VIDEO_TAB buttonType = ButtonType.VIDEO_TAB
}, },
{ {
pos = {x = 590, y = 40}, pos = {x = 590, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Audio', name = 'Audio',
buttonType = ButtonType.AUDIO_TAB buttonType = ButtonType.AUDIO_TAB
}, },
{ {
pos = {x = 750, y = 40}, pos = {x = 750, y = 40, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Multiplayer', name = 'Multiplayer',
buttonType = ButtonType.MULTIPLAYER_TAB buttonType = ButtonType.MULTIPLAYER_TAB
}, },
{ {
pos = {x = 910, y = 100}, pos = {x = 910, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+1 -1
View File
@@ -1,4 +1,4 @@
Pos = {x = 110, y = 150} Pos = {x = 110, y = 150, z = 0}
Size = {x = 100, y = 20} Size = {x = 100, y = 20}
space = 60 space = 60
@@ -20,7 +20,7 @@ gui = {
buttonType = ButtonType.ACTIVE_GAME_STATE, buttonType = ButtonType.ACTIVE_GAME_STATE,
name = 'Tech', name = 'Tech',
guiScreen = 'techTree.lua', guiScreen = 'techTree.lua',
pos = {x = res.x - 2 * Size.x, y = res.y - Size.y}, pos = {x = res.x - 2 * Size.x, y = res.y - Size.y, z = 0},
size = sz, size = sz,
trigger = 85 trigger = 85
}, },
+6 -6
View File
@@ -3,35 +3,35 @@ Size = {x = 100, y = 20}
numGui = 6 numGui = 6
gui = { gui = {
{ {
pos = {x = 100, y = 100}, pos = {x = 100, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
numMaxDisplay = 3, numMaxDisplay = 3,
listboxType = ListboxType.CPU_DIFFICULTIES listboxType = ListboxType.CPU_DIFFICULTIES
}, },
{ {
pos = {x = 210, y = 100}, pos = {x = 210, y = 100, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
numMaxDisplay = 3, numMaxDisplay = 3,
listboxType = ListboxType.FACTIONS listboxType = ListboxType.FACTIONS
}, },
{ {
pos = {x = 100, y = 230}, pos = {x = 100, y = 230, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
numMaxDisplay = 3, numMaxDisplay = 3,
listboxType = ListboxType.FACTIONS listboxType = ListboxType.FACTIONS
}, },
{ {
pos = {x = 110, y = 310}, pos = {x = 110, y = 310, z = 0},
size = Size, size = Size,
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.MAPS, listboxType = ListboxType.MAPS,
numMaxDisplay = 5 numMaxDisplay = 5
}, },
{ {
pos = {x = 110, y = 460}, pos = {x = 110, y = 460, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.PLAY, buttonType = ButtonType.PLAY,
@@ -45,7 +45,7 @@ gui = {
} }
}, },
{ {
pos = {x = 110 + Size.x + 10, y = 460}, pos = {x = 110 + Size.x + 10, y = 460, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.BACK, buttonType = ButtonType.BACK,
+10 -10
View File
@@ -3,7 +3,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Statistics', text = 'Statistics',
name = 'stat', name = 'stat',
pos = {x = 850, y = 100}, pos = {x = 850, y = 100, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.5, scale = 0.5,
font = 'batang.ttf', font = 'batang.ttf',
@@ -15,7 +15,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Player', text = 'Player',
name = 'pl', name = 'pl',
pos = {x = 50, y = 200}, pos = {x = 50, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -27,7 +27,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Vehicles built', text = 'Vehicles built',
name = 'vb', name = 'vb',
pos = {x = 150, y = 200}, pos = {x = 150, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -39,7 +39,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Vehicles destroyed', text = 'Vehicles destroyed',
name = 'vd', name = 'vd',
pos = {x = 450, y = 200}, pos = {x = 450, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -51,7 +51,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Vehicles lost', text = 'Vehicles lost',
name = 'vl', name = 'vl',
pos = {x = 850, y = 200}, pos = {x = 850, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -63,7 +63,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Structures built', text = 'Structures built',
name = 'sb', name = 'sb',
pos = {x = 1050, y = 200}, pos = {x = 1050, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -75,7 +75,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Structures destroyed', text = 'Structures destroyed',
name = 'sd', name = 'sd',
pos = {x = 1350, y = 200}, pos = {x = 1350, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -87,7 +87,7 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
text = 'Structures lost', text = 'Structures lost',
name = 'sl', name = 'sl',
pos = {x = 1720, y = 200}, pos = {x = 1720, y = 200, z = 0},
zIndex = 0, zIndex = 0,
scale = 0.3, scale = 0.3,
font = 'batang.ttf', font = 'batang.ttf',
@@ -97,13 +97,13 @@ gui = {
}, },
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = 100, y = 200}, pos = {x = 100, y = 200, z = 0},
zIndex = 1, zIndex = 1,
size = {x = 600, y = 600}, size = {x = 600, y = 600},
color = {x = 0, y = 0, z = 1, w = 1} color = {x = 0, y = 0, z = 1, w = 1}
}, },
{ {
pos = {x = 1700, y = 1000}, pos = {x = 1700, y = 1000, z = 0},
size = Size, size = Size,
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+10 -10
View File
@@ -1,7 +1,7 @@
res = graphics.resolution res = graphics.resolution
Size = {x = res.x * .5, y = res.y * .5} Size = {x = res.x * .5, y = res.y * .5}
techButtonSize = {x = 50, y = 50} techButtonSize = {x = 50, y = 50}
Pos = {x = res.x * .3, y = res.y * .1} Pos = {x = res.x * .3, y = res.y * .1, z = 0}
margin = {top = 10, left = 10, right = 10, bottom = 10} margin = {top = 10, left = 10, right = 10, bottom = 10}
baseTechPath = 'Icons/Technologies/' baseTechPath = 'Icons/Technologies/'
heightOffset = techButtonSize.y + 10 heightOffset = techButtonSize.y + 10
@@ -15,7 +15,7 @@ gui = {
color = {x = 0, y = 0, z = 0, w = .6} color = {x = 0, y = 0, z = 0, w = .6}
}, },
{ {
pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top}, pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'apt.jpg', imagePath = baseTechPath .. 'apt.jpg',
@@ -25,7 +25,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + heightOffset}, pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'fpt.jpg', imagePath = baseTechPath .. 'fpt.jpg',
@@ -35,7 +35,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + 2 * heightOffset}, pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + 2 * heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'cruisers.jpg', imagePath = baseTechPath .. 'cruisers.jpg',
@@ -45,7 +45,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top + heightOffset}, pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top + heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'ept.jpg', imagePath = baseTechPath .. 'ept.jpg',
@@ -55,7 +55,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + .5 * (Size.x - 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, pos = {x = Pos.x + .5 * (Size.x - 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'stealth.jpg', imagePath = baseTechPath .. 'stealth.jpg',
@@ -65,7 +65,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + .5 * (Size.x + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, pos = {x = Pos.x + .5 * (Size.x + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'robo.jpg', imagePath = baseTechPath .. 'robo.jpg',
@@ -75,7 +75,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + heightOffset}, pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'pct.jpg', imagePath = baseTechPath .. 'pct.jpg',
@@ -85,7 +85,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + Size.x - (margin.right + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, pos = {x = Pos.x + Size.x - (margin.right + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'carriers.jpg', imagePath = baseTechPath .. 'carriers.jpg',
@@ -95,7 +95,7 @@ gui = {
trigger = 82, trigger = 82,
}, },
{ {
pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0},
size = techButtonSize, size = techButtonSize,
name = "Research", name = "Research",
imagePath = baseTechPath .. 'tanks.jpg', imagePath = baseTechPath .. 'tanks.jpg',
+4 -4
View File
@@ -5,7 +5,7 @@ sz = {x = Size.x - margin, y = Size.y - margin}
gui = { gui = {
{ {
pos = {x = res.x - Size.x, y = res.y - Size.y}, pos = {x = res.x - Size.x, y = res.y - Size.y, z = 0},
size = sz, size = sz,
name = 'Buy ref', name = 'Buy ref',
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
@@ -13,7 +13,7 @@ gui = {
trigger = 73, trigger = 73,
}, },
{ {
pos = {x = res.x - 2 * Size.x, y = res.y - Size.y}, pos = {x = res.x - 2 * Size.x, y = res.y - Size.y, z = 0},
size = sz, size = sz,
name = 'Sell ref', name = 'Sell ref',
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
@@ -21,7 +21,7 @@ gui = {
trigger = 79, trigger = 79,
}, },
{ {
pos = {x = res.x - Size.x, y = res.y - 2 * Size.y}, pos = {x = res.x - Size.x, y = res.y - 2 * Size.y, z = 0},
size = sz, size = sz,
name = 'Buy rsch', name = 'Buy rsch',
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
@@ -29,7 +29,7 @@ gui = {
trigger = 75, trigger = 75,
}, },
{ {
pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y}, pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y, z = 0},
size = sz, size = sz,
name = 'Sell rsch', name = 'Sell rsch',
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
+3 -4
View File
@@ -1,6 +1,6 @@
res = graphics.resolution res = graphics.resolution
Pos = {x = 10, y = 10} Pos = {x = 10, y = 10, z = .1}
Size = {x = res.x * .8, y = res.y * .8} Size = {x = res.x * .8, y = res.y * .8 + 40}
buttonSize = {x = 100, y = 20} buttonSize = {x = 100, y = 20}
textboxSize = {x = 200, y = 25} textboxSize = {x = 200, y = 25}
margin = {top = 10, left = 10, right = 10, bottom = 10} margin = {top = 10, left = 10, right = 10, bottom = 10}
@@ -9,7 +9,6 @@ gui = {
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = Pos, pos = Pos,
zIndex = .9,
size = Size, size = Size,
color = {x = 0, y = 0, z = 0, w = .6} color = {x = 0, y = 0, z = 0, w = .6}
}, },
@@ -18,7 +17,7 @@ gui = {
buttonType = ButtonType.ACTIVE_GAME_STATE, buttonType = ButtonType.ACTIVE_GAME_STATE,
name = 'Back', name = 'Back',
guiScreen = 'activeGameState.lua', guiScreen = 'activeGameState.lua',
pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .11},
size = buttonSize, size = buttonSize,
trigger = 10 trigger = 10
}, },
+3 -5
View File
@@ -14,9 +14,8 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'playerName', name = 'playerName',
text = '', text = '',
pos = {x = Pos.x + margin.left, y = height}, pos = {x = Pos.x + margin.left, y = height, z = .11},
zIndex = 0, scale = {x = .2, y = .2},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
@@ -26,7 +25,6 @@ gui = {
{ {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = {x = Pos.x + margin.left + 20, y = height}, pos = {x = Pos.x + margin.left + 20, y = height},
zIndex = .9,
size = Size, size = Size,
color = {x = 0, y = 0, z = 0, w = .6} color = {x = 0, y = 0, z = 0, w = .6}
}, },
@@ -44,7 +42,7 @@ gui = {
buttonType = ButtonType.TRADING_SCREEN, buttonType = ButtonType.TRADING_SCREEN,
name = 'Trade', name = 'Trade',
guiScreen = 'tradingScreen.lua', guiScreen = 'tradingScreen.lua',
pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = height}, pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = height, z = .11},
size = buttonSize, size = buttonSize,
trigger = 10 trigger = 10
} }
+14 -14
View File
@@ -11,21 +11,21 @@ buttonSize = {x = 100, y = 20}
ResourceTrayGuiId = {ICON = 0, TEXTBOX = 1, INCREMENT = 2, DECREMENT = 3} ResourceTrayGuiId = {ICON = 0, TEXTBOX = 1, INCREMENT = 2, DECREMENT = 3}
IconPath = {WEALTH = 'Icons/Resources/wealth.jpg', RESEARCH = 'Icons/Resources/research.jpg', REFINEDS = 'Icons/Resources/refineds.jpg', TIME = 'Icons/Resources/time.jpg'} IconPath = {WEALTH = 'Icons/Resources/wealth.jpg', RESEARCH = 'Icons/Resources/research.jpg', REFINEDS = 'Icons/Resources/refineds.jpg', TIME = 'Icons/Resources/time.jpg'}
function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath)
height = margin.top + lineId * iconSize.y height = margin.top + lineId * iconSize.y
if guiId == ResourceTrayGuiId.ICON then if guiId == ResourceTrayGuiId.ICON then
guiElPos = {x = Pos.x + (cpuPlayer and margin.left or Size.x -(margin.right + 3 * iconSize.x + textboxSize.x)), y = height} guiElPos = {x = Pos.x + (cpuPlayer and margin.left or Size.x -(margin.right + 3 * iconSize.x + textboxSize.x)), y = height, z = .2}
return { return {
guiType = GuiType.GUI_RECTANGLE, guiType = GuiType.GUI_RECTANGLE,
pos = guiElPos, pos = guiElPos,
zIndex = .8,
size = iconSize, size = iconSize,
imagePath = imgPath imagePath = imgPath
} }
elseif guiId == ResourceTrayGuiId.TEXTBOX then elseif guiId == ResourceTrayGuiId.TEXTBOX then
guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x or Size.x -(margin.right + 2 * iconSize.x + textboxSize.x)), y = height} guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x or Size.x -(margin.right + 2 * iconSize.x + textboxSize.x)), y = height, z = .2}
return { return {
pos = guiElPos, pos = guiElPos,
@@ -33,7 +33,7 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath)
guiType = GuiType.TEXTBOX, guiType = GuiType.TEXTBOX,
} }
elseif guiId == ResourceTrayGuiId.INCREMENT then elseif guiId == ResourceTrayGuiId.INCREMENT then
guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x + textboxSize.x or Size.x -(margin.right + 2 * iconSize.x)), y = height} guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x + textboxSize.x or Size.x -(margin.right + 2 * iconSize.x)), y = height, z = .2}
return { return {
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
@@ -45,7 +45,7 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath)
trigger = 10 trigger = 10
} }
elseif guiId == ResourceTrayGuiId.DECREMENT then elseif guiId == ResourceTrayGuiId.DECREMENT then
guiElPos = {x = Pos.x + (cpuPlayer and margin.left + 2 * iconSize.x + textboxSize.x or Size.x -(margin.right + iconSize.x)), y = height} guiElPos = {x = Pos.x + (cpuPlayer and margin.left + 2 * iconSize.x + textboxSize.x or Size.x -(margin.right + iconSize.x)), y = height, z = .2}
return { return {
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
@@ -64,9 +64,8 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'P0', name = 'P0',
text = 'P0', text = 'P0',
pos = {x = Pos.x + margin.left, y = Pos.y + margin.top}, pos = {x = Pos.x + margin.left, y = Pos.y + margin.top - 20, z = .2},
zIndex = 0, scale = {x = .5, y = .5},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
@@ -76,14 +75,14 @@ gui = {
guiType = GuiType.TEXT, guiType = GuiType.TEXT,
name = 'You', name = 'You',
text = 'You', text = 'You',
pos = {x = Pos.x + margin.left, y = Pos.y + margin.top}, pos = {x = Pos.x + Size.x -(margin.right + textboxSize.x + iconSize.x + 50), y = Pos.y + margin.top - 20, z = .2},
zIndex = 0, scale = {x = .5, y = .5},
scale = 1,
font = 'batang.ttf', font = 'batang.ttf',
fontFirstChar = 0, fontFirstChar = 0,
fontLastChar = 256, fontLastChar = 256,
color = {x = 1, y = 1, z = 1, w = 1} color = {x = 1, y = 1, z = 1, w = 1}
}, },
createResourceTrayGui(true, 0, ResourceTrayGuiId.ICON, IconPath.REFINEDS), createResourceTrayGui(true, 0, ResourceTrayGuiId.ICON, IconPath.REFINEDS),
createResourceTrayGui(true, 0, ResourceTrayGuiId.TEXTBOX), createResourceTrayGui(true, 0, ResourceTrayGuiId.TEXTBOX),
createResourceTrayGui(true, 0, ResourceTrayGuiId.INCREMENT), createResourceTrayGui(true, 0, ResourceTrayGuiId.INCREMENT),
@@ -116,12 +115,13 @@ gui = {
createResourceTrayGui(false, 3, ResourceTrayGuiId.TEXTBOX), createResourceTrayGui(false, 3, ResourceTrayGuiId.TEXTBOX),
createResourceTrayGui(false, 3, ResourceTrayGuiId.INCREMENT), createResourceTrayGui(false, 3, ResourceTrayGuiId.INCREMENT),
createResourceTrayGui(false, 3, ResourceTrayGuiId.DECREMENT), createResourceTrayGui(false, 3, ResourceTrayGuiId.DECREMENT),
{ {
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.PLAYER_TRADE, buttonType = ButtonType.PLAYER_TRADE,
name = 'Back', name = 'Back',
guiScreen = 'tradingHub.lua', guiScreen = 'tradingHub.lua',
pos = {x = Pos.x + Size.x - 2 * buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, pos = {x = Pos.x + Size.x - 2 * buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .2},
size = buttonSize, size = buttonSize,
trigger = 10 trigger = 10
}, },
@@ -129,12 +129,12 @@ gui = {
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
buttonType = ButtonType.TRADE_OFFER, buttonType = ButtonType.TRADE_OFFER,
name = 'Offer', name = 'Offer',
pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .2},
size = buttonSize, size = buttonSize,
trigger = 10 trigger = 10
}, },
{ {
pos = {x = Pos.x + margin.left, y = Pos.y + Size.y - textboxSize.y - margin.bottom}, pos = {x = Pos.x + margin.left, y = Pos.y + Size.y - textboxSize.y - margin.bottom, z = .2},
size = textboxSize, size = textboxSize,
guiType = GuiType.TEXTBOX, guiType = GuiType.TEXTBOX,
} }
+9 -9
View File
@@ -1,7 +1,7 @@
numGui = 9 numGui = 9
gui = { gui = {
{ {
pos = {x = 210, y = 190}, pos = {x = 210, y = 190, z = 0},
size = {x = 360, y = 20}, size = {x = 360, y = 20},
guiType = GuiType.LISTBOX, guiType = GuiType.LISTBOX,
listboxType = ListboxType.RESOLUTION, listboxType = ListboxType.RESOLUTION,
@@ -14,41 +14,41 @@ gui = {
} }
}, },
{ {
pos = {x = 110, y = 40}, pos = {x = 110, y = 40, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 110, y = 70}, pos = {x = 110, y = 70, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 110, y = 100}, pos = {x = 110, y = 100, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 110, y = 130}, pos = {x = 110, y = 130, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 110, y = 160}, pos = {x = 110, y = 160, z = 0},
guiType = GuiType.CHECKBOX guiType = GuiType.CHECKBOX
}, },
{ {
pos = {x = 100, y = 400}, pos = {x = 100, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Ok', name = 'Ok',
buttonType = ButtonType.OK buttonType = ButtonType.OK
}, },
{ {
pos = {x = 260, y = 400}, pos = {x = 260, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Restore defaults', name = 'Restore defaults',
buttonType = ButtonType.DEFAULTS buttonType = ButtonType.DEFAULTS
}, },
{ {
pos = {x = 420, y = 400}, pos = {x = 420, y = 400, z = 0},
size = {x = 150, y = 20}, size = {x = 150, y = 20},
guiType = GuiType.BUTTON, guiType = GuiType.BUTTON,
name = 'Back', name = 'Back',
+1 -1
View File
@@ -18,7 +18,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
ActiveStateButton::ActiveStateButton(Vector2 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), guiScreen(gs){ ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), guiScreen(gs){
StateManager *stateManager = GameManager::getSingleton()->getStateManager(); StateManager *stateManager = GameManager::getSingleton()->getStateManager();
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE); ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class ActiveStateButton : public vb01Gui::Button{ class ActiveStateButton : public vb01Gui::Button{
public: public:
ActiveStateButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int = -1, std::string = ""); ActiveStateButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int = -1, std::string = "");
void onClick(); void onClick();
private: private:
std::string guiScreen = ""; std::string guiScreen = "";
+1 -1
View File
@@ -7,7 +7,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
BackButton::BackButton(Vector2 pos, Vector2 size, string name, string screen) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { BackButton::BackButton(Vector3 pos, Vector2 size, string name, string screen) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {
this->screen = screen; this->screen = screen;
} }
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class BackButton : public vb01Gui::Button{ class BackButton : public vb01Gui::Button{
public: public:
BackButton(vb01::Vector2, vb01::Vector2, std::string, std::string); BackButton(vb01::Vector3, vb01::Vector2, std::string, std::string);
void onClick(); void onClick();
private: private:
std::string screen; std::string screen;
+1 -1
View File
@@ -16,7 +16,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
BuildButton::BuildButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : BuildButton::BuildButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) :
UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), slotId(slId){} UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), slotId(slId){}
void BuildButton::onClick(){ void BuildButton::onClick(){
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class BuildButton : public UnitButton{ class BuildButton : public UnitButton{
public: public:
BuildButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); BuildButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int);
void onClick(); void onClick();
private: private:
int slotId; int slotId;
+12 -9
View File
@@ -54,12 +54,13 @@ namespace battleship{
} }
//TODO refactor player difficulty and faction listbox selection //TODO refactor player difficulty and faction listbox selection
//TODO remove hardcoded font path values
Button* ConcreteGuiManager::parseButton(int guiId){ Button* ConcreteGuiManager::parseButton(int guiId){
sol::state_view SOL_LUA_STATE = generateView(); sol::state_view SOL_LUA_STATE = generateView();
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
sol::table posTable = guiTable["pos"]; sol::table posTable = guiTable["pos"];
Vector2 pos = Vector2(posTable["x"], posTable["y"]); Vector3 pos = Vector3(posTable["x"], posTable["y"], posTable["z"]);
sol::table sizeTable = guiTable["size"]; sol::table sizeTable = guiTable["size"];
Vector2 size = Vector2(sizeTable["x"], sizeTable["y"]); Vector2 size = Vector2(sizeTable["x"], sizeTable["y"]);
@@ -261,7 +262,7 @@ namespace battleship{
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
string posTable = "pos"; string posTable = "pos";
Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]);
string sizeTable = "size"; string sizeTable = "size";
Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]);
@@ -392,7 +393,7 @@ namespace battleship{
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
string posTable = "pos"; string posTable = "pos";
Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]);
Checkbox *checkbox = new Checkbox(pos, fontBasePath + "batang.ttf"); Checkbox *checkbox = new Checkbox(pos, fontBasePath + "batang.ttf");
int typeArr[2]{(int)GuiElementType::CHECKBOX, -1}; int typeArr[2]{(int)GuiElementType::CHECKBOX, -1};
@@ -406,7 +407,7 @@ namespace battleship{
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
string posTable = "pos", sizeTable = "size"; string posTable = "pos", sizeTable = "size";
Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]);
Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]);
Slider *slider = new Slider(pos, size, guiTable["minValue"], guiTable["maxValue"]); Slider *slider = new Slider(pos, size, guiTable["minValue"], guiTable["maxValue"]);
@@ -422,7 +423,7 @@ namespace battleship{
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
string posTable = "pos", sizeTable = "size"; string posTable = "pos", sizeTable = "size";
Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]);
Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]);
Textbox *textbox = new Textbox(pos, size, fontBasePath + "batang.ttf"); Textbox *textbox = new Textbox(pos, size, fontBasePath + "batang.ttf");
@@ -438,6 +439,7 @@ namespace battleship{
Root *root = Root::getSingleton(); Root *root = Root::getSingleton();
Material *mat = new Material(root->getLibPath() + "gui"); Material *mat = new Material(root->getLibPath() + "gui");
mat->setTransparent(true);
string ipk = "imagePath"; string ipk = "imagePath";
sol::optional<string> pathOpt = guiTable[ipk]; sol::optional<string> pathOpt = guiTable[ipk];
@@ -461,7 +463,7 @@ namespace battleship{
quad->setMaterial(mat); quad->setMaterial(mat);
sol::table posTable = guiTable["pos"]; sol::table posTable = guiTable["pos"];
Node *guiRectangle = new Node(Vector3(posTable["x"], posTable["y"], guiTable["zIndex"])); Node *guiRectangle = new Node(Vector3(posTable["x"], posTable["y"], posTable["z"]));
guiRectangle->attachMesh(quad); guiRectangle->attachMesh(quad);
root->getGuiNode()->attachChild(guiRectangle); root->getGuiNode()->attachChild(guiRectangle);
@@ -475,6 +477,7 @@ namespace battleship{
sol::state_view SOL_LUA_STATE = generateView(); sol::state_view SOL_LUA_STATE = generateView();
sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1];
sol::table posTable = guiTable["pos"]; sol::table posTable = guiTable["pos"];
sol::table scaleTable = guiTable["scale"];
Root *root = Root::getSingleton(); Root *root = Root::getSingleton();
@@ -484,11 +487,11 @@ namespace battleship{
mat->addVec4Uniform("diffuseColor", Vector4(colorTable["x"], colorTable["y"], colorTable["z"], colorTable["w"])); mat->addVec4Uniform("diffuseColor", Vector4(colorTable["x"], colorTable["y"], colorTable["z"], colorTable["w"]));
Text *text = new Text(fontBasePath + (string)guiTable["font"], (wstring)guiTable["text"], guiTable["fontFirstChar"], guiTable["fontLastChar"]); Text *text = new Text(fontBasePath + (string)guiTable["font"], (wstring)guiTable["text"], guiTable["fontFirstChar"], guiTable["fontLastChar"]);
text->setScale((float)guiTable["scale"]);
text->setMaterial(mat); text->setMaterial(mat);
Vector3 pos = Vector3(posTable["x"], posTable["y"], guiTable["zIndex"]); Vector3 pos = Vector3(posTable["x"], posTable["y"], posTable["z"]);
Node *node = new Node(pos, Quaternion::QUAT_W, Vector3::VEC_IJK, guiTable["name"]); Vector3 scale = Vector3(scaleTable["x"], scaleTable["y"], 1);
Node *node = new Node(pos, Quaternion::QUAT_W, scale, guiTable["name"]);
node->addText(text); node->addText(text);
root->getGuiNode()->attachChild(node); root->getGuiNode()->attachChild(node);
+1 -1
View File
@@ -6,7 +6,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
DefaultsButton::DefaultsButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} DefaultsButton::DefaultsButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {}
void DefaultsButton::onClick() {} void DefaultsButton::onClick() {}
} }
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class DefaultsButton : public vb01Gui::Button{ class DefaultsButton : public vb01Gui::Button{
public: public:
DefaultsButton(vb01::Vector2, vb01::Vector2, std::string); DefaultsButton(vb01::Vector3, vb01::Vector2, std::string);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -7,7 +7,7 @@ using namespace std;
using namespace vb01; using namespace vb01;
namespace battleship{ namespace battleship{
ExitButton::ExitButton(Vector2 pos, Vector2 size) : Button(pos, size, "Exit", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} ExitButton::ExitButton(Vector3 pos, Vector2 size) : Button(pos, size, "Exit", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {}
void ExitButton::onClick() { void ExitButton::onClick() {
//Root::getSingleton()->set //Root::getSingleton()->set
+1 -1
View File
@@ -8,7 +8,7 @@
namespace battleship { namespace battleship {
class ExitButton : public vb01Gui::Button { class ExitButton : public vb01Gui::Button {
public: public:
ExitButton(vb01::Vector2, vb01::Vector2); ExitButton(vb01::Vector3, vb01::Vector2);
void onClick(); void onClick();
}; };
} }
+1 -1
View File
@@ -10,7 +10,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
ExportButton::ExportButton(Vector2 pos, Vector2 size) : Button(pos, size, "Export", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} ExportButton::ExportButton(Vector3 pos, Vector2 size) : Button(pos, size, "Export", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){}
void ExportButton::onClick(){ void ExportButton::onClick(){
StateManager *sm = GameManager::getSingleton()->getStateManager(); StateManager *sm = GameManager::getSingleton()->getStateManager();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class ExportButton : public vb01Gui::Button{ class ExportButton : public vb01Gui::Button{
public: public:
ExportButton(vb01::Vector2 pos, vb01::Vector2 size); ExportButton(vb01::Vector3 pos, vb01::Vector2 size);
void onClick(); void onClick();
}; };
} }
+1 -1
View File
@@ -10,7 +10,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
GameObjectListbox::GameObjectListbox(bool ul, Vector2 pos, Vector2 size, vector<string> lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath), unitListbox(ul) {} GameObjectListbox::GameObjectListbox(bool ul, Vector3 pos, Vector2 size, vector<string> lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath), unitListbox(ul) {}
void GameObjectListbox::onClose(){ void GameObjectListbox::onClose(){
GameObjectFrameController *ufCtr = GameObjectFrameController::getSingleton(); GameObjectFrameController *ufCtr = GameObjectFrameController::getSingleton();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class GameObjectListbox : public vb01Gui::Listbox{ class GameObjectListbox : public vb01Gui::Listbox{
public: public:
GameObjectListbox(bool, vb01::Vector2, vb01::Vector2, std::vector<std::string>, int, std::string); GameObjectListbox(bool, vb01::Vector3, vb01::Vector2, std::vector<std::string>, int, std::string);
void onClose(); void onClose();
private: private:
bool unitListbox; bool unitListbox;
+3 -3
View File
@@ -24,19 +24,19 @@ using namespace std;
namespace battleship{ namespace battleship{
using namespace configData; using namespace configData;
InGameAppState::ResumeButton::ResumeButton(Vector2 pos, Vector2 size) : Button(pos, size, "Resume", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} InGameAppState::ResumeButton::ResumeButton(Vector3 pos, Vector2 size) : Button(pos, size, "Resume", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {}
void InGameAppState::ResumeButton::onClick() { void InGameAppState::ResumeButton::onClick() {
Game::getSingleton()->togglePause(); Game::getSingleton()->togglePause();
} }
InGameAppState::ConsoleButton::ConsoleButton(Vector2 pos, Vector2 size) : Button(pos, size, "Console", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { } InGameAppState::ConsoleButton::ConsoleButton(Vector3 pos, Vector2 size) : Button(pos, size, "Console", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { }
void InGameAppState::ConsoleButton::onClick() { void InGameAppState::ConsoleButton::onClick() {
ConcreteGuiManager::getSingleton()->readLuaScreenScript("console.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("console.lua");
} }
InGameAppState::ConsoleButton::ConsoleButton::ConsoleCommandEntryButton::ConsoleCommandEntryButton(Textbox *t, Listbox *l, Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", 257, true) { InGameAppState::ConsoleButton::ConsoleButton::ConsoleCommandEntryButton::ConsoleCommandEntryButton(Textbox *t, Listbox *l, Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", 257, true) {
textbox = t; textbox = t;
listbox = l; listbox = l;
} }
+3 -3
View File
@@ -18,7 +18,7 @@ namespace battleship{
public: public:
class ResumeButton : public vb01Gui::Button { class ResumeButton : public vb01Gui::Button {
public: public:
ResumeButton(vb01::Vector2, vb01::Vector2); ResumeButton(vb01::Vector3, vb01::Vector2);
void onClick(); void onClick();
private: private:
}; };
@@ -27,14 +27,14 @@ namespace battleship{
public: public:
class ConsoleCommandEntryButton : public Button { class ConsoleCommandEntryButton : public Button {
public: public:
ConsoleCommandEntryButton(vb01Gui::Textbox*, vb01Gui::Listbox*, vb01::Vector2, vb01::Vector2, std::string); ConsoleCommandEntryButton(vb01Gui::Textbox*, vb01Gui::Listbox*, vb01::Vector3, vb01::Vector2, std::string);
void onClick(); void onClick();
private: private:
vb01Gui::Textbox *textbox; vb01Gui::Textbox *textbox;
vb01Gui::Listbox *listbox; vb01Gui::Listbox *listbox;
}; };
ConsoleButton(vb01::Vector2, vb01::Vector2); ConsoleButton(vb01::Vector3, vb01::Vector2);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -15,7 +15,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
LandTextureListbox::LandTextureListbox(Vector2 pos, Vector2 size, vector<string> lines, int maxDisplay, std::string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} LandTextureListbox::LandTextureListbox(Vector3 pos, Vector2 size, vector<string> lines, int maxDisplay, std::string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){}
void LandTextureListbox::onClose(){ void LandTextureListbox::onClose(){
StateManager *sm = GameManager::getSingleton()->getStateManager(); StateManager *sm = GameManager::getSingleton()->getStateManager();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class LandTextureListbox : public vb01Gui::Listbox{ class LandTextureListbox : public vb01Gui::Listbox{
public: public:
LandTextureListbox(vb01::Vector2, vb01::Vector2, std::vector<std::string>, int, std::string); LandTextureListbox(vb01::Vector3, vb01::Vector2, std::vector<std::string>, int, std::string);
void onClose(); void onClose();
private: private:
}; };
+2 -2
View File
@@ -11,7 +11,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
LoadMapButton::OkButton::OkButton(vb01::Vector2 pos, vb01::Vector2 size, vb01Gui::Listbox *listbox) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){ this->listbox = listbox; } LoadMapButton::OkButton::OkButton(vb01::Vector3 pos, vb01::Vector2 size, vb01Gui::Listbox *listbox) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){ this->listbox = listbox; }
void LoadMapButton::OkButton::onClick(){ void LoadMapButton::OkButton::onClick(){
StateManager *sm = GameManager::getSingleton()->getStateManager(); StateManager *sm = GameManager::getSingleton()->getStateManager();
@@ -20,7 +20,7 @@ namespace battleship{
ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua");
} }
LoadMapButton::LoadMapButton(Vector2 pos, Vector2 size) : Button(pos, size, "Load map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} LoadMapButton::LoadMapButton(Vector3 pos, Vector2 size) : Button(pos, size, "Load map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){}
void LoadMapButton::onClick(){ void LoadMapButton::onClick(){
ConcreteGuiManager::getSingleton()->readLuaScreenScript("loadMap.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("loadMap.lua");
+2 -2
View File
@@ -12,13 +12,13 @@ namespace battleship{
public: public:
class OkButton : public vb01Gui::Button{ class OkButton : public vb01Gui::Button{
public: public:
OkButton(vb01::Vector2, vb01::Vector2, vb01Gui::Listbox*); OkButton(vb01::Vector3, vb01::Vector2, vb01Gui::Listbox*);
void onClick(); void onClick();
private: private:
vb01Gui::Listbox *listbox; vb01Gui::Listbox *listbox;
}; };
LoadMapButton(vb01::Vector2, vb01::Vector2); LoadMapButton(vb01::Vector3, vb01::Vector2);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -7,7 +7,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
MainMenuButton::MainMenuButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){} MainMenuButton::MainMenuButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){}
void MainMenuButton::onClick(){ void MainMenuButton::onClick(){
} }
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class MainMenuButton : public vb01Gui::Button{ class MainMenuButton : public vb01Gui::Button{
public: public:
MainMenuButton(vb01::Vector2, vb01::Vector2, std::string); MainMenuButton(vb01::Vector3, vb01::Vector2, std::string);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -8,7 +8,7 @@
namespace battleship{ namespace battleship{
class MapEditorButton : public vb01Gui::Button{ class MapEditorButton : public vb01Gui::Button{
public: public:
MapEditorButton(vb01::Vector2 pos, vb01::Vector2 size) : vb01Gui::Button(pos, size, "Map editor", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} MapEditorButton(vb01::Vector3 pos, vb01::Vector2 size) : vb01Gui::Button(pos, size, "Map editor", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){}
void onClick(); void onClick();
private: private:
}; };
+2 -2
View File
@@ -14,7 +14,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
NewMapButton::OkButton::OkButton(vb01::Vector2 pos, vb01::Vector2 size, vb01Gui::Textbox *name, vb01Gui::Textbox *sx, vb01Gui::Textbox *sy) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){ NewMapButton::OkButton::OkButton(vb01::Vector3 pos, vb01::Vector2 size, vb01Gui::Textbox *name, vb01Gui::Textbox *sx, vb01Gui::Textbox *sy) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){
this->name = name; this->name = name;
this->sizeX = sx; this->sizeX = sx;
this->sizeY = sy; this->sizeY = sy;
@@ -31,7 +31,7 @@ namespace battleship{
ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua");
} }
NewMapButton::NewMapButton(Vector2 pos, Vector2 size) : Button(pos, size, "New map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} NewMapButton::NewMapButton(Vector3 pos, Vector2 size) : Button(pos, size, "New map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){}
void NewMapButton::onClick(){ void NewMapButton::onClick(){
ConcreteGuiManager::getSingleton()->readLuaScreenScript("newMap.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("newMap.lua");
+2 -2
View File
@@ -12,13 +12,13 @@ namespace battleship{
public: public:
class OkButton : public vb01Gui::Button{ class OkButton : public vb01Gui::Button{
public: public:
OkButton(vb01::Vector2, vb01::Vector2, vb01Gui::Textbox*, vb01Gui::Textbox*, vb01Gui::Textbox*); OkButton(vb01::Vector3, vb01::Vector2, vb01Gui::Textbox*, vb01Gui::Textbox*, vb01Gui::Textbox*);
void onClick(); void onClick();
private: private:
vb01Gui::Textbox *name, *sizeX, *sizeY; vb01Gui::Textbox *name, *sizeX, *sizeY;
}; };
NewMapButton(vb01::Vector2, vb01::Vector2); NewMapButton(vb01::Vector3, vb01::Vector2);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -14,7 +14,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
OfferButton::OfferButton(Vector2 pos, Vector2 size, int plId, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), playerId(plId){} OfferButton::OfferButton(Vector3 pos, Vector2 size, int plId, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), playerId(plId){}
void OfferButton::onClick(){ void OfferButton::onClick(){
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton(); ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class OfferButton : public vb01Gui::Button{ class OfferButton : public vb01Gui::Button{
public: public:
OfferButton(vb01::Vector2, vb01::Vector2, int, std::string, int, std::string); OfferButton(vb01::Vector3, vb01::Vector2, int, std::string, int, std::string);
void onClick(); void onClick();
inline void setPlayerId(int plId){playerId = plId;} inline void setPlayerId(int plId){playerId = plId;}
private: private:
+1 -1
View File
@@ -6,7 +6,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
OkButton::OkButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} OkButton::OkButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {}
void OkButton::onClick() {} void OkButton::onClick() {}
} }
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class OkButton : public vb01Gui::Button{ class OkButton : public vb01Gui::Button{
public: public:
OkButton(vb01::Vector2, vb01::Vector2, std::string); OkButton(vb01::Vector3, vb01::Vector2, std::string);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -7,7 +7,7 @@ using namespace vb01;
using namespace std; using namespace std;
namespace battleship{ namespace battleship{
OptionsButton::OptionsButton(Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, separate) {} OptionsButton::OptionsButton(Vector3 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, separate) {}
void OptionsButton::onClick() { void OptionsButton::onClick() {
ConcreteGuiManager::getSingleton()->readLuaScreenScript("options.lua"); ConcreteGuiManager::getSingleton()->readLuaScreenScript("options.lua");
+1 -1
View File
@@ -7,7 +7,7 @@
namespace battleship { namespace battleship {
class OptionsButton : public vb01Gui::Button { class OptionsButton : public vb01Gui::Button {
public: public:
OptionsButton(vb01::Vector2, vb01::Vector2, std::string, bool); OptionsButton(vb01::Vector3, vb01::Vector2, std::string, bool);
virtual void onClick(); virtual void onClick();
}; };
} }
+1 -1
View File
@@ -14,7 +14,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
PlayButton::PlayButton(vector<Listbox*> difficulties, vector<Listbox*> factions, Listbox *mapListbox, Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_P, separate) { PlayButton::PlayButton(vector<Listbox*> difficulties, vector<Listbox*> factions, Listbox *mapListbox, Vector3 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_P, separate) {
difficultiesListboxes = difficulties; difficultiesListboxes = difficulties;
factionsListboxes = factions; factionsListboxes = factions;
this->mapListbox = mapListbox; this->mapListbox = mapListbox;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace vb01Gui{
namespace battleship{ namespace battleship{
class PlayButton : public vb01Gui::Button { class PlayButton : public vb01Gui::Button {
public: public:
PlayButton(std::vector<vb01Gui::Listbox*>, std::vector<vb01Gui::Listbox*>, vb01Gui::Listbox*, vb01::Vector2, vb01::Vector2, std::string, bool); PlayButton(std::vector<vb01Gui::Listbox*>, std::vector<vb01Gui::Listbox*>, vb01Gui::Listbox*, vb01::Vector3, vb01::Vector2, std::string, bool);
void onClick(); void onClick();
private: private:
std::vector<vb01Gui::Listbox*> difficultiesListboxes, factionsListboxes; std::vector<vb01Gui::Listbox*> difficultiesListboxes, factionsListboxes;
+1 -1
View File
@@ -12,7 +12,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
PlayerTradeButton::PlayerTradeButton(Vector2 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath){} PlayerTradeButton::PlayerTradeButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath){}
void PlayerTradeButton::onClick(){ void PlayerTradeButton::onClick(){
ActiveStateButton::onClick(); ActiveStateButton::onClick();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class PlayerTradeButton : public ActiveStateButton{ class PlayerTradeButton : public ActiveStateButton{
public: public:
PlayerTradeButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int, std::string); PlayerTradeButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int, std::string);
void onClick(); void onClick();
private: private:
}; };
+1 -1
View File
@@ -19,7 +19,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace std; using namespace std;
ResearchButton::ResearchButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int tid) : ResearchButton::ResearchButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int tid) :
UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), techId(tid){ UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), techId(tid){
Root *root = Root::getSingleton(); Root *root = Root::getSingleton();
Material *mat = new Material(root->getLibPath() + "gui"); Material *mat = new Material(root->getLibPath() + "gui");
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class ResearchButton : public UnitButton{ class ResearchButton : public UnitButton{
public: public:
ResearchButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); ResearchButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int);
~ResearchButton(); ~ResearchButton();
void onClick(); void onClick();
void update(); void update();
+1 -1
View File
@@ -9,7 +9,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
ResourceAmmountButton::ResourceAmmountButton(Vector2 pos, Vector2 size, string name, int amm, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), ammount(amm) { ResourceAmmountButton::ResourceAmmountButton(Vector3 pos, Vector2 size, string name, int amm, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), ammount(amm) {
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton(); ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
int numTextboxes = guiManager->getTextboxes().size(); int numTextboxes = guiManager->getTextboxes().size();
textbox = guiManager->getTextboxes()[numTextboxes - 1]; textbox = guiManager->getTextboxes()[numTextboxes - 1];
+1 -1
View File
@@ -10,7 +10,7 @@ namespace vb01Gui{
namespace battleship{ namespace battleship{
class ResourceAmmountButton : public vb01Gui::Button{ class ResourceAmmountButton : public vb01Gui::Button{
public: public:
ResourceAmmountButton(vb01::Vector2, vb01::Vector2, std::string, int, int, std::string); ResourceAmmountButton(vb01::Vector3, vb01::Vector2, std::string, int, int, std::string);
void onClick(); void onClick();
private: private:
vb01Gui::Textbox *textbox = nullptr; vb01Gui::Textbox *textbox = nullptr;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
SinglePlayerButton::SinglePlayerButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_S, true) {} SinglePlayerButton::SinglePlayerButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_S, true) {}
void SinglePlayerButton::onMouseOver(){ void SinglePlayerButton::onMouseOver(){
setColor(Vector4(.8, .8, .8, 1)); setColor(Vector4(.8, .8, .8, 1));
+1 -1
View File
@@ -8,7 +8,7 @@
namespace battleship{ namespace battleship{
class SinglePlayerButton : public vb01Gui::Button { class SinglePlayerButton : public vb01Gui::Button {
public: public:
SinglePlayerButton(vb01::Vector2, vb01::Vector2, std::string); SinglePlayerButton(vb01::Vector3, vb01::Vector2, std::string);
void onClick(); void onClick();
void onMouseOver(); void onMouseOver();
void onMouseOff(); void onMouseOff();
+1 -1
View File
@@ -15,7 +15,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
SkyboxTextureListbox::SkyboxTextureListbox(Vector2 pos, Vector2 size, vector<string> lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} SkyboxTextureListbox::SkyboxTextureListbox(Vector3 pos, Vector2 size, vector<string> lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){}
void SkyboxTextureListbox::onClose(){ void SkyboxTextureListbox::onClose(){
Root *root = Root::getSingleton(); Root *root = Root::getSingleton();
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class SkyboxTextureListbox : public vb01Gui::Listbox{ class SkyboxTextureListbox : public vb01Gui::Listbox{
public: public:
SkyboxTextureListbox(vb01::Vector2, vb01::Vector2, std::vector<std::string>, int, std::string); SkyboxTextureListbox(vb01::Vector3, vb01::Vector2, std::vector<std::string>, int, std::string);
void onClose(); void onClose();
private: private:
}; };
+1 -1
View File
@@ -12,7 +12,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace gameBase; using namespace gameBase;
StatsButton::StatsButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){} StatsButton::StatsButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){}
void StatsButton::addPlayerDataGuiElements(int playerId){ void StatsButton::addPlayerDataGuiElements(int playerId){
const int numPairs = 7; const int numPairs = 7;
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship { namespace battleship {
class StatsButton : public vb01Gui::Button{ class StatsButton : public vb01Gui::Button{
public: public:
StatsButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string); StatsButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string);
void onClick(); void onClick();
private: private:
void addPlayerDataGuiElements(int); void addPlayerDataGuiElements(int);
+1 -1
View File
@@ -7,7 +7,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
TabButton::TabButton(Vector2 pos, Vector2 size, string name, string screenScript) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { TabButton::TabButton(Vector3 pos, Vector2 size, string name, string screenScript) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {
this->screenScript = screenScript; this->screenScript = screenScript;
} }
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class TabButton : public vb01Gui::Button{ class TabButton : public vb01Gui::Button{
public: public:
TabButton(vb01::Vector2, vb01::Vector2, std::string, std::string); TabButton(vb01::Vector3, vb01::Vector2, std::string, std::string);
void onClick(); void onClick();
private: private:
std::string screenScript; std::string screenScript;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace gameBase; using namespace gameBase;
TradeButton::TradeButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, Type t) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), type(t){} TradeButton::TradeButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, Type t) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), type(t){}
void TradeButton::onClick(){ void TradeButton::onClick(){
ActiveGameState *activeState = (ActiveGameState*)(GameManager::getSingleton()->getStateManager()->getAppStateByType((int)AppStateType::ACTIVE_STATE)); ActiveGameState *activeState = (ActiveGameState*)(GameManager::getSingleton()->getStateManager()->getAppStateByType((int)AppStateType::ACTIVE_STATE));
+1 -1
View File
@@ -8,7 +8,7 @@ namespace battleship{
public: public:
enum class Type{BUY_REFINEDS, SELL_REFINEDS, BUY_RESEARCH, SELL_RESEARCH}; enum class Type{BUY_REFINEDS, SELL_REFINEDS, BUY_RESEARCH, SELL_RESEARCH};
TradeButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, Type); TradeButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, Type);
void onClick(); void onClick();
private: private:
Type type; Type type;
+1 -1
View File
@@ -8,7 +8,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace vb01Gui; using namespace vb01Gui;
TradingScreenButton::TradingScreenButton(Vector2 pos, Vector2 size, int plId, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath), playerId(plId){} TradingScreenButton::TradingScreenButton(Vector3 pos, Vector2 size, int plId, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath), playerId(plId){}
//TODO add method to get buttons by name //TODO add method to get buttons by name
void TradingScreenButton::onClick(){ void TradingScreenButton::onClick(){
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class TradingScreenButton : public ActiveStateButton{ class TradingScreenButton : public ActiveStateButton{
public: public:
TradingScreenButton(vb01::Vector2, vb01::Vector2, int, std::string, std::string, int, std::string); TradingScreenButton(vb01::Vector3, vb01::Vector2, int, std::string, std::string, int, std::string);
void onClick(); void onClick();
private: private:
int playerId; int playerId;
+1 -1
View File
@@ -11,7 +11,7 @@ namespace battleship{
using namespace vb01; using namespace vb01;
using namespace gameBase; using namespace gameBase;
TrainButton::TrainButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : TrainButton::TrainButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) :
UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid),
slotId(slId) {} slotId(slId) {}
+1 -1
View File
@@ -6,7 +6,7 @@
namespace battleship{ namespace battleship{
class TrainButton : public UnitButton{ class TrainButton : public UnitButton{
public: public:
TrainButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); TrainButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int);
void onClick(); void onClick();
private: private:
int slotId; int slotId;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace battleship{
using namespace vb01Gui; using namespace vb01Gui;
using namespace gameBase; using namespace gameBase;
UnitButton::UnitButton(Vector2 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath, int uid) : Button(pos, size, name, fontPath, trigger, true, imagePath), unitId(uid){ UnitButton::UnitButton(Vector3 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath, int uid) : Button(pos, size, name, fontPath, trigger, true, imagePath), unitId(uid){
StateManager *stateManager = GameManager::getSingleton()->getStateManager(); StateManager *stateManager = GameManager::getSingleton()->getStateManager();
ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE); ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE);
+1 -1
View File
@@ -8,7 +8,7 @@ namespace battleship{
class UnitButton : public vb01Gui::Button{ class UnitButton : public vb01Gui::Button{
public: public:
UnitButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int, std::string, int); UnitButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int, std::string, int);
protected: protected:
int unitId; int unitId;