<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.game.runner.scene;

import org.andengine.entity.scene.background.Background;
import org.andengine.entity.text.Text;
import org.andengine.util.adt.color.Color;
import org.game.runner.GameActivity;
import org.game.runner.base.BaseScene;
import org.game.runner.manager.SceneManager.SceneType;

/**
 *
 * @author Karl
 */
public class LoadingScene extends BaseScene{
    public static abstract class LoadingListener{
        public abstract void onPause();
        public abstract void onResume();
    }
    
    private Text title;
    private LoadingListener listener;
    
    @Override
    public void createScene() {
        this.setBackground(new Background(Color.BLACK));
        this.title = new Text(GameActivity.CAMERA_WIDTH/2, GameActivity.CAMERA_HEIGHT/2, resourcesManager.fontPixel_60, "LOADING...", vbom);
        attachChild(this.title);
    }
    
    public void setLoadingListener(LoadingListener listener){
        this.listener = listener;
        
    }
    public void removeLoadingListener(){
        this.listener = null;
    }

    @Override
    public void onBackKeyPressed() {
    }

    @Override
    public SceneType getSceneType() {
        return SceneType.SCENE_LOADING;
    }

    @Override
    public void onPause() {
        if(this.listener != null){
            this.listener.onPause();
        }
    }

    @Override
    public void onResume() {
        if(this.listener != null){
            this.listener.onResume();
        }
    }

    @Override
    public void disposeScene() {
        this.title.detachSelf();
        this.title.dispose();
        this.detachSelf();
        this.dispose();
    }
}<commit_msg>Fix audio playback on pause during loading<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.game.runner.scene;

import org.andengine.entity.scene.background.Background;
import org.andengine.entity.text.Text;
import org.andengine.util.adt.color.Color;
import org.game.runner.GameActivity;
import org.game.runner.base.BaseScene;
import org.game.runner.manager.SceneManager.SceneType;

/**
 *
 * @author Karl
 */
public class LoadingScene extends BaseScene{
    public static abstract class LoadingListener{
        public abstract void onPause();
        public abstract void onResume();
    }
    
    private Text title;
    private LoadingListener listener;
    
    @Override
    public void createScene() {
        this.setBackground(new Background(Color.BLACK));
        this.title = new Text(GameActivity.CAMERA_WIDTH/2, GameActivity.CAMERA_HEIGHT/2, resourcesManager.fontPixel_60, "LOADING...", vbom);
        attachChild(this.title);
    }
    
    public void setLoadingListener(LoadingListener listener){
        this.listener = listener;
        
    }
    public void removeLoadingListener(){
        this.listener = null;
    }

    @Override
    public void onBackKeyPressed() {
    }

    @Override
    public SceneType getSceneType() {
        return SceneType.SCENE_LOADING;
    }

    @Override
    public void onPause() {
        if(this.listener != null){
            this.listener.onPause();
            this.audioManager.pause();
        }
    }

    @Override
    public void onResume() {
        if(this.listener != null){
            this.listener.onResume();
            this.audioManager.resume();
        }
    }

    @Override
    public void disposeScene() {
        this.title.detachSelf();
        this.title.dispose();
        this.detachSelf();
        this.dispose();
    }
}
{'fraction_non_alphanumeric': 0.10431458219552157, 'fraction_numerical': 0.002184598580010923, 'mean_word_length': 2.5597667638483963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2548098', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1036, 'n_words': 232}