forked from dolphin-emu/dolphin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dolphin-emu#7810 from Ebola16/GFXUI
Android: Graphic setting description improvements
- Loading branch information
Showing
7 changed files
with
229 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
...inemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package org.dolphinemu.dolphinemu.features.settings.model.view; | ||
|
||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting; | ||
import org.dolphinemu.dolphinemu.features.settings.model.Setting; | ||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; | ||
|
||
public final class SingleChoiceSettingDynamicDescriptions extends SettingsItem | ||
{ | ||
private int mDefaultValue; | ||
|
||
private int mChoicesId; | ||
private int mValuesId; | ||
private int mDescriptionChoicesId; | ||
private int mDescriptionValuesId; | ||
private MenuTag menuTag; | ||
|
||
public SingleChoiceSettingDynamicDescriptions(String key, String section, int titleId, | ||
int descriptionId, | ||
int choicesId, int valuesId, int descriptionChoicesId, int descriptionValuesId, | ||
int defaultValue, Setting setting, MenuTag menuTag) | ||
{ | ||
super(key, section, setting, titleId, descriptionId); | ||
mValuesId = valuesId; | ||
mChoicesId = choicesId; | ||
mDescriptionChoicesId = descriptionChoicesId; | ||
mDescriptionValuesId = descriptionValuesId; | ||
mDefaultValue = defaultValue; | ||
this.menuTag = menuTag; | ||
} | ||
|
||
public SingleChoiceSettingDynamicDescriptions(String key, String section, int titleId, | ||
int descriptionId, | ||
int choicesId, int valuesId, int descriptionChoicesId, int descriptionValuesId, | ||
int defaultValue, Setting setting) | ||
{ | ||
this(key, section, titleId, descriptionId, choicesId, valuesId, descriptionChoicesId, | ||
descriptionValuesId, defaultValue, setting, null); | ||
} | ||
|
||
public int getChoicesId() | ||
{ | ||
return mChoicesId; | ||
} | ||
|
||
public int getValuesId() | ||
{ | ||
return mValuesId; | ||
} | ||
|
||
public int getDescriptionChoicesId() | ||
{ | ||
return mDescriptionChoicesId; | ||
} | ||
|
||
public int getDescriptionValuesId() | ||
{ | ||
return mDescriptionValuesId; | ||
} | ||
|
||
public int getSelectedValue() | ||
{ | ||
if (getSetting() != null) | ||
{ | ||
IntSetting setting = (IntSetting) getSetting(); | ||
return setting.getValue(); | ||
} | ||
else | ||
{ | ||
return mDefaultValue; | ||
} | ||
} | ||
|
||
public MenuTag getMenuTag() | ||
{ | ||
return menuTag; | ||
} | ||
|
||
/** | ||
* Write a value to the backing int. If that int was previously null, | ||
* initializes a new one and returns it, so it can be added to the Hashmap. | ||
* | ||
* @param selection New value of the int. | ||
* @return null if overwritten successfully otherwise; a newly created IntSetting. | ||
*/ | ||
public IntSetting setSelectedValue(int selection) | ||
{ | ||
if (getSetting() == null) | ||
{ | ||
IntSetting setting = new IntSetting(getKey(), getSection(), selection); | ||
setSetting(setting); | ||
return setting; | ||
} | ||
else | ||
{ | ||
IntSetting setting = (IntSetting) getSetting(); | ||
setting.setValue(selection); | ||
return null; | ||
} | ||
} | ||
|
||
@Override | ||
public int getType() | ||
{ | ||
return TYPE_SINGLE_CHOICE_DYNAMIC_DESCRIPTIONS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters