Fix last commit

This commit is contained in:
UnknownShadow200 2018-03-23 22:02:27 +11:00
parent 342ac2e194
commit 2f07a00b54
7 changed files with 31 additions and 28 deletions

View File

@ -53,8 +53,11 @@ namespace ClassicalSharp.Entities {
State state = Searcher.stateCache[i];
bPos.X = state.X >> 3; bPos.Y = state.Y >> 3; bPos.Z = state.Z >> 3;
int block = (state.X & 0x7) | (state.Y & 0x7) << 3 | (state.Z & 0x7) << 6;
blockBB.Min = bPos + BlockInfo.MinBB[block];
blockBB.Max = bPos + BlockInfo.MaxBB[block];
blockBB.Min = BlockInfo.MinBB[block];
blockBB.Min.X += bPos.X; blockBB.Min.Y += bPos.Y; blockBB.Min.Z += bPos.Z;
blockBB.Max = BlockInfo.MaxBB[block];
blockBB.Max.X += bPos.X; blockBB.Max.Y += bPos.Y; blockBB.Max.Z += bPos.Z;
if (!entityExtentBB.Intersects(blockBB)) continue;
// Recheck time to collide with block (as colliding with blocks modifies this)

View File

@ -42,27 +42,27 @@ namespace Launcher.Gui.Views {
nIndex = widgetIndex;
Makers.Button(this, "Enhanced", 145, 35, titleFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, -72);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 250, -72);
Makers.Label(this, "&eEnables custom blocks, changing env", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 - 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 - 12);
Makers.Label(this, "&esettings, longer messages, and more", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 + 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 + 12);
clHaxIndex = widgetIndex;
Makers.Button(this, "Classic +hax", 145, 35, titleFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, 0);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 0);
Makers.Label(this, "&eSame as Classic mode, except that", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 0 - 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 - 12);
Makers.Label(this, "&ehacks (noclip/fly/speed) are enabled", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 0 + 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 + 12);
clIndex = widgetIndex;
Makers.Button(this, "Classic", 145, 35, titleFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, 72);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 72);
Makers.Label(this, "&eOnly uses blocks and features from", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 72 - 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 - 12);
Makers.Label(this, "&ethe original minecraft classic", textFont)
.SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 72 + 12);
.SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 + 12);
if (FirstTime) {
backIndex = -1;

View File

@ -60,11 +60,11 @@ namespace Launcher.Gui.Views {
sliderIndex = widgetIndex;
Makers.Slider(this, 100, 10, 30, 255, FastColour.Red)
.SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 5);
.SetLocation(Anchor.Min, Anchor.Min, 5, 5);
Makers.Slider(this, 100, 10, 30, 255, FastColour.Green)
.SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 25);
.SetLocation(Anchor.Min, Anchor.Min, 5, 25);
Makers.Slider(this, 100, 10, 30, 255, FastColour.Blue)
.SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 45);
.SetLocation(Anchor.Min, Anchor.Min, 5, 45);
}
public void MakeAllRGBTriplets(bool force) {

View File

@ -65,11 +65,11 @@ namespace Launcher.Gui.Views {
widgets[sslIndex + 1].Visible = sslVisible;
Makers.Label(this, updateText, inputHintFont)
.SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -45);
.SetLocation(Anchor.Max, Anchor.Max, -10, -45);
settingsIndex = widgetIndex;
Makers.Button(this, "Options", 100, buttonHeight, titleFont)
.SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -6, -6);
.SetLocation(Anchor.Max, Anchor.Max, -6, -6);
}
}
}

View File

@ -36,18 +36,18 @@ namespace Launcher.Gui.Views {
protected override void MakeWidgets() {
widgetIndex = 0;
MakeInput(Get(0), 370, false, 32, "&gSearch servers..")
.SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 10, 10);
.SetLocation(Anchor.Min, Anchor.Min, 10, 10);
MakeInput(Get(1), 475, false, 32, "&gclassicube.net/server/play/...")
.SetLocation(Anchor.LeftOrTop, Anchor.BottomOrRight, 10, -10);
.SetLocation(Anchor.Min, Anchor.Max, 10, -10);
Makers.Button(this, "Back", 110, 30, titleFont)
.SetLocation(Anchor.BottomOrRight, Anchor.LeftOrTop, -10, 10);
.SetLocation(Anchor.Max, Anchor.Min, -10, 10);
Makers.Button(this, "Connect", 130, 30, titleFont)
.SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -10);
.SetLocation(Anchor.Max, Anchor.Max, -10, -10);
MakeTableWidget();
Makers.Button(this, RefreshText, 110, 30, titleFont)
.SetLocation(Anchor.BottomOrRight, Anchor.LeftOrTop, -135, 10);
.SetLocation(Anchor.Max, Anchor.Min, -135, 10);
}
string Get(int index) {
@ -93,7 +93,7 @@ namespace Launcher.Gui.Views {
void ResetTable(TableWidget widget) {
widget.SetEntries(game.Servers);
widget.SetDrawData(drawer, tableFont, textFont,
Anchor.LeftOrTop, Anchor.LeftOrTop, tableX, tableY);
Anchor.Min, Anchor.Min, tableX, tableY);
widget.SortDefault();
}

View File

@ -63,8 +63,8 @@ namespace Launcher.Gui.Widgets {
}
static int CalcPos(Anchor anchor, int offset, int size, int axisLen) {
if (anchor == Anchor.LeftOrTop) return offset;
if (anchor == Anchor.BottomOrRight) return offset + axisLen - size;
if (anchor == Anchor.Min) return offset;
if (anchor == Anchor.Max) return offset + axisLen - size;
return offset + axisLen / 2 - size / 2;
}
}

View File

@ -467,10 +467,10 @@ void ShadowComponent_DrawCoords(VertexP3fT2fC4b** vertices, Entity* entity, Shad
VertexP3fT2fC4b* ptr = *vertices;
VertexP3fT2fC4b v; v.Y = data->Y; v.Col = col;
v.X = x1; v.Z = z1; v.U = u1; v.V = v1; *ptr = v; ptr++;
v.X = x2; v.U = u2; *ptr = v; ptr++;
v.Z = z2; v.V = v2; *ptr = v; ptr++;
v.X = x1; v.U = u1; *ptr = v; ptr++;
v.X = x1; v.Z = z1; v.U = u1; v.V = v1; *ptr++ = v;
v.X = x2; v.U = u2; *ptr++ = v;
v.Z = z2; v.V = v2; *ptr++ = v;
v.X = x1; v.U = u1; *ptr++ = v;
*vertices = ptr;
}