Backed out changeset: 9ed36a2c6ab2

Making stuff unintuitive is not a "fix".
floating-point
Bernhard Bonigl 2012-04-13 19:18:39 +02:00
parent 71dd5fc64d
commit f5d88c0da5
2 changed files with 14 additions and 14 deletions

View File

@ -108,7 +108,7 @@ func Hide()
} }
} }
func AddContentMenu(object container, int pos, bool is_crew) func AddContentMenu(object container, int pos, bool isCrew)
{ {
var menu = CreateObject(GUI_CircleMenu, 0, 0, GetOwner()); var menu = CreateObject(GUI_CircleMenu, 0, 0, GetOwner());
@ -118,9 +118,9 @@ func AddContentMenu(object container, int pos, bool is_crew)
menu->SetDragDropMenu(true); menu->SetDragDropMenu(true);
PutContentsIntoMenu(menu, container); PutContentsIntoMenu(menu, container);
circ_menus[pos] = {Object = container, Menu = menu, IsCrew = is_crew}; circ_menus[pos] = {Object = container, Menu = menu, IsCrew = isCrew};
if (is_crew) if(isCrew)
crew_count++; crew_count++;
else else
container_count++; container_count++;
@ -515,22 +515,22 @@ private func GetNextMenu(int index, bool alt)
if (last <= 0) if (last <= 0)
return nil; return nil;
if (!alt) if(alt)
{ {
if (index < crew_count-1) if(index < crew_count-1)
index++; index++;
else if (index == crew_count-1) else if(index == crew_count-1)
index = last; index = last;
else if (index == crew_count) else if(index == crew_count)
index = 0; index = 0;
else else
index--; index--;
} }
else else
{ {
if (index == 0) if(index == 0)
index = crew_count; index = crew_count;
else if (index < crew_count) else if(index < crew_count)
index--; index--;
else else
index++; index++;

View File

@ -53,7 +53,7 @@ private func GetItemPosition(int n, int total)
// Packing 7 or less circles. // Packing 7 or less circles.
if (total <= 7) if (total <= 7)
{ {
if (n == 1) if (n == 7)
return [0, 0]; return [0, 0];
else else
{ {
@ -66,9 +66,9 @@ private func GetItemPosition(int n, int total)
// Packing 19 or less circles. // Packing 19 or less circles.
if (total <= 19) if (total <= 19)
{ {
if (n == 1) if (n == 7)
return [0, 0]; return [0, 0];
else if (n <= 7) else if (n < 7)
{ {
var x = -Cos(60 * (n+1), 2 * MENU_Radius / 5); var x = -Cos(60 * (n+1), 2 * MENU_Radius / 5);
var y = -Sin(60 * (n+1), 2 * MENU_Radius / 5); var y = -Sin(60 * (n+1), 2 * MENU_Radius / 5);
@ -85,9 +85,9 @@ private func GetItemPosition(int n, int total)
// Packing 37 or less circles. // Packing 37 or less circles.
if (total <= 37) if (total <= 37)
{ {
if (n == 1) if (n == 7)
return [0, 0]; return [0, 0];
else if (n <= 7) else if (n < 7)
{ {
var x = -Cos(60 * (n+1), 2 * MENU_Radius / 7); var x = -Cos(60 * (n+1), 2 * MENU_Radius / 7);
var y = -Sin(60 * (n+1), 2 * MENU_Radius / 7); var y = -Sin(60 * (n+1), 2 * MENU_Radius / 7);