Added fps/performance checkbox (no functionality yet)

This commit is contained in:
= 2018-03-21 16:44:48 +01:00
parent 2b68b1ba7b
commit 30b702b778
6 changed files with 222 additions and 169 deletions

View File

@ -529,29 +529,29 @@ public final class R {
public static final int search_src_text = 0x7f080077; public static final int search_src_text = 0x7f080077;
public static final int search_voice_btn = 0x7f080078; public static final int search_voice_btn = 0x7f080078;
public static final int select_dialog_listview = 0x7f080079; public static final int select_dialog_listview = 0x7f080079;
public static final int shortcut = 0x7f08008d; public static final int shortcut = 0x7f08008f;
public static final int showCustom = 0x7f080092; public static final int showCustom = 0x7f080094;
public static final int showHome = 0x7f080093; public static final int showHome = 0x7f080095;
public static final int showTitle = 0x7f080094; public static final int showTitle = 0x7f080096;
public static final int spacer = 0x7f080095; public static final int spacer = 0x7f080097;
public static final int split_action_bar = 0x7f080096; public static final int split_action_bar = 0x7f080098;
public static final int src_atop = 0x7f080097; public static final int src_atop = 0x7f080099;
public static final int src_in = 0x7f080098; public static final int src_in = 0x7f08009a;
public static final int src_over = 0x7f080099; public static final int src_over = 0x7f08009b;
public static final int status_bar_latest_event_content = 0x7f08009f; public static final int status_bar_latest_event_content = 0x7f0800a1;
public static final int submit_area = 0x7f0800a0; public static final int submit_area = 0x7f0800a2;
public static final int tabMode = 0x7f0800a1; public static final int tabMode = 0x7f0800a3;
public static final int text = 0x7f0800a3; public static final int text = 0x7f0800a5;
public static final int text2 = 0x7f0800a4; public static final int text2 = 0x7f0800a6;
public static final int textSpacerNoButtons = 0x7f0800a5; public static final int textSpacerNoButtons = 0x7f0800a7;
public static final int time = 0x7f0800a6; public static final int time = 0x7f0800a8;
public static final int title = 0x7f0800a7; public static final int title = 0x7f0800a9;
public static final int title_template = 0x7f0800a8; public static final int title_template = 0x7f0800aa;
public static final int topPanel = 0x7f0800c0; public static final int topPanel = 0x7f0800c2;
public static final int up = 0x7f0800d2; public static final int up = 0x7f0800d4;
public static final int useLogo = 0x7f0800d3; public static final int useLogo = 0x7f0800d5;
public static final int withText = 0x7f0800d4; public static final int withText = 0x7f0800d6;
public static final int wrap_content = 0x7f0800dd; public static final int wrap_content = 0x7f0800df;
} }
public static final class integer { public static final class integer {
public static final int abc_config_activityDefaultDur = 0x7f090000; public static final int abc_config_activityDefaultDur = 0x7f090000;

View File

@ -690,105 +690,107 @@ int id search_src_text 0x7f080077
int id search_voice_btn 0x7f080078 int id search_voice_btn 0x7f080078
int id select_dialog_listview 0x7f080079 int id select_dialog_listview 0x7f080079
int id settings_credits 0x7f08007a int id settings_credits 0x7f08007a
int id settings_music_label 0x7f08007b int id settings_fps_checkbox 0x7f08007b
int id settings_musictoggle 0x7f08007c int id settings_music_label 0x7f08007c
int id settings_reset 0x7f08007d int id settings_musictoggle 0x7f08007d
int id settings_sounds_label 0x7f08007e int id settings_performance_checkbox 0x7f08007e
int id settings_soundtoggle 0x7f08007f int id settings_reset 0x7f08007f
int id settings_topbar 0x7f080080 int id settings_sounds_label 0x7f080080
int id shape_button_button 0x7f080081 int id settings_soundtoggle 0x7f080081
int id shape_button_textview 0x7f080082 int id settings_topbar 0x7f080082
int id shape_inspector_check_box 0x7f080083 int id shape_button_button 0x7f080083
int id shape_inspector_check_box_image 0x7f080084 int id shape_button_textview 0x7f080084
int id shape_inspector_check_box_text 0x7f080085 int id shape_inspector_check_box 0x7f080085
int id shape_inspector_description 0x7f080086 int id shape_inspector_check_box_image 0x7f080086
int id shape_inspector_imageview 0x7f080087 int id shape_inspector_check_box_text 0x7f080087
int id shape_inspector_title 0x7f080088 int id shape_inspector_description 0x7f080088
int id shape_shop_bottomRow 0x7f080089 int id shape_inspector_imageview 0x7f080089
int id shape_shop_shape_inspector 0x7f08008a int id shape_inspector_title 0x7f08008a
int id shape_shop_topRow 0x7f08008b int id shape_shop_bottomRow 0x7f08008b
int id shape_shop_topbar 0x7f08008c int id shape_shop_shape_inspector 0x7f08008c
int id shortcut 0x7f08008d int id shape_shop_topRow 0x7f08008d
int id shortmenu_continue 0x7f08008e int id shape_shop_topbar 0x7f08008e
int id shortmenu_exit 0x7f08008f int id shortcut 0x7f08008f
int id shortmenu_restart 0x7f080090 int id shortmenu_continue 0x7f080090
int id shortmenu_topbar 0x7f080091 int id shortmenu_exit 0x7f080091
int id showCustom 0x7f080092 int id shortmenu_restart 0x7f080092
int id showHome 0x7f080093 int id shortmenu_topbar 0x7f080093
int id showTitle 0x7f080094 int id showCustom 0x7f080094
int id spacer 0x7f080095 int id showHome 0x7f080095
int id split_action_bar 0x7f080096 int id showTitle 0x7f080096
int id src_atop 0x7f080097 int id spacer 0x7f080097
int id src_in 0x7f080098 int id split_action_bar 0x7f080098
int id src_over 0x7f080099 int id src_atop 0x7f080099
int id startscreen_finish_world_1 0x7f08009a int id src_in 0x7f08009a
int id startscreen_gain_90_ep 0x7f08009b int id src_over 0x7f08009b
int id startscreen_play 0x7f08009c int id startscreen_finish_world_1 0x7f08009c
int id startscreen_to_gl_test_screen 0x7f08009d int id startscreen_gain_90_ep 0x7f08009d
int id startscreen_unlock_levels 0x7f08009e int id startscreen_play 0x7f08009e
int id status_bar_latest_event_content 0x7f08009f int id startscreen_to_gl_test_screen 0x7f08009f
int id submit_area 0x7f0800a0 int id startscreen_unlock_levels 0x7f0800a0
int id tabMode 0x7f0800a1 int id status_bar_latest_event_content 0x7f0800a1
int id task_completed_unlock_list 0x7f0800a2 int id submit_area 0x7f0800a2
int id text 0x7f0800a3 int id tabMode 0x7f0800a3
int id text2 0x7f0800a4 int id task_completed_unlock_list 0x7f0800a4
int id textSpacerNoButtons 0x7f0800a5 int id text 0x7f0800a5
int id time 0x7f0800a6 int id text2 0x7f0800a6
int id title 0x7f0800a7 int id textSpacerNoButtons 0x7f0800a7
int id title_template 0x7f0800a8 int id time 0x7f0800a8
int id tool_button_animation_layer 0x7f0800a9 int id title 0x7f0800a9
int id tool_button_background_layer 0x7f0800aa int id title_template 0x7f0800aa
int id tool_button_progress_bar 0x7f0800ab int id tool_button_animation_layer 0x7f0800ab
int id tool_inspector_description 0x7f0800ac int id tool_button_background_layer 0x7f0800ac
int id tool_inspector_imageview 0x7f0800ad int id tool_button_progress_bar 0x7f0800ad
int id tool_inspector_level_view 0x7f0800ae int id tool_inspector_description 0x7f0800ae
int id tool_inspector_pricebutton 0x7f0800af int id tool_inspector_imageview 0x7f0800af
int id tool_inspector_title 0x7f0800b0 int id tool_inspector_level_view 0x7f0800b0
int id toolbutton_1 0x7f0800b1 int id tool_inspector_pricebutton 0x7f0800b1
int id toolbutton_2 0x7f0800b2 int id tool_inspector_title 0x7f0800b2
int id toolbutton_3 0x7f0800b3 int id toolbutton_1 0x7f0800b3
int id toolbutton_4 0x7f0800b4 int id toolbutton_2 0x7f0800b4
int id toolofferslot_slot 0x7f0800b5 int id toolbutton_3 0x7f0800b5
int id toolofferslot_title 0x7f0800b6 int id toolbutton_4 0x7f0800b6
int id toolshop_slot1 0x7f0800b7 int id toolofferslot_slot 0x7f0800b7
int id toolshop_slot2 0x7f0800b8 int id toolofferslot_title 0x7f0800b8
int id toolshop_slot3 0x7f0800b9 int id toolshop_slot1 0x7f0800b9
int id toolshop_slot4 0x7f0800ba int id toolshop_slot2 0x7f0800ba
int id toolshop_tool_offer_bottom_row 0x7f0800bb int id toolshop_slot3 0x7f0800bb
int id toolshop_tool_offer_top_row 0x7f0800bc int id toolshop_slot4 0x7f0800bc
int id toolshop_toolinspector 0x7f0800bd int id toolshop_tool_offer_bottom_row 0x7f0800bd
int id toolshop_topbar 0x7f0800be int id toolshop_tool_offer_top_row 0x7f0800be
int id toolslot_image 0x7f0800bf int id toolshop_toolinspector 0x7f0800bf
int id topPanel 0x7f0800c0 int id toolshop_topbar 0x7f0800c0
int id topbar_back_button 0x7f0800c1 int id toolslot_image 0x7f0800c1
int id topbar_energycount 0x7f0800c2 int id topPanel 0x7f0800c2
int id topbar_energycount_decrease 0x7f0800c3 int id topbar_back_button 0x7f0800c3
int id topbar_energyview 0x7f0800c4 int id topbar_energycount 0x7f0800c4
int id topbar_leveldisplay 0x7f0800c5 int id topbar_energycount_decrease 0x7f0800c5
int id topbar_levellayout 0x7f0800c6 int id topbar_energyview 0x7f0800c6
int id topbar_levelprogress 0x7f0800c7 int id topbar_leveldisplay 0x7f0800c7
int id topbar_settings 0x7f0800c8 int id topbar_levellayout 0x7f0800c8
int id topbar_shapeshop 0x7f0800c9 int id topbar_levelprogress 0x7f0800c9
int id topbar_starcount 0x7f0800ca int id topbar_settings 0x7f0800ca
int id topbar_starcount_decrease 0x7f0800cb int id topbar_shapeshop 0x7f0800cb
int id topbar_starview 0x7f0800cc int id topbar_starcount 0x7f0800cc
int id topbar_toolshop 0x7f0800cd int id topbar_starcount_decrease 0x7f0800cd
int id tutorial_image_view 0x7f0800ce int id topbar_starview 0x7f0800ce
int id tutorial_text_view 0x7f0800cf int id topbar_toolshop 0x7f0800cf
int id unlockmessage_message 0x7f0800d0 int id tutorial_image_view 0x7f0800d0
int id unlockmessage_toolimage 0x7f0800d1 int id tutorial_text_view 0x7f0800d1
int id up 0x7f0800d2 int id unlockmessage_message 0x7f0800d2
int id useLogo 0x7f0800d3 int id unlockmessage_toolimage 0x7f0800d3
int id withText 0x7f0800d4 int id up 0x7f0800d4
int id worldbutton_energycount 0x7f0800d5 int id useLogo 0x7f0800d5
int id worldbutton_levelcount 0x7f0800d6 int id withText 0x7f0800d6
int id worldbutton_lock 0x7f0800d7 int id worldbutton_energycount 0x7f0800d7
int id worldbutton_preview 0x7f0800d8 int id worldbutton_levelcount 0x7f0800d8
int id worldbutton_starcount 0x7f0800d9 int id worldbutton_lock 0x7f0800d9
int id worldbutton_title 0x7f0800da int id worldbutton_preview 0x7f0800da
int id worlds_layout 0x7f0800db int id worldbutton_starcount 0x7f0800db
int id worlds_topbar 0x7f0800dc int id worldbutton_title 0x7f0800dc
int id wrap_content 0x7f0800dd int id worlds_layout 0x7f0800dd
int id worlds_topbar 0x7f0800de
int id wrap_content 0x7f0800df
int integer abc_config_activityDefaultDur 0x7f090000 int integer abc_config_activityDefaultDur 0x7f090000
int integer abc_config_activityShortDur 0x7f090001 int integer abc_config_activityShortDur 0x7f090001
int integer abc_max_action_buttons 0x7f090002 int integer abc_max_action_buttons 0x7f090002

View File

@ -3,6 +3,7 @@ package de.frajul.endlessroll.main.screens;
import android.support.annotation.IdRes; import android.support.annotation.IdRes;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.ToggleButton; import android.widget.ToggleButton;
@ -24,6 +25,8 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
private TopBar topBar; private TopBar topBar;
private ToggleButton musicToggle; private ToggleButton musicToggle;
private ToggleButton soundToggle; private ToggleButton soundToggle;
private CheckBox fpsCheckbox;
private CheckBox performanceCheckbox;
private Button creditsButton; private Button creditsButton;
private Button resetButton; private Button resetButton;
@ -39,6 +42,10 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
musicToggle.setOnClickListener(this); musicToggle.setOnClickListener(this);
soundToggle = (ToggleButton) layout.findViewById(R.id.settings_soundtoggle); soundToggle = (ToggleButton) layout.findViewById(R.id.settings_soundtoggle);
soundToggle.setOnClickListener(this); soundToggle.setOnClickListener(this);
fpsCheckbox = (CheckBox) layout.findViewById(R.id.settings_fps_checkbox);
fpsCheckbox.setTypeface(gameActivity.getTypeface());
performanceCheckbox = (CheckBox) layout.findViewById(R.id.settings_performance_checkbox);
performanceCheckbox.setTypeface(gameActivity.getTypeface());
creditsButton = (Button) layout.findViewById(R.id.settings_credits); creditsButton = (Button) layout.findViewById(R.id.settings_credits);
creditsButton.setOnClickListener(this); creditsButton.setOnClickListener(this);
resetButton = (Button) layout.findViewById(R.id.settings_reset); resetButton = (Button) layout.findViewById(R.id.settings_reset);
@ -63,6 +70,7 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
musicToggle.setChecked(!gameActivity.getSoundManager().isMusicMuted()); musicToggle.setChecked(!gameActivity.getSoundManager().isMusicMuted());
soundToggle.setChecked(!gameActivity.getSoundManager().isSoundsMuted()); soundToggle.setChecked(!gameActivity.getSoundManager().isSoundsMuted());
//TODO: set fps/performance checkboxes selected
resetButton.setEnabled(super.caller != ScreenType.GAME); resetButton.setEnabled(super.caller != ScreenType.GAME);
} }
@ -73,6 +81,7 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
gameActivity.getDataStorageHandler() gameActivity.getDataStorageHandler()
.writeMusicMuted(gameActivity.getSoundManager().isMusicMuted()); .writeMusicMuted(gameActivity.getSoundManager().isMusicMuted());
//TODO: write fps/performance
flipToCaller(); flipToCaller();
} }

View File

@ -73,11 +73,13 @@ public class ToolButton {
} }
public void update(float frameTime) { public void update(float frameTime) {
boolean showAnimation = true;
//TODO: showAnimationBoolean
if (progress != 100) { if (progress != 100) {
progress += (frameTime) / (toolType progress += (frameTime) / (toolType
.getCurrentUpgradeValue(ToolUpgradeType.COOLDOWN) / 100); .getCurrentUpgradeValue(ToolUpgradeType.COOLDOWN) / 100);
progress = Math.min(progress, 100); progress = Math.min(progress, 100);
if (progress == 100) if (progress == 100 && showAnimation)
animationView.startAnimation(scaleAnimation); animationView.startAnimation(scaleAnimation);
} }
progressBar.setProgress(100 - (int) progress); progressBar.setProgress(100 - (int) progress);

View File

@ -15,74 +15,113 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/backgrounds_menu_grasslands" android:background="@drawable/backgrounds_menu_grasslands"
android:paddingBottom="20dp" android:orientation="vertical"
android:orientation="vertical"> android:paddingBottom="20dp">
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_centerInParent="true" android:layout_weight="1">
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_centerInParent="true"
android:layout_marginBottom="10dp" android:orientation="vertical">
android:orientation="horizontal">
<TextView <LinearLayout
android:id="@+id/settings_music_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="20sp" android:layout_gravity="center_horizontal"
android:text="@string/settings_music"/> android:layout_marginBottom="10dp"
android:orientation="horizontal">
<ToggleButton <TextView
android:id="@+id/settings_musictoggle" android:id="@+id/settings_music_label"
android:layout_width="40dp" android:layout_width="wrap_content"
android:layout_gravity="center_vertical" android:layout_height="wrap_content"
android:layout_height="40dp" android:layout_gravity="center_vertical"
android:background="@drawable/xml_selector_music" android:layout_marginEnd="5dp"
android:textOff="" android:layout_marginRight="5dp"
android:textOn=""/> android:text="@string/settings_music"
android:textSize="20sp"/>
<ToggleButton
android:id="@+id/settings_musictoggle"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="@drawable/xml_selector_music"
android:textOff=""
android:textOn=""/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/settings_sounds_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:text="@string/settings_sounds"
android:textSize="20sp"/>
<ToggleButton
android:id="@+id/settings_soundtoggle"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="@drawable/xml_selector_sound"
android:textOff=""
android:textOn=""/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_centerInParent="true"
android:orientation="vertical">
<TextView <CheckBox
android:id="@+id/settings_sounds_label" android:id="@+id/settings_fps_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:textSize="20sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_sounds"/> android:layout_marginBottom="10dp"
android:text="Show FPS"
android:textSize="20sp"/>
<CheckBox
android:id="@+id/settings_performance_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Boost performance"
android:textSize="20sp"/>
<ToggleButton
android:id="@+id/settings_soundtoggle"
android:layout_width="40dp"
android:layout_gravity="center_vertical"
android:layout_height="40dp"
android:background="@drawable/xml_selector_sound"
android:textOff=""
android:textOn=""/>
</LinearLayout> </LinearLayout>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -8,6 +8,7 @@
android:id="@+id/shape_inspector_check_box_image" android:id="@+id/shape_inspector_check_box_image"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:background="@drawable/guis_checkbox_unchecked"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"/> android:layout_marginRight="5dp"/>