From 26944d28ce2c9ae29a334596fef1c71dfe071fb7 Mon Sep 17 00:00:00 2001 From: Martin Bruse Date: Thu, 21 May 2020 20:46:35 +0200 Subject: [PATCH] Made the RDY checkbox in the phase settings actually work for muster phases. Made gunboat games have the chat option in the side menu (but not the option to create channels), so that they can get system messages. --- app/src/main/java/se/oort/diplicity/MemberTable.java | 5 +++-- .../main/java/se/oort/diplicity/game/GameActivity.java | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/se/oort/diplicity/MemberTable.java b/app/src/main/java/se/oort/diplicity/MemberTable.java index 448b1f7..f1222f0 100644 --- a/app/src/main/java/se/oort/diplicity/MemberTable.java +++ b/app/src/main/java/se/oort/diplicity/MemberTable.java @@ -53,7 +53,8 @@ public void setPhaseStates(Game game, PhaseMeta phaseMeta, List phas } public void setMembers(final RetrofitActivity retrofitActivity, Game game, final List members) { removeAllViews(); - boolean fakeFoundPhaseState = false; + Member loggedInMember = retrofitActivity.getLoggedInMember(game); + boolean fakeFoundPhaseState = false; for (final Member member : members) { boolean rowOK = true; TableRow tableRow = new TableRow(retrofitActivity); @@ -118,7 +119,7 @@ public void setMembers(final RetrofitActivity retrofitActivity, Game game, final readyToResolve.setText(R.string.rdy); readyToResolve.setLayoutParams(wrapContentParams); readyToResolve.setChecked(finalFoundState.ReadyToResolve); - if ((!foundState.NoOrders || fakeFoundPhaseState) && !phaseMeta.Resolved && retrofitActivity.getLoggedInUser().Id.equals(member.User.Id)) { + if ((!foundState.NoOrders || fakeFoundPhaseState) && !phaseMeta.Resolved && loggedInMember.User.Id.equals(member.User.Id)) { final Game finalGame = game; readyToResolve.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override diff --git a/app/src/main/java/se/oort/diplicity/game/GameActivity.java b/app/src/main/java/se/oort/diplicity/game/GameActivity.java index e3ced03..e4a75f0 100644 --- a/app/src/main/java/se/oort/diplicity/game/GameActivity.java +++ b/app/src/main/java/se/oort/diplicity/game/GameActivity.java @@ -285,11 +285,7 @@ public void onDrawerStateChanged(int newState) { navigationView = (NavigationView) findViewById(R.id.nav_view); Menu nav_Menu = navigationView.getMenu(); - if (game.Started) { - if (!game.Finished && game.DisableConferenceChat && game.DisableGroupChat && game.DisablePrivateChat) { - nav_Menu.findItem(R.id.nav_press).setVisible(false); - } - } else { + if (!game.Started) { nav_Menu.findItem(R.id.nav_orders).setVisible(false); nav_Menu.findItem(R.id.nav_phases).setVisible(false); nav_Menu.findItem(R.id.nav_press).setVisible(false); @@ -376,7 +372,7 @@ public String toString() { public void showPress() { hideAllExcept(R.id.press_view); - if (member != null) { + if (member != null && !(game.DisableConferenceChat && game.DisableGroupChat && game.DisablePrivateChat)) { FloatingActionButton button = (FloatingActionButton) findViewById(R.id.create_channel_button); button.setVisibility(View.VISIBLE); button.setOnClickListener(new View.OnClickListener() {