Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Salminar committed Feb 14, 2017
1 parent 1ed665a commit 1484a8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/entity/transfercrewgoods.lua
Expand Up @@ -19,15 +19,13 @@ local playerCargoButtons = {}
local selfCargoBars = {}
local selfCargoButtons = {}


local playerTotalFighterBar;
local selfTotalFighterBar;


local crewmenByButton = {}
local cargosByButton = {}


-- if this function returns false, the script will not be listed in the interaction window,
-- even though its UI may be registered
function interactionPossible(playerIndex, option)
Expand Down Expand Up @@ -58,15 +56,14 @@ end

-- create all required UI elements for the client side
function initUI()

local res = getResolution();
local size = vec2(700, 600)

local menu = ScriptUI()
local window = menu:createWindow(Rect(res * 0.5 - size * 0.5, res * 0.5 + size * 0.5));
menu:registerWindow(window, "Transfer Crew/Cargo/Fighters"%_t);
menu:registerWindow(window, "Transfer Crew/Cargo"%_t);

window.caption = "Transfer Crew, Cargo and Fighters"%_t
window.caption = "Transfer Crew and Cargo"%_t
window.showCloseButton = 1
window.moveable = 1

Expand Down Expand Up @@ -114,9 +111,10 @@ function initUI()


local rect = rightLister:placeCenter(vec2(rightLister.inner.width, 25))
local vsplit = UIVerticalSplitter(rect, 10, 0, 0.20)
local vsplit = UIVerticalSplitter(rect, 7, 0, 0.20)
local vsplit2 = UIVerticalSplitter(vsplit.left, 3, 0, 0.5)


local button = rightFrame:createButton(vsplit2.left, "<", "onSelfTransferCrewPressed")
local button2 = rightFrame:createButton(vsplit2.right, "<<", "onSelfTransferCrewPressedx")
local bar = rightFrame:createStatisticsBar(vsplit.right, ColorRGB(1, 1, 1))
Expand Down Expand Up @@ -153,10 +151,10 @@ function initUI()
selfTotalCargoBar = rightFrame:createNumbersBar(Rect())
rightLister:placeElementCenter(selfTotalCargoBar)

for i = 1, 20 do
for i = 1, 30 do

local rect = leftLister:placeCenter(vec2(leftLister.inner.width, 25))
local vsplit = UIVerticalSplitter(rect, 10, 0, 0.80)
local vsplit = UIVerticalSplitter(rect, 7, 0, 0.80)
local vsplit2 = UIVerticalSplitter(vsplit.right, 3, 0, 0.5)


Expand Down Expand Up @@ -284,7 +282,7 @@ function updateData()
local crewman = p.crewman
local num = p.num

local caption = num .. " " .. crewman.profession.name
local caption = num .. " " .. crewman.profession.name .. " lv " .. crewman.level

playerTotalCrewBar:addEntry(num, caption, crewman.profession.color)

Expand All @@ -308,7 +306,7 @@ function updateData()
local crewman = p.crewman
local num = p.num

local caption = num .. " " .. crewman.profession.name
local caption = num .. " " .. crewman.profession.name .. " lv " .. crewman.level

selfTotalCrewBar:addEntry(num, caption, crewman.profession.color)

Expand Down Expand Up @@ -412,6 +410,7 @@ function onSelfTransferCrewPressed(button)
local crewmanIndex = crewmenByButton[button.index]
if not crewmanIndex then return end


invokeServerFunction("transferCrew", crewmanIndex, Player().craftIndex, true)
end

Expand Down Expand Up @@ -501,6 +500,7 @@ end
function onSelfTransferCargoPressed(button)
-- transfer cargo from self to player ship


-- check which cargo
local cargo = cargosByButton[button.index]
if cargo == nil then return end
Expand Down
Binary file modified scripts/entity/transferpreview.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1484a8d

Please sign in to comment.