ADD: lastip
This commit is contained in:
@@ -79,6 +79,8 @@ OptionInt keyMenuCancel("key.menu.cancel", 8);
|
||||
|
||||
OptionBool firstLaunch("firstLaunch", true);
|
||||
|
||||
OptionString lastIp("lastip");
|
||||
|
||||
void Options::initTable() {
|
||||
m_options[OPTIONS_DIFFICULTY] = &difficulty;
|
||||
m_options[OPTIONS_HIDEGUI] = &hidegui;
|
||||
@@ -158,6 +160,7 @@ void Options::initTable() {
|
||||
m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint;
|
||||
|
||||
m_options[OPTIONS_AUTOJUMP] = &autoJump;
|
||||
m_options[OPTIONS_LAST_IP] = &lastIp;
|
||||
}
|
||||
|
||||
void Options::set(OptionId key, const std::string& value) {
|
||||
|
||||
@@ -81,6 +81,7 @@ enum OptionId {
|
||||
OPTIONS_KEY_MENU_CANCEL,
|
||||
|
||||
OPTIONS_FIRST_LAUNCH,
|
||||
OPTIONS_LAST_IP,
|
||||
|
||||
// Should be last!
|
||||
OPTIONS_COUNT
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "ProgressScreen.h"
|
||||
#include "../Font.h"
|
||||
#include "../../../network/RakNetInstance.h"
|
||||
#include "client/Options.h"
|
||||
#include "client/gui/Screen.h"
|
||||
#include "client/gui/components/TextBox.h"
|
||||
#include "network/ClientSideNetworkHandler.h"
|
||||
|
||||
@@ -31,7 +33,7 @@ void JoinByIPScreen::buttonClicked(Button* button)
|
||||
|
||||
minecraft->joinMultiplayerFromString(tIP.text);
|
||||
{
|
||||
|
||||
minecraft->options.set(OPTIONS_LAST_IP, tIP.text);
|
||||
bJoin.active = false;
|
||||
bBack.active = false;
|
||||
minecraft->setScreen(new ProgressScreen());
|
||||
@@ -55,6 +57,7 @@ bool JoinByIPScreen::handleBackEvent(bool isDown)
|
||||
|
||||
void JoinByIPScreen::tick()
|
||||
{
|
||||
Screen::tick();
|
||||
bJoin.active = !tIP.text.empty();
|
||||
}
|
||||
|
||||
@@ -78,6 +81,8 @@ void JoinByIPScreen::init()
|
||||
tabButtons.push_back(&bBack);
|
||||
tabButtons.push_back(&bHeader);
|
||||
#endif
|
||||
|
||||
tIP.text = minecraft->options.getStringValue(OPTIONS_LAST_IP);
|
||||
}
|
||||
|
||||
void JoinByIPScreen::setupPositions() {
|
||||
|
||||
Reference in New Issue
Block a user