Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
front: Added texture extraction tool, but this only works with rice
texture packs.
- Loading branch information
Showing
20 changed files
with
739 additions
and
161 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
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,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/relativeLayout1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:baselineAligned="false" | ||
android:orientation="horizontal" > | ||
|
||
<ListView | ||
android:id="@+id/listView1" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
android:layout_weight=".50" | ||
android:orientation="vertical" > | ||
</ListView> | ||
|
||
<RelativeLayout | ||
android:id="@+id/relativeLayoutRight" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
android:layout_weight=".50" | ||
android:orientation="vertical" > | ||
|
||
<LinearLayout | ||
android:id="@+id/linearLayout1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_above="@+id/linearLayoutButtons" | ||
android:orientation="vertical" | ||
android:padding="16dp" > | ||
|
||
<TextView | ||
android:id="@+id/text1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/pathHiResTexturesTask_select_zip" | ||
android:textAppearance="?android:attr/textAppearanceMedium" /> | ||
</LinearLayout> | ||
|
||
<RelativeLayout | ||
android:id="@+id/linearLayoutButtons" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
android:orientation="horizontal" | ||
android:padding="10dp" > | ||
|
||
<Button | ||
android:id="@+id/buttonCancel" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_toLeftOf="@+id/buttonOk" | ||
android:layout_toStartOf="@+id/buttonOk" | ||
android:text="@android:string/cancel" /> | ||
|
||
<Button | ||
android:id="@+id/buttonOk" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentEnd="true" | ||
android:layout_alignParentRight="true" | ||
android:text="@android:string/ok" /> | ||
</RelativeLayout> | ||
</RelativeLayout> | ||
|
||
</LinearLayout> |
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,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/relativeLayout1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" > | ||
|
||
<ListView | ||
android:id="@+id/listView1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentTop="true" | ||
android:layout_above="@+id/linearLayout1" | ||
android:orientation="vertical" > | ||
</ListView> | ||
|
||
<LinearLayout | ||
android:id="@+id/linearLayout1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_above="@+id/linearLayoutButtons" | ||
android:orientation="vertical" | ||
android:padding="16dp" > | ||
|
||
<TextView | ||
android:id="@+id/text1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/pathHiResTexturesTask_select_zip" | ||
android:textAppearance="?android:attr/textAppearanceMedium" /> | ||
</LinearLayout> | ||
<RelativeLayout | ||
android:id="@+id/linearLayoutButtons" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
android:orientation="horizontal" | ||
android:padding="10dp" > | ||
|
||
<Button | ||
android:id="@+id/buttonCancel" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_toLeftOf="@+id/buttonOk" | ||
android:layout_toStartOf="@+id/buttonOk" | ||
android:text="@android:string/cancel" /> | ||
|
||
<Button | ||
android:id="@+id/buttonOk" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentRight="true" | ||
android:layout_alignParentEnd="true" | ||
android:text="@android:string/ok" /> | ||
</RelativeLayout> | ||
|
||
</RelativeLayout> |
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
BIN
-11.7 KB
sensor_icon.odg
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package paulscode.android.mupen64plusae; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.mupen64plusae.v3.alpha.R; | ||
|
||
import paulscode.android.mupen64plusae.dialog.Prompt; | ||
import paulscode.android.mupen64plusae.util.FileUtil; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.Environment; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.widget.AdapterView; | ||
import android.widget.AdapterView.OnItemClickListener; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.Button; | ||
import android.widget.ListView; | ||
|
||
public class ExtractTexturesActivity extends AppCompatActivity implements OnItemClickListener | ||
{ | ||
private List<CharSequence> mNames; | ||
private List<String> mPaths; | ||
private Button mCancelButton; | ||
private Button mOkButton; | ||
|
||
private File mCurrentPath = null; | ||
|
||
@Override | ||
protected void onCreate( Bundle savedInstanceState ) | ||
{ | ||
super.onCreate(savedInstanceState); | ||
|
||
String currentPath = null; | ||
|
||
if(savedInstanceState != null) | ||
{ | ||
currentPath = savedInstanceState.getString( ActivityHelper.Keys.SEARCH_PATH ); | ||
} | ||
|
||
if( currentPath != null ) | ||
{ | ||
mCurrentPath = new File(currentPath); | ||
} | ||
else | ||
{ | ||
// Pick the root of the storage directory by default | ||
mCurrentPath = new File( Environment.getExternalStorageDirectory().getAbsolutePath() ); | ||
} | ||
|
||
setContentView(R.layout.extract_textures_activity); | ||
|
||
mCancelButton = (Button) findViewById( R.id.buttonCancel ); | ||
mCancelButton.setOnClickListener(new View.OnClickListener() { | ||
public void onClick(View v) { | ||
ExtractTexturesActivity.this.setResult(RESULT_CANCELED, null); | ||
ExtractTexturesActivity.this.finish(); | ||
} | ||
}); | ||
|
||
mOkButton = (Button) findViewById( R.id.buttonOk ); | ||
mOkButton.setOnClickListener(new View.OnClickListener() { | ||
public void onClick(View v) { | ||
Intent data = new Intent(); | ||
data.putExtra(ActivityHelper.Keys.SEARCH_PATH, mCurrentPath.getPath()); | ||
ExtractTexturesActivity.this.setResult(RESULT_OK, data); | ||
ExtractTexturesActivity.this.finish(); | ||
} | ||
}); | ||
|
||
PopulateFileList(); | ||
} | ||
|
||
@Override | ||
public void onSaveInstanceState( Bundle savedInstanceState ) | ||
{ | ||
if( mCurrentPath != null ) | ||
savedInstanceState.putString( ActivityHelper.Keys.SEARCH_PATH, mCurrentPath.getAbsolutePath() ); | ||
|
||
super.onSaveInstanceState( savedInstanceState ); | ||
} | ||
|
||
private void PopulateFileList() | ||
{ | ||
setTitle( mCurrentPath.getPath() ); | ||
// Populate the file list | ||
// Get the filenames and absolute paths | ||
mNames = new ArrayList<CharSequence>(); | ||
mPaths = new ArrayList<String>(); | ||
FileUtil.populate( mCurrentPath, true, true, true, mNames, mPaths ); | ||
|
||
if(mCurrentPath.isDirectory()) | ||
{ | ||
ListView listView1 = (ListView) findViewById( R.id.listView1 ); | ||
ArrayAdapter<String> adapter = Prompt.createFilenameAdapter( this, mPaths, mNames ); | ||
listView1.setAdapter( adapter ); | ||
listView1.setOnItemClickListener( this ); | ||
} | ||
} | ||
|
||
@Override | ||
public void onItemClick( AdapterView<?> parent, View view, int position, long id ) | ||
{ | ||
mCurrentPath = new File(mPaths.get( position )); | ||
PopulateFileList(); | ||
} | ||
} |
Oops, something went wrong.