Skip to content

Commit

Permalink
Role icons done. Started working on the new "crew" dialog but messed …
Browse files Browse the repository at this point in the history
…up dialog.lua in the process.

Check out the previous version and fix it.
  • Loading branch information
K-Klear committed Aug 13, 2019
1 parent 810d9a1 commit 98a325c
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 200 deletions.
Binary file added assets/images/Icons/comms.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 assets/images/Icons/empty.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 assets/images/Icons/gunner.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 assets/images/Icons/mech.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 assets/images/Icons/medic.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 assets/images/Icons/none.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 assets/images/Icons/pilot.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 assets/images/atlases/icons.atlas
@@ -0,0 +1,24 @@
images {
image: "/assets/images/Icons/pilot.png"
}
images {
image: "/assets/images/Icons/medic.png"
}
images {
image: "/assets/images/Icons/mech.png"
}
images {
image: "/assets/images/Icons/gunner.png"
}
images {
image: "/assets/images/Icons/comms.png"
}
images {
image: "/assets/images/Icons/none.png"
}
images {
image: "/assets/images/Icons/empty.png"
}
margin: 0
extrude_borders: 0
inner_padding: 1
68 changes: 0 additions & 68 deletions bullshitCodeStorage.txt
@@ -1,68 +0,0 @@
--[[
Stage types:
"choice" - Displays values from table "values" as well as multiple choices. On player input moves to defined stages.
"dice" - Performs a test using "dice_type" and "dice_difficulty" and moves onto stage defined in "success" or "failure".
"end" - Displays final values and closes the dialog after player clicks "OK".

More to come, maybe

--]]

list.pirates[1] = {
stage_type = "dice",
dice_type = "detect",
dice_difficulty = 0.8,
failure = 2,
success = 3
}

list.pirates[2] = {
stage_type = "choice",
title = "Pirate ambush!",
description = "A pirate ship got the drop on you. You'll have to fight.",
choices = {}
}
list.pirates[2].choices[2] = {text = "Fight!", result = 6}

list.pirates[3] = {
stage_type = "choice",
title = "Pirate ambush!",
description = "A pirate ship was ready to ambush you, but your comms officer managed to detect them in time, giving you a chance to flee.",
choices = {}
}
list.pirates[3].choices[1] = {text = "Fight!", result = 6}
list.pirates[3].choices[3] = {text = "Flee", result = 4}

list.pirates[4] = {
stage_type = "dice",
dice_type = "flee",
dice_difficulty = 11,
failure = 7,
success = 5
}

list.pirates[5] = {
stage_type = "end",
title = "You're evaded the ambush",
description = "Firing your engine at full power, you soon leave the pirate ambush far behind you."
}

list.pirates[6] = {
stage_type = "dice",
dice_type = "shoot",
dice_difficulty = 1,
failure = 7,
success = 8
}

list.pirates[7] = {
stage_type = "end",
title = "The pirates hit you hard",
description = "Unable to outrun or outgun the pirates, your ship takes heavy damage. Damage hasn't been implemented yet, though. Lucky bastard."
}

list.pirates[8] = {
stage_type = "end",
title = "Victory!",
description = "The pirate ship explodes violently and is no more. Congratulations! You're safe now."
}
62 changes: 39 additions & 23 deletions main/dialogs.lua
Expand Up @@ -10,7 +10,7 @@ local size = {
action_orbit = {x = 640, y = 64},
info = {x = 256, y = 96},
warning = {x = 280, y = 88},
crew = {x = 192, y = 328},
crew = {x = 474, y = 280},
work = {x = 300, y = 188},
speech = {x = 384, y = 318},
event = {x = 384, y = 318},
Expand All @@ -25,15 +25,14 @@ local pos = {
action_orbit = {x = 640, y = 50},
info = {x = 1280, y = 890},
warning = {x = 640, y = 460},
crew = {x = 6, y = 890},
crew = {x = 640, y = 460},
work = {x = 640, y = 460},
speech = {x = 640, y = 480},
event = {x = 640, y = 480},
}

local pivot = {
info = gui.PIVOT_NE,
crew = gui.PIVOT_NW
info = gui.PIVOT_NE
}

function M.newDialog(kind, show)
Expand Down Expand Up @@ -135,8 +134,9 @@ function M.newDialog(kind, show)
repair = gui.new_text_node(vmath.vector3(-200, 6, 0), "REPAIR"),
upgrade = gui.new_text_node(vmath.vector3(-130, 6, 0), "UPGRADE"),
recruit = gui.new_text_node(vmath.vector3(-60, 6, 0), "RECRUIT"),
work = gui.new_text_node(vmath.vector3(10, 6, 0), "JOBS"),
travel = gui.new_text_node(vmath.vector3(80, 6, 0), "TRAVEL")
crew = gui.new_text_node(vmath.vector3(10, 6, 0), "CREW"),
work = gui.new_text_node(vmath.vector3(80, 6, 0), "JOBS"),
travel = gui.new_text_node(vmath.vector3(150, 6, 0), "TRAVEL")
}
elseif kind == "action_travel" then
gui.set_scale(dialog.frame, vmath.vector3(1, 1, 1))
Expand Down Expand Up @@ -167,28 +167,32 @@ function M.newDialog(kind, show)
gui.set_pivot(dialog.lbl.settlement, gui.PIVOT_W)
gui.set_pivot(dialog.lbl.government, gui.PIVOT_W)
elseif kind == "crew" then
gui.set_scale(dialog.frame, vmath.vector3(1, 1, 1))
--gui.set_scale(dialog.frame, vmath.vector3(1, 1, 1))
dialog.ico = {}
dialog.lbl = {
title = gui.new_text_node(vmath.vector3(96, -16, 0), "CREW")
title = gui.new_text_node(vmath.vector3(0, 124, 0), "CREW"),
name = gui.new_text_node(vmath.vector3(-176, 104, 0), "NAME"),
role = gui.new_text_node(vmath.vector3(-90, 104, 0), "ROLE"),
wage = gui.new_text_node(vmath.vector3(-30, 104, 0), "WAGE"),
ask = gui.new_text_node(vmath.vector3(70, 104, 0), "ASK THEM ABOUT:"),
}
dialog.btn = {
pilotR = gui.new_text_node(vmath.vector3(6, -36, 0), "PILOT"),
commsR = gui.new_text_node(vmath.vector3(6, -56, 0), "COMMS"),
mechR = gui.new_text_node(vmath.vector3(6, -76, 0), "ENGINEER"),
gunnerR = gui.new_text_node(vmath.vector3(6, -96, 0), "GUNNER"),
medicR = gui.new_text_node(vmath.vector3(6, -116, 0), "MEDIC"),
}
for x = 1, 9 do
dialog.btn["crew"..x] = gui.new_text_node(vmath.vector3(32, -116 - 20 * x, 0), "Crewman")
dialog.lbl[x] = {
name = gui.new_text_node(vmath.vector3(-176, 104 - 20 * x, 0), "Crewman"),
wage = gui.new_text_node(vmath.vector3(-30, 104 - 20 * x, 0), "10%")
}
dialog.btn[x] = {
role = gui.new_text_node(vmath.vector3(-90, 104 - 20 * x, 0), "Engineer"),
background = gui.new_text_node(vmath.vector3(40, 104 - 20 * x, 0), "BACKGROUND"),
skills = gui.new_text_node(vmath.vector3(110, 104 - 20 * x, 0), "SKILLS"),
dismiss = gui.new_text_node(vmath.vector3(170, 104 - 20 * x, 0), "DISMISS")
}
end
dialog.btn.pilot = gui.new_text_node(vmath.vector3(100, -36, 0), "Name of Pilot")
dialog.btn.comms = gui.new_text_node(vmath.vector3(100, -56, 0), "Name of Comms")
dialog.btn.mech = gui.new_text_node(vmath.vector3(100, -76, 0), "Name of Mech")
dialog.btn.gunner = gui.new_text_node(vmath.vector3(100, -96, 0), "Name of Guner")
dialog.btn.medic = gui.new_text_node(vmath.vector3(100, -116, 0), "Name of Medic")

for key, val in pairs(dialog.btn) do
gui.set_pivot(val, gui.PIVOT_W)
--gui.set_pivot(val, gui.PIVOT_W)
end
elseif kind == "warning" then
dialog.lbl = {
Expand Down Expand Up @@ -227,12 +231,24 @@ function M.newDialog(kind, show)
end

for key, val in pairs(dialog.lbl) do
gui.set_parent(val, dialog.frame)
gui.set_layer(val, "dialog")
if type(val) == table then
for k, v in ipairs(val) do
gui.set_parent(v, dialog.frame)
gui.set_layer(v, "dialog")
end
else
gui.set_parent(val, dialog.frame)
gui.set_layer(val, "dialog")
end
end

for key, val in pairs(dialog.btn) do
if type(val) == "userdata" then
if type(val) == table then
for k, v in ipairs(val) do
gui.set_parent(v, dialog.frame)
gui.set_layer(v, "dialog")
end
else
gui.set_parent(val, dialog.frame)
gui.set_layer(val, "dialog")
end
Expand Down
4 changes: 4 additions & 0 deletions main/interface.gui
Expand Up @@ -19,6 +19,10 @@ textures {
name: "selection_permanent"
texture: "/assets/images/atlases/selection_permanent.atlas"
}
textures {
name: "icons"
texture: "/assets/images/atlases/icons.atlas"
}
background_color {
x: 0.0
y: 0.0
Expand Down

0 comments on commit 98a325c

Please sign in to comment.