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

Small screen position feature #373

Merged
merged 31 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a6514dd
error checking for layout value from older config
DavidRGriswold Aug 18, 2024
81619e7
rename enum and update aspect ratio code
DavidRGriswold Aug 17, 2024
beace3e
rewrite LargeFrameLayout to support multiple positions
DavidRGriswold Aug 18, 2024
957f964
add settings for smallscreenposition, fix minsize function
DavidRGriswold Aug 19, 2024
a09259f
fixed framebuffer from res scale (screenshots)
DavidRGriswold Aug 19, 2024
335c4f3
add desktop UI for small screen position
DavidRGriswold Aug 19, 2024
06f581c
small screen position submenu on desktop
DavidRGriswold Aug 20, 2024
3e1fada
fix int-float conversion warning
DavidRGriswold Aug 22, 2024
5d9a6ec
rename Above and Below to hopefully fix linux issue
DavidRGriswold Aug 29, 2024
2875887
Add Small Screen Position Setting to android settings menu
DavidRGriswold Aug 29, 2024
63ec3b6
fix sliders to work with floats, mostly
DavidRGriswold Aug 29, 2024
3ffab38
fix android slider textinput ui
DavidRGriswold Aug 30, 2024
996e195
change None enums in settings and cam_params
DavidRGriswold Sep 2, 2024
3a9dc03
Apply clang-format-18
rtiangha Sep 17, 2024
2f9ce9f
SettingsAdapter.kt: Make more null pointer exception resistant
rtiangha Sep 17, 2024
bd0c697
Updated license headers
OpenSauce04 Oct 3, 2024
eb5591d
Code formatting nitpicks
OpenSauce04 Oct 3, 2024
64a0d5a
fix bug in main.ui that was hiding menu
DavidRGriswold Oct 11, 2024
703d76c
replace default layout with a special call to LargeFrame (like SideBy…
DavidRGriswold Oct 11, 2024
a8f0d3b
fix bug when "large screen" is actually narrower
DavidRGriswold Oct 11, 2024
2f98dc4
edit documentation for LargeScreenLayout
DavidRGriswold Oct 11, 2024
9dea3c2
update PortraitTopFullFrameLayout to use LargeFrameLayout
DavidRGriswold Oct 12, 2024
14df25b
fix unary minus on unsigned int bug
DavidRGriswold Oct 12, 2024
99db0d7
Applied formatting correction
OpenSauce04 Oct 14, 2024
85dff4a
Added `const`s where appropriate
OpenSauce04 Oct 14, 2024
29c7fc5
android: Add mention of the bottom-right small screen position being …
OpenSauce04 Oct 14, 2024
d0d6354
review fixes + more constants
DavidRGriswold Oct 15, 2024
3c5cd94
refactor all Upright calculations to a reverseLayout method, simplify…
DavidRGriswold Oct 15, 2024
0c98807
Removed stray extra newline
OpenSauce04 Oct 29, 2024
9ee27d8
SettingsAdapter.kt: Fixed some strange indentation
OpenSauce04 Oct 29, 2024
41099f0
Removed unnecessary `if` in favour of direct value usage
OpenSauce04 Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,31 @@ enum class ScreenLayout(val int: Int) {
}
}

enum class SmallScreenPosition(val int: Int) {
TOP_RIGHT(0),
MIDDLE_RIGHT(1),
BOTTOM_RIGHT(2),
TOP_LEFT(3),
MIDDLE_LEFT(4),
BOTTOM_LEFT(5),
ABOVE(6),
BELOW(7);

companion object {
fun from(int: Int): SmallScreenPosition {
return entries.firstOrNull { it.int == int } ?: TOP_RIGHT
}
}
}

enum class PortraitScreenLayout(val int: Int) {
// These must match what is defined in src/common/settings.h
TOP_FULL_WIDTH(0),
CUSTOM_PORTRAIT_LAYOUT(1);

companion object {
fun from(int: Int): PortraitScreenLayout {
return entries.firstOrNull { it.int == int } ?: TOP_FULL_WIDTH;
return entries.firstOrNull { it.int == int } ?: TOP_FULL_WIDTH
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Lime3DS Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand All @@ -9,7 +9,7 @@ enum class FloatSetting(
override val section: String,
override val defaultValue: Float
) : AbstractFloatSetting {
// There are no float settings currently
LARGE_SCREEN_PROPORTION("large_screen_proportion",Settings.SECTION_LAYOUT,2.25f),
EMPTY_SETTING("", "", 0.0f);

override var float: Float = defaultValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum class IntSetting(
CARDBOARD_X_SHIFT("cardboard_x_shift", Settings.SECTION_LAYOUT, 0),
CARDBOARD_Y_SHIFT("cardboard_y_shift", Settings.SECTION_LAYOUT, 0),
SCREEN_LAYOUT("layout_option", Settings.SECTION_LAYOUT, 0),
SMALL_SCREEN_POSITION("small_screen_position",Settings.SECTION_LAYOUT,0),
LANDSCAPE_TOP_X("custom_top_x",Settings.SECTION_LAYOUT,0),
LANDSCAPE_TOP_Y("custom_top_y",Settings.SECTION_LAYOUT,0),
LANDSCAPE_TOP_WIDTH("custom_top_width",Settings.SECTION_LAYOUT,800),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Lime3DS Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand Down Expand Up @@ -39,5 +39,6 @@ abstract class SettingsItem(
const val TYPE_RUNNABLE = 7
const val TYPE_INPUT_BINDING = 8
const val TYPE_STRING_INPUT = 9
const val TYPE_FLOAT_INPUT = 10
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Lime3DS Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand All @@ -23,17 +23,16 @@ class SliderSetting(
val defaultValue: Float? = null
) : SettingsItem(setting, titleId, descriptionId) {
override val type = TYPE_SLIDER

val selectedValue: Int
val selectedFloat: Float
get() {
val setting = setting ?: return defaultValue!!.toInt()
val setting = setting ?: return defaultValue!!.toFloat()
return when (setting) {
is AbstractIntSetting -> setting.int
is FloatSetting -> setting.float.roundToInt()
is ScaledFloatSetting -> setting.float.roundToInt()
is AbstractIntSetting -> setting.int.toFloat()
is FloatSetting -> setting.float
is ScaledFloatSetting -> setting.float
else -> {
Log.error("[SliderSetting] Error casting setting type.")
-1
-1f
}
}
}
Expand Down
Loading
Loading