Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup for Flex SDK #388

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AirContext.as
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ package
public static function createFileName(file_name:String, replace:String = ""):String
{
// Remove chars not allowed in Windows filename \ / : * ? " < > |
file_name = file_name.replace(/[~\\\/:\*\?"<>\|]/g, replace);
file_name = file_name.replace(/[~\\\/:\*\?\"<>\|]/g, replace);

// Trim leading and trailing whitespace.
file_name = file_name.replace(/^\s+|\s+$/gs, replace);
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Noteskins.as
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ package classes
file = files[i];
try
{
if (file.type != ".txt")
if (file.extension != "txt")
continue;

fileDataJSON = AirContext.readTextFile(file);
Expand Down
4 changes: 2 additions & 2 deletions src/classes/User.as
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ package classes
///- Determine what songs make up the user's Skill Rating
public function getUserSkillRatingData():void
{
for (var key:int in this.level_ranks)
for (var key:Object in this.level_ranks)
{
var levelRank:Object = this.level_ranks[key];

//Calculate the AAA Equiv for the scores on the song if greater than 0
if (levelRank.score > 0)
{
//Get the song's difficulty
var songInfo:SongInfo = _playlist.getSongInfo(key);
var songInfo:SongInfo = _playlist.getSongInfo(key as int);

if (songInfo == null || songInfo.is_unranked)
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/chart/parse/ExternalChartBase.as
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ package classes.chart.parse
return info;
}

public function getAudioData():*
public function getAudioData():ByteArray
{
return AUDIO_BYTES;
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/mp/MPSocketDataRaw.as
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ package classes.mp
return new MPSocketDataRaw(type, action, data);
}
}
catch (err)
catch (err:Error)
{
trace("parseMessage err:", err);
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/mp/MPSocketDataText.as
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ package classes.mp
}
}
}
catch (err)
catch (err:Error)
{
trace("parseMessage err:", err);
}
Expand Down
38 changes: 19 additions & 19 deletions src/classes/mp/views/MPRoomViewFFR.as
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ internal class UserPanel extends Sprite
private var view:MPRoomViewFFR;
private var room:MPRoomFFR;

private var name:Text;
private var panelName:Text;
private var iconLeaveBtn:UIIcon;

private var songName:Text;
Expand All @@ -720,8 +720,8 @@ internal class UserPanel extends Sprite
this.view = view;
this.room = room;

name = new Text(this, 20, 0, room.name, 16);
name.setAreaParams(view.width - 85, 30);
panelName = new Text(this, 20, 0, room.name, 16);
panelName.setAreaParams(view.width - 85, 30);

iconLeaveBtn = new UIIcon(this, new iconLeave(), view.width - 15, 16);
iconLeaveBtn.setSize(15, 15);
Expand Down Expand Up @@ -752,7 +752,7 @@ internal class UserPanel extends Sprite

public function update():void
{
name.text = room.name ? room.name : "";
panelName.text = room.name ? room.name : "";

if (room.songData.selected)
{
Expand Down Expand Up @@ -802,7 +802,7 @@ internal class OwnerPanel extends Sprite
private var view:MPRoomViewFFR;
private var room:MPRoomFFR;

private var name:Text;
private var panelName:Text;
private var iconEditBtn:UIIcon;
private var iconLeaveBtn:UIIcon;

Expand All @@ -821,8 +821,8 @@ internal class OwnerPanel extends Sprite
this.view = view;
this.room = room;

name = new Text(this, 20, 0, "", 16);
name.setAreaParams(view.width - 85, 30);
panelName = new Text(this, 20, 0, "", 16);
panelName.setAreaParams(view.width - 85, 30);

iconEditBtn = new UIIcon(this, new iconGear(), view.width - 45, 16);
iconEditBtn.setSize(15, 15);
Expand Down Expand Up @@ -866,7 +866,7 @@ internal class OwnerPanel extends Sprite

public function update():void
{
name.text = room.name ? room.name : "";
panelName.text = room.name ? room.name : "";

if (room.songData.selected)
{
Expand Down Expand Up @@ -930,7 +930,7 @@ internal class OwnerEditPanel extends Sprite
private var view:MPRoomViewFFR;
private var room:MPRoomFFR;

private var name:BoxText;
private var panelName:BoxText;
private var iconCancelBtn:UIIcon;
private var iconSaveBtn:UIIcon;

Expand All @@ -953,10 +953,10 @@ internal class OwnerEditPanel extends Sprite
this.view = view;
this.room = room;

name = new BoxText(this, 20, 1, 280, 28);
name.field.y += 1;
name.borderAlpha = 0;
name.borderActiveAlpha = 0;
panelName = new BoxText(this, 20, 1, 280, 28);
panelName.field.y += 1;
panelName.borderAlpha = 0;
panelName.borderActiveAlpha = 0;

iconCancelBtn = new UIIcon(this, new iconCancel(), view.width - 45, 16);
iconCancelBtn.setSize(15, 15);
Expand Down Expand Up @@ -1031,17 +1031,17 @@ internal class OwnerEditPanel extends Sprite

// Draw
this.graphics.lineStyle(1, 0xFFFFFF, 0.35);
this.graphics.moveTo(name.x, 1);
this.graphics.lineTo(name.x, name.height + 1);
this.graphics.moveTo(name.x + name.width, 1);
this.graphics.lineTo(name.x + name.width, name.height + 1);
this.graphics.moveTo(panelName.x, 1);
this.graphics.lineTo(panelName.x, panelName.height + 1);
this.graphics.moveTo(panelName.x + panelName.width, 1);
this.graphics.lineTo(panelName.x + panelName.width, panelName.height + 1);

update();
}

public function update():void
{
name.text = room.name ? room.name : "";
panelName.text = room.name ? room.name : "";
roomPassword.text = room.password ? room.password : "";
joinCode.text = room.joinCode ? room.joinCode : "";

Expand Down Expand Up @@ -1082,7 +1082,7 @@ internal class OwnerEditPanel extends Sprite
_mp.addEventListener(MPEvent.ROOM_EDIT_FAIL, e_onEditFail);

const cmd:MPCRoomEdit = new MPCRoomEdit(room);
cmd.name = name.text;
cmd.name = panelName.text;
cmd.password = roomPassword.text;

// FFA
Expand Down
Loading