Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dirtyredz committed Feb 25, 2018
1 parent e5995e6 commit c6b876a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 48 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
2.1.1
--Fixed bug in PowerSystems
--Changed how Clock UI gets current time

2.1.0
--Added PowerSystems UI
--Added Notepad UI
--Adjusted core moveui to use local data storage, increases client and server performance.
--Decreased the amount of space used by FactionNotifier
--Dynamic UI's now shrink and grow depending on the individual UI.

1.4.0
--Added Clock UI, Thxs DNightmare
--Added FactionNotifier UI
--Added ability to delete scrapyard licenses data from the UI
--Removed Vanilla files from zip, follow installation instructions please

1.3.0
--Every UI now utilizes delayed server/client communication
Will help tremendously with any high ping issues.
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ A UI that displays notes added via the MoveUI Menu.
___
1. Download the zip file
2. Drag and Drop the contents into the /Avorion/ directory,
File structure:
/avorion
|---->/data
|---->/mods
|---->/MoveUI

3. Place this line at the bottom of this file: data/scripts/entity/merchants/scrapyard.lua

Expand All @@ -108,6 +113,8 @@ I encourage all modders to adopt this file structure as default, as its likely t

## Downloads
___
https://github.com/dirtyredz/MoveUI/releases/download/2.1.1/MoveUI.v2.1.1.zip

https://github.com/dirtyredz/MoveUI/releases/download/2.1.0/MoveUI.v2.1.0.zip

https://github.com/dirtyredz/MoveUI/releases/download/1.4.0/MoveUI.v1.4.0.zip
Expand All @@ -125,6 +132,10 @@ https://github.com/dirtyredz/MoveUI/releases/download/1.0.0/MoveUI.v1.0.0.zip

## Changelog
___
2.1.1
--Fixed bug in PowerSystems
--Changed how Clock UI gets current time

2.1.0
--Added PowerSystems UI
--Added Notepad UI
Expand Down
14 changes: 13 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ A UI that displays notes added via the MoveUI Menu.
[hr]
1. Download the zip file
2. Drag and Drop the contents into the /Avorion/ directory,
File structure:
/avorion
|---->/data
|---->/mods
|---->/MoveUI


3. Place this line at the bottom of this file: data/scripts/entity/merchants/scrapyard.lua
[code]if not pcall(require, 'mods.MoveUI.scripts.entity.merchants.scrapyard') then print('Mod: MoveUI, failed to extend scrapyard.lua!') end[/code]
Expand All @@ -106,10 +112,12 @@ I encourage all modders to adopt this file structure as default, as its likely t

[b][size=24pt]Downloads[/size][/b]
[hr]
[url=https://github.com/dirtyredz/MoveUI/releases/download/2.1.0/MoveUI.v2.1.0.zip]MoveUI v2.1.0[/url]
[url=https://github.com/dirtyredz/MoveUI/releases/download/2.1.1/MoveUI.v2.1.1.zip]MoveUI v2.1.1[/url]

Older Downloads
[spoiler]
[url=https://github.com/dirtyredz/MoveUI/releases/download/2.1.0/MoveUI.v2.1.0.zip]MoveUI v2.1.0[/url]

[url=https://github.com/dirtyredz/MoveUI/releases/download/1.4.0/MoveUI.v1.4.0.zip]MoveUI v1.4.0[/url]

[url=https://github.com/dirtyredz/MoveUI/releases/download/1.3.0/MoveUI.v1.3.0.zip]MoveUI v1.3.0[/url]
Expand All @@ -125,6 +133,10 @@ Older Downloads

[b][size=24pt]Changelog[/size][/b]
[hr]
2.1.1
--Fixed bug in PowerSystems
--Changed how Clock UI gets current time

2.1.0
--Added PowerSystems UI
--Added Notepad UI
Expand Down
44 changes: 2 additions & 42 deletions mods/MoveUI/scripts/player/Clock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ local Description = "Oh no, it's morning again :)"
local rect
local res
local defaultPosition
local currentDate
local currentTime = ''
local date
local AllowMoving
local player


function Clock.initialize()
if onClient() then
player = Player()
Expand All @@ -32,19 +28,13 @@ function Clock.initialize()
--MoveUI - Dirtyredz|David McClain
defaultPosition = vec2(res.x * 0.7,res.y * 0.07)
rect.position = MoveUI.CheckOverride(player, defaultPosition,OverridePosition,Title)
Clock.getCurrentDate()
end
end

function Clock.buildTab(tabbedWindow)
-- TODO: add alarm settings in here
end


function Clock.onSectorEntered()
Clock.getCurrentDate() -- sync time with server on sector change
end

function Clock.onPreRenderHud()
if OverridePosition then
rect.position = OverridePosition
Expand All @@ -59,41 +49,11 @@ function Clock.onPreRenderHud()
drawTextRect(Title, rect, 0, 0,ColorRGB(1,1,1), 10, 0, 0, 0)
return
end

drawTextRect(currentTime, rect,0, 0,ColorRGB(1,1,1), 15, 0, 0, 0)
end

function Clock.getCurrentDate(date)
if onClient() then
if date then
currentDate = date
return
end
invokeServerFunction('getCurrentDate')
return
end

local cDate = os.date ("*t")
invokeClientFunction(Player(callingPlayer),'getCurrentDate', cDate)
local DateTime = os.date("*t")
drawTextRect(DateTime.hour..":"..DateTime.min..":"..DateTime.sec, rect,0, 0,ColorRGB(1,1,1), 15, 0, 0, 0)
end

function Clock.updateClient(timeStep)
if currentDate then
currentDate.sec = math.floor(currentDate.sec + timeStep)
if currentDate.sec >= 60 then
currentDate.sec = 0
currentDate.min = currentDate.min + 1
if currentDate.min >= 60 then
currentDate.min = 0
currentDate.hours = currentDate.hour + 1
-- TODO: add 12/24hr support
if currentDate.hour >= 24 then
currentDate.hour = 0
end
end
end
currentTime = string.format("%02d:%02d:%02d", currentDate.hour, currentDate.min, currentDate.sec)
end
AllowMoving = MoveUI.AllowedMoving()
end

Expand Down
1 change: 1 addition & 0 deletions mods/MoveUI/scripts/player/PowerSystems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function PowerSystems.onPreRenderHud()
end

local HSplit = UIHorizontalMultiSplitter(NewRect, 20, 5, 5)
if not player.craftIndex then return end
local ES = ReadOnlyEnergySystem(player.craftIndex)
if not ES then return end
local FontSize = LoadedOptions.FS or 15
Expand Down
5 changes: 2 additions & 3 deletions mods/MoveUI/scripts/player/ResourcesUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ function ResourcesUI.getUpdateInterval()
end

function updateResourcesInfo()

local allegiance = player.allianceIndex
local allegiance = player.allianceIndex
if LoadedOptions.SA and allegiance then
local a = Alliance(allegiance)
resources = {a:getResources()}
money = a.money
else
else
resources = {player:getResources()}
money = player.money
end
Expand Down
2 changes: 1 addition & 1 deletion mods/MoveUI/scripts/player/ScrapyardLicenses.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function ScrapyardLicenses.onPreRenderHud()
end

local InAllianceShip = false
if not Entity(player.craftIndex) then return end
if not player.craftIndex and not Entity(player.craftIndex) then return end
if player.index ~= Entity(player.craftIndex).factionIndex then
InAllianceShip = true
end
Expand Down

0 comments on commit c6b876a

Please sign in to comment.