Skip to content

Commit

Permalink
ArenaControl
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandr committed Jul 22, 2018
1 parent fe57a7e commit 6db7003
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha4'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0-alpha3'
Expand Down
15 changes: 10 additions & 5 deletions app/src/main/java/ru/sccraft/arenacontrol/CommandEditActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
Expand All @@ -11,6 +12,7 @@ public class CommandEditActivity extends AppCompatActivity {
private Server сервер;
EditText время_день, время_ночь, время_задать, время_добавить;
EditText погода;
SwitchCompat использовать_новые_комманды_переключения_режима_игры;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -19,17 +21,19 @@ protected void onCreate(Bundle savedInstanceState) {
setTitle(R.string.title_activity_server_command);
сервер = Server.fromJSON(getIntent().getStringExtra("server"));

время_день = (EditText) findViewById(R.id.editText_command_day);
время_ночь = (EditText) findViewById(R.id.editText_command_night);
время_задать = (EditText) findViewById(R.id.editText_command_timeSet);
время_добавить = (EditText) findViewById(R.id.editText_command_timeAdd);
погода = (EditText) findViewById(R.id.editText_weather);
время_день = findViewById(R.id.editText_command_day);
время_ночь = findViewById(R.id.editText_command_night);
время_задать = findViewById(R.id.editText_command_timeSet);
время_добавить = findViewById(R.id.editText_command_timeAdd);
погода = findViewById(R.id.editText_weather);
использовать_новые_комманды_переключения_режима_игры = findViewById(R.id.newGameMode);

время_день.setText(сервер.комманда_день);
время_ночь.setText(сервер.комманда_ночь);
время_задать.setText(сервер.комманда_задать_время);
время_добавить.setText(сервер.комманда_добавить_время);
погода.setText(сервер.комманда_погода);
использовать_новые_комманды_переключения_режима_игры.setChecked(сервер.использовать_новые_коммаеды_игровых_режимов);
}

@Override
Expand Down Expand Up @@ -62,6 +66,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
сервер.комманда_задать_время = время_задать.getText().toString();
сервер.комманда_добавить_время = время_добавить.getText().toString();
сервер.комманда_погода = погода.getText().toString();
сервер.использовать_новые_коммаеды_игровых_режимов = использовать_новые_комманды_переключения_режима_игры.isChecked();
fe.saveFile(сервер.получить_токен() + ".json", сервер.toJSON());
finish();
}
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/layout/activity_command_edit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="weather %weather%" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/player_gamemode"
android:textAlignment="center"
android:textSize="36sp"
android:textStyle="bold" />

<android.support.v7.widget.SwitchCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/commandEditActivity_newOrOldGamemode"
android:id="@+id/newGameMode"/>
</LinearLayout>
</ScrollView>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@
<string name="settings_clear_command">Очищать поле ввода комманды</string>
<string name="pleaseWait">Пожалуйста, подождите…</string>
<string name="incorrectToken">Неверный формат Token</string>
<string name="commandEditActivity_newOrOldGamemode">Использовать новые комманды для смены игрового режима (1.13+)</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@
<string name="settings_clear_command">Clear the command input field</string>
<string name="pleaseWait">Please, wait…</string>
<string name="incorrectToken">Incorrect token</string>
<string name="commandEditActivity_newOrOldGamemode">Use new GameMode command (1.13+)</string>
</resources>

0 comments on commit 6db7003

Please sign in to comment.