mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-10 23:29:43 +00:00
Enable setting to show/hide disk read/write HUD messages
This commit is contained in:
parent
cdb0f7b06b
commit
22914de79c
@ -289,6 +289,18 @@ public enum Apple2Preferences {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getInt(toString(), 5);
|
||||
}
|
||||
},
|
||||
SHOW_DISK_OPERATIONS {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
boolean enabled = booleanValue(activity);
|
||||
nativeSetShowDiskOperationAnimation(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean booleanValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), true);
|
||||
}
|
||||
},
|
||||
JOYSTICK_AXIS_SENSITIVIY {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
@ -1057,6 +1069,8 @@ public enum Apple2Preferences {
|
||||
|
||||
private static native void nativeSetTouchMenuVisibility(float alpha);
|
||||
|
||||
public static native void nativeSetShowDiskOperationAnimation(boolean enabled);
|
||||
|
||||
private static native void nativeSetTouchKeyboardVisibility(float inactiveAlpha, float activeAlpha);
|
||||
|
||||
private static native void nativeSetTouchKeyboardLowercaseEnabled(boolean enabled);
|
||||
|
@ -249,6 +249,30 @@ public class Apple2SettingsMenu extends Apple2AbstractMenu {
|
||||
});
|
||||
}
|
||||
},
|
||||
SHOW_DISK_OPERATIONS {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.disk_show_operation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getSummary(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.disk_show_operation_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
convertView = _basicView(activity, this, convertView);
|
||||
CheckBox cb = _addCheckbox(activity, this, convertView, Apple2Preferences.SHOW_DISK_OPERATIONS.booleanValue(activity));
|
||||
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
Apple2Preferences.SHOW_DISK_OPERATIONS.saveBoolean(activity, isChecked);
|
||||
}
|
||||
});
|
||||
return convertView;
|
||||
}
|
||||
},
|
||||
ABOUT {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
|
@ -36,6 +36,8 @@
|
||||
<string name="disk_insert_could_not_read">Désolé, impossible de lire l\'image disque!</string>
|
||||
<string name="disk_read_only">Lecture seulement</string>
|
||||
<string name="disk_read_write">Lecture/Ecriture</string>
|
||||
<string name="disk_show_operation">Afficher les opérations (disque) ][</string>
|
||||
<string name="disk_show_operation_summary">Indique lorsque le disque de lecture ou d\'écriture</string>
|
||||
<string name="emulation_continue">Continuer…</string>
|
||||
<string name="emulation_settings">Configurations…</string>
|
||||
<string name="emulation_disks">Chargement de l\'image disque…</string>
|
||||
|
@ -32,10 +32,12 @@
|
||||
<string name="diskA">Drive 1</string>
|
||||
<string name="diskB">Drive 2</string>
|
||||
<string name="disk_eject">Eject</string>
|
||||
<string name="disk_insert_toast">Inserted disk in drive 1 read-only</string>
|
||||
<string name="disk_insert_toast">Inserted disk in drive read-only</string>
|
||||
<string name="disk_insert_could_not_read">Sorry, could not read the disk image!</string>
|
||||
<string name="disk_read_only">Read only</string>
|
||||
<string name="disk_read_write">Read/write</string>
|
||||
<string name="disk_show_operation">Show Disk ][ operations</string>
|
||||
<string name="disk_show_operation_summary">Shows when disk drives are reading or writing</string>
|
||||
<string name="emulation_continue">Continue…</string>
|
||||
<string name="emulation_settings">Settings…</string>
|
||||
<string name="emulation_disks">Load disk image…</string>
|
||||
|
@ -130,6 +130,13 @@ void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetTouchMenuEnabled(JNIE
|
||||
interface_setTouchMenuEnabled(enabled);
|
||||
}
|
||||
|
||||
void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetShowDiskOperationAnimation(JNIEnv *env, jclass cls, jboolean enabled) {
|
||||
LOG("enabled : %d", enabled);
|
||||
if (video_backend && video_backend->animation_setEnableShowTrackSector) {
|
||||
video_backend->animation_setEnableShowTrackSector(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetTouchKeyboardLowercaseEnabled(JNIEnv *env, jclass cls, jboolean enabled) {
|
||||
LOG("enabled : %d", enabled);
|
||||
keydriver_setLowercaseEnabled(enabled);
|
||||
|
@ -348,6 +348,14 @@ static void _animation_showTrackSector(int drive, int track, int sect) {
|
||||
_animation_showMessage(template, DISK_TRACK_SECTOR_COLS, DISK_TRACK_SECTOR_ROWS);
|
||||
}
|
||||
|
||||
static void _animation_setEnableShowTrackSector(bool enabled) {
|
||||
if (enabled) {
|
||||
video_backend->animation_showTrackSector = &_animation_showTrackSector;
|
||||
} else {
|
||||
video_backend->animation_showTrackSector = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((constructor(CTOR_PRIORITY_LATE)))
|
||||
static void _init_glalert(void) {
|
||||
LOG("Initializing message animation subsystem");
|
||||
@ -357,6 +365,7 @@ static void _init_glalert(void) {
|
||||
video_backend->animation_showCPUSpeed = &_animation_showCPUSpeed;
|
||||
video_backend->animation_showDiskChosen = &_animation_showDiskChosen;
|
||||
video_backend->animation_showTrackSector = &_animation_showTrackSector;
|
||||
video_backend->animation_setEnableShowTrackSector = &_animation_setEnableShowTrackSector;
|
||||
|
||||
glnode_registerNode(RENDER_MIDDLE, (GLNode){
|
||||
.setup = &alert_init,
|
||||
|
@ -39,6 +39,7 @@ typedef struct video_backend_s {
|
||||
void (*animation_showCPUSpeed)(void);
|
||||
void (*animation_showDiskChosen)(int drive);
|
||||
void (*animation_showTrackSector)(int drive, int track, int sect);
|
||||
void (*animation_setEnableShowTrackSector)(bool enabled);
|
||||
|
||||
} video_backend_s;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user