Skip to content

Commit

Permalink
Fixed relative .move values being moved more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
newk5 committed Jul 21, 2020
1 parent 47f3fd7 commit 86aa6ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 8 additions & 2 deletions script/decui/UI/UI.nut
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ class UI {
local isString = typeof s.left == "string";
if (isString){
local wrapper = e.getWrapper();
e.resetPosition();
e.realign();
local percent = this.removePercent(s.left).tofloat();
e.Position.X -= ( wrapper.X * percent / 100 ).tofloat();
}else{
Expand All @@ -270,6 +272,8 @@ class UI {
local isString = typeof s.right == "string";
if (isString){
local wrapper = e.getWrapper();
e.resetPosition();
e.realign();
local percent = this.removePercent(s.right).tofloat();

e.Position.X += ( wrapper.X * percent / 100 ).tofloat();
Expand All @@ -281,7 +285,8 @@ class UI {
local isString = typeof s.up == "string";
if (isString){
local wrapper = e.getWrapper();

e.resetPosition();
e.realign();
local percent = this.removePercent(s.up).tofloat();
e.Position.Y -= ( wrapper.Y * percent / 100 ).tofloat();
} else {
Expand All @@ -293,7 +298,8 @@ class UI {

if (isString){
local wrapper = e.getWrapper();

e.resetPosition();
e.realign();
local percent = (this.removePercent(s.down).tofloat() / 100).tofloat();
e.Position.Y += ( wrapper.Y * percent ).tofloat();
} else {
Expand Down
9 changes: 2 additions & 7 deletions script/main.nut
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ dofile("debug.nut")


function Script::ScriptLoad(){



}







0 comments on commit 86aa6ff

Please sign in to comment.