Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed menus #193

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Fixed menus #193

wants to merge 9 commits into from

Conversation

TBubba
Copy link

@TBubba TBubba commented Apr 6, 2015

Added a lot of comments in the singleplayer and multiplayer menu.
Enhanced (and fix some bugs) in the server browser.
Created a browser for singleplayer games (browse through saved games) based on the multiplayer browser.
Sorted out some of the messy parts of the code.

(First time ever pull requesting, so I'm not entirely sure what to type here or what a pull request actually is)

The last commit could not be compiled, so I made very few changes to fix
that (VS08).
Fixed some bugs in the multiplayer and singleplayer menues.
Added a bunch of comments (some are probably badly written and/or
incorrect).
Moved saves folder from "My Documents" to "My
Documents\MainDigger\Saves".
Added a method that creates the save foler (of course).
Made some of the buttons in singleplayer/multiplayer allign with the
bottom right corner (instead of letting them float in the middle
somewhere).
Added a singleplayer browser for saved games in the saves folder (a
modified version of the server browser).

And some other, minor, stuffs that I do not remember.
@croxxx
Copy link
Member

croxxx commented Apr 6, 2015

Hm, seems like you did quite some stuff. Nice to see 😄

A few points I've come across:

  • Singleplayer save management does not work. Produces a crash for me.
  • You changed the solution file and build commands. Why so? They work perfectly for me (on Windows as well as Linux)
  • It seems you fixed a build error that I already fixed earlier today :)
  • You reformatted quite a lot of if-statements:
if (cond)
    stuff();

instead of

if (cond)
{
    stuff();
}

This isn't particularly bad but should be consistent throughout the application.


Overall some good work.

@TBubba
Copy link
Author

TBubba commented Apr 6, 2015

  • I found out that the singleplayer menu crashes if the user has no saved games, I'll fix that right away.
  • The solution commands gave me an error (error code 9009 if I'm not mistaken), but I switched to the previous one now and it works fine. Not sure why.
  • ^^
  • I'm not entirely sure how I should write my code. Should I continue without the brackets or should I use them?

Expect a commit very soon. 😊

Returned to previous PreBuildEvent (since it works now, for some
reason).
Fixed bug where pageCount could be negative in singplayer menu (this
caused index to be negative which is used with an array - which caused
an exception).
Positioned the page label better (in singleplayer and multiplayer).
Positioned the page label in multiplayer better.
(Forgot it in the last commit)
@TBubba
Copy link
Author

TBubba commented Apr 6, 2015

Apparently the page count could be negative in certain resolutions (and cause a crash), but that is probably not what happened to you. I would assume that Platform.CreateSavegamesDirectory() could cause crashes, I'll look into it.

EDIT:
I just reverted to the pre-build events from the main branch manually (since Visual Studio somehow failed) and now I get the following error message:

The command "cd K:\GitHub\manicdigger\
cmd /c "K:\GitHub\manicdigger\\BuildCito.bat"" exited with code 9009.

ss 2015-04-07 at 12 55 49

I tried removing the double '', but I still get the same error.

EDIT2:
Should I be concerned about how the Travis CI can not build my fork?

@croxxx
Copy link
Member

croxxx commented Apr 7, 2015

CiTo is a bit picky as it doesn't support the full C# syntax. The build commands should definitely work, though...
No, Travis failing is a result of it trying to upload the build which it isn't allowed from repos other than main repo. I'll try to get this fixed as it can be kinda annoying.

@croxxx
Copy link
Member

croxxx commented Apr 7, 2015

On brackets:
In most of the code I've seen the if-statements with brackets always included. I think this should stay that way.

Oh, and I think you can remove/exclude single commits from pull requests (just noticed the solution file changes are still in the request).

Improved both singleplayer and multiplayer game browsers.
Fixed multiple crash causing bugs.
"Connect" and "Play" are now grayed out until a server/save is selected
(this is to make it more visable when you can and can not press these
buttons).
Now the visual server/save selection should be correct (it used to be
incorrect if you picked a save/server and then scrolled).
Commented out classes that are in the works (MenuWidgets) since I'm
planning on remaking the widget system (probably not, but mby).
Other stuffs.
@TBubba
Copy link
Author

TBubba commented Apr 7, 2015

I found a couple of bugs and fixed them during the day, including the one you were suffering from. The menus are as far as I know crash-proof now. 😄
There are however some more things I would like to improve (especially the refresh button I added to the singleplayer menu) before insisting on a merge.

Regarding the brackets. I'm switching back to using brackets like the majority of the code. But would it be okay for me to not use brackets in switches or loops where I do something like the following?

if (someIndex == -1) break;
if (someValue == null) continue;

(I saw something like this somewhere else in the project if I'm not mistaken)

I'll switch back to the previous project file (but with the new class) in the upcoming commit.

Added icon for refresh button.
Moved refresh button in both menus.
Other minor stuff.
@croxxx
Copy link
Member

croxxx commented Apr 7, 2015

Hm, I think so far this version has been used:

if (cond) { code(); }

@TBubba
Copy link
Author

TBubba commented Apr 7, 2015

That seems more likely, I'll start typing like that instead.

Added "New World" screen for creating singleplayer worlds.
Fixed tabbing order in some screens.
Changed page/pageCount position in singleplayer and multiplayer screes.
Changed logo position in main menu (it shifted somewhat, but scales
better with the resolution).

Other minor stuff as well.
Scaled most widgets to work better in the browser version.
Added remove button for the singleplayer menu (for removing saved games
- does not work yet).

Halfway through implementing the login button in multiplayer (that is
why the code in login is quite messy and makes little sense).
@TBubba
Copy link
Author

TBubba commented Apr 8, 2015

I would like to add a Remove button in the singleplayer menu for removing saved games, but it seems like there is no way to do that right now.
Should I add a method for removing files in Platform?

I would also like to make double-clicking servers (or saves) a way to connect to (or open) them.
I'm thinking of implementing a timer (counting the parameter from Render(float dt) each frame) that resets whenever a widget is pressed, and then just check if the widget is pressed again before x amount of time has passed. (This is mostly a note so I won't forget it before I implement it)

Also, I will be gone for a couple of days (but I'll still probably do some coding 🚂).

@Colink02
Copy link

Colink02 commented Apr 9, 2015

can someone make a thing where once your signed in you dont have to wait a couple secs on the login page when your sign in

@TBubba
Copy link
Author

TBubba commented Apr 9, 2015

@colin500 You wait at the login screen because the client needs to fetch more info about the server before it can connect (and also check if your username/password combination is correct), if I'm not mistaken.

I'm actually in the middle of "enhancing" the login screen, so I could make it more obvious what is going on. Thanks for pointing it out. :)

@TBubba TBubba closed this Apr 9, 2015
@TBubba TBubba reopened this Apr 9, 2015
@TBubba
Copy link
Author

TBubba commented Apr 9, 2015

I misclicked and some crazy stuff happened (damn touch keyboard).

@croxxx
Copy link
Member

croxxx commented Apr 9, 2015

@colin500 I guess what you are experiencing is the actual login process.
Whenever you join a server you are logged in and depending on your PC and internet connection this may take a second.

@Colink02
Copy link

Colink02 commented Apr 9, 2015

ok

The button does still not work yet.

Client does not try to log in (with no username & password) when user
presses the Login button in the multiplayer menu.
@croxxx
Copy link
Member

croxxx commented Apr 29, 2015

@TBubba What's the current status of this?

@TBubba
Copy link
Author

TBubba commented Apr 30, 2015

@croxxx I haven't touched it for a couple of weeks (school you know), but I'll get onto finishing it early July.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants