Skip to content

Commit

Permalink
Remove InputManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Reco1I committed Dec 9, 2024
1 parent 795e160 commit 8a26210
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 114 deletions.
14 changes: 1 addition & 13 deletions src/com/edlplan/ui/fragment/FilterMenuFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ import com.edlplan.ui.EasingHelper
import com.reco1l.osu.mainThread
import com.reco1l.toolkt.android.cornerRadius
import com.reco1l.toolkt.android.dp
import org.anddev.andengine.engine.handler.IUpdateHandler
import org.anddev.andengine.entity.scene.Scene
import ru.nsu.ccfit.zuev.osu.helper.InputManager
import ru.nsu.ccfit.zuev.osu.helper.StringTable
import ru.nsu.ccfit.zuev.osu.menu.IFilterMenu
import ru.nsu.ccfit.zuev.osu.menu.SongMenu
import ru.nsu.ccfit.zuev.osuplus.R
import ru.nsu.ccfit.zuev.osu.GlobalManager.getInstance as getGlobal

class FilterMenuFragment : BaseFragment(), IUpdateHandler, IFilterMenu {
class FilterMenuFragment : BaseFragment(), IFilterMenu {
private var configContext: Context? = null
private var savedFolder: String? = null
private var savedFavOnly = false
Expand Down Expand Up @@ -264,16 +262,6 @@ class FilterMenuFragment : BaseFragment(), IUpdateHandler, IFilterMenu {
updater?.update()
}

override fun onUpdate(pSecondsElapsed: Float) {
if (InputManager.getInstance().isChanged) {
filter.setText(InputManager.getInstance().text)
}
}

override fun reset() {
TODO("Not yet implemented")
}

// Due to how the fragment lifecycle works in this context, the state needs to be saved manually
private companion object {
var folder: String? = null
Expand Down
18 changes: 1 addition & 17 deletions src/ru/nsu/ccfit/zuev/osu/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
import ru.nsu.ccfit.zuev.audio.serviceAudio.SaveServiceObject;
import ru.nsu.ccfit.zuev.audio.serviceAudio.SongService;
import ru.nsu.ccfit.zuev.osu.helper.FileUtils;
import ru.nsu.ccfit.zuev.osu.helper.InputManager;
import ru.nsu.ccfit.zuev.osu.helper.StringTable;
import ru.nsu.ccfit.zuev.osu.menu.LoadingScreen;
import ru.nsu.ccfit.zuev.osu.menu.ModMenu;
Expand Down Expand Up @@ -118,7 +117,6 @@ public Engine onLoadEngine() {
//Debug.setDebugLevel(Debug.DebugLevel.NONE);
StringTable.setContext(this);
ToastLogger.init(this);
InputManager.setContext(this);
OnlineManager.getInstance().Init(getApplicationContext());
crashlytics.setUserId(Config.getOnlineDeviceID());

Expand Down Expand Up @@ -746,11 +744,7 @@ public boolean onKeyDown(final int keyCode, final KeyEvent event) {
&& GlobalManager.getInstance().getSongMenu() != null
&& GlobalManager.getInstance().getEngine().getScene() == GlobalManager.getInstance().getSongMenu().getScene()
&& GlobalManager.getInstance().getSongMenu().getScene().hasChildScene()) {
if (GlobalManager.getInstance().getSongMenu().getScene().getChildScene() ==
GlobalManager.getInstance().getSongMenu().getFilterMenu().getScene()) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
InputManager.getInstance().toggleKeyboard();
}
if (GlobalManager.getInstance().getSongMenu().getScene().getChildScene() == GlobalManager.getInstance().getSongMenu().getFilterMenu().getScene()) {
GlobalManager.getInstance().getSongMenu().getFilterMenu().hideMenu();
}

Expand Down Expand Up @@ -802,16 +796,6 @@ public boolean onKeyDown(final int keyCode, final KeyEvent event) {
return true;
}

if (InputManager.getInstance().isStarted()) {
if (keyCode == KeyEvent.KEYCODE_DEL) {
InputManager.getInstance().pop();
} else if (keyCode != KeyEvent.KEYCODE_ENTER) {
final char c = (char) event.getUnicodeChar();
if (c != 0) {
InputManager.getInstance().append(c);
}
}
}
return super.onKeyDown(keyCode, event);
}

Expand Down
84 changes: 0 additions & 84 deletions src/ru/nsu/ccfit/zuev/osu/helper/InputManager.java

This file was deleted.

0 comments on commit 8a26210

Please sign in to comment.