removed some dumb c# coding
This commit is contained in:
@@ -39,14 +39,14 @@ public partial class console : PopupPanel
|
||||
if (Input.IsActionJustPressed("console"))
|
||||
ToggleVisible();
|
||||
}
|
||||
private void ToggleVisible()
|
||||
void ToggleVisible()
|
||||
{
|
||||
Visible = !Visible;
|
||||
player.allowMovement = !Visible;
|
||||
line.GrabFocus();
|
||||
}
|
||||
private void OnPopupHide() { if (dialog_bubble.isTalking == false) player.allowMovement = true; }
|
||||
private void OnLineEditTextSubmitted(string command)
|
||||
void OnPopupHide() { if (dialog_bubble.isTalking == false) player.allowMovement = true; }
|
||||
void OnLineEditTextSubmitted(string command)
|
||||
{
|
||||
line.Clear();
|
||||
//repeat user input to console
|
||||
@@ -80,7 +80,7 @@ public partial class console : PopupPanel
|
||||
}
|
||||
|
||||
|
||||
private void help()
|
||||
void help()
|
||||
{
|
||||
Print("==================================== Help ====================================");
|
||||
for (int i = 0; i < commandDict.Count; i++)
|
||||
@@ -89,7 +89,7 @@ public partial class console : PopupPanel
|
||||
+ Json.ParseString(commandDict.Values.ToString()).AsStringArray()[i]);
|
||||
}
|
||||
}
|
||||
private void help(string key) //Optional parameters aren't optional in Call()/Callv() so i use overloads instead
|
||||
void help(string key) //Optional parameters aren't optional in Call()/Callv() so i use overloads instead
|
||||
{
|
||||
key = key.ToLower();
|
||||
if (key.Length != 0 && commandDict.ContainsKey(key))
|
||||
@@ -103,13 +103,13 @@ public partial class console : PopupPanel
|
||||
help("help");
|
||||
};
|
||||
}
|
||||
private void consoleclear() => textblock.Clear();
|
||||
private void speed(float multiplier)
|
||||
void consoleclear() => textblock.Clear();
|
||||
void speed(float multiplier)
|
||||
{
|
||||
player.speed = Mathf.Clamp(multiplier, 0.01f, 15f);
|
||||
Print("Set player speed to " + Mathf.Clamp(multiplier, 0.01f, 15f));
|
||||
}
|
||||
private void noclip()
|
||||
void noclip()
|
||||
{
|
||||
try { Print(player.CollisionToggle()); }
|
||||
catch
|
||||
@@ -118,7 +118,7 @@ public partial class console : PopupPanel
|
||||
help("noclip");
|
||||
}
|
||||
}
|
||||
private void stickycamera()
|
||||
void stickycamera()
|
||||
{
|
||||
try { Print(player.CheatCam()); }
|
||||
catch
|
||||
@@ -127,22 +127,22 @@ public partial class console : PopupPanel
|
||||
help("stickycamera");
|
||||
}
|
||||
}
|
||||
private void playername(string name)
|
||||
void playername(string name)
|
||||
{
|
||||
player_variables.PlayerName = name;
|
||||
Print("Your new name is now: " + player_variables.PlayerName);
|
||||
}
|
||||
private void closedialogue()
|
||||
void closedialogue()
|
||||
{
|
||||
dialog_bubble.forceClose = true;
|
||||
Print("Dialogue got closed!");
|
||||
}
|
||||
private void reload()
|
||||
void reload()
|
||||
{
|
||||
GetTree().ReloadCurrentScene();
|
||||
Print("Level got reloaded!");
|
||||
}
|
||||
private void visiblecollision()
|
||||
void visiblecollision()
|
||||
{
|
||||
GetTree().DebugCollisionsHint = !GetTree().DebugCollisionsHint;
|
||||
Print("Visible collision shapes and hitmarker now set to: " + GetTree().DebugCollisionsHint + "Use 'reload' to see changes!");
|
||||
|
@@ -52,7 +52,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
Visible = true;
|
||||
isTalking = true;
|
||||
}
|
||||
public void GatherDialog(string key)
|
||||
void GatherDialog(string key)
|
||||
{
|
||||
dlgPointer = 0;
|
||||
if (parsedDlg.AsGodotDictionary()[key].VariantType == Variant.Type.Array)
|
||||
@@ -61,7 +61,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
dlgLines = dlgLines.AsGodotArray()[GD.RandRange(0, dlgLines.AsGodotArray().Count - 1)];
|
||||
//TODO:copy a clean default array and remove already used indexes and copy from clean array when its empty
|
||||
}
|
||||
public void OnVisibilityChanged()
|
||||
void OnVisibilityChanged()
|
||||
{
|
||||
if (Visible)
|
||||
ProcessMode = ProcessModeEnum.Inherit;
|
||||
@@ -82,7 +82,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
DialogControlls();
|
||||
AnswerBoxControlls();
|
||||
}
|
||||
public void DialogControlls()
|
||||
void DialogControlls()
|
||||
{
|
||||
if (Input.IsActionJustPressed("ui_cancel")) richText.VisibleCharacters = richText.Text.Length;
|
||||
|
||||
@@ -108,7 +108,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
}
|
||||
Visible = !(dlgPointer > dlgLines.AsGodotArray().Count || forceClose);
|
||||
}
|
||||
public void UpdateDialog()
|
||||
void UpdateDialog()
|
||||
{
|
||||
richText.Text = dlgLines.AsGodotArray()[dlgPointer].ToString();
|
||||
richText.VisibleCharacters = 0;
|
||||
@@ -123,7 +123,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
}
|
||||
else typewriterTimer.Stop();
|
||||
}
|
||||
public void MakeAnswerBox(string[] dialogOptions)
|
||||
void MakeAnswerBox(string[] dialogOptions)
|
||||
{
|
||||
var parent = GetNode("box/panel_container/margin_container");
|
||||
if (parent.GetChildCount() == 1) parent.GetChild(0).Free();
|
||||
@@ -138,7 +138,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
GetNode<PanelContainer>("box/panel_container").Visible = true;
|
||||
parent.GetChild<Button>(0).GrabFocus();
|
||||
}
|
||||
public void AnswerBoxControlls()
|
||||
void AnswerBoxControlls()
|
||||
{
|
||||
if (GetNode<PanelContainer>("box/panel_container").Visible == true
|
||||
&& GetNode("box/panel_container/margin_container").GetChild(0).GetChild<Button>(0).ButtonGroup.GetPressedButton() != null)
|
||||
@@ -155,7 +155,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
dlgPointer++;
|
||||
}
|
||||
}
|
||||
public void InDialogEvents(int eventID)
|
||||
void InDialogEvents(int eventID)
|
||||
{
|
||||
switch (eventID)
|
||||
{
|
||||
|
@@ -67,11 +67,7 @@ public partial class player : CharacterBody2D
|
||||
animatedSprite.SpeedScale = Math.Abs(movement.Y * speed * 1.3f);
|
||||
}
|
||||
}
|
||||
public int BeginDialogue(int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public void OnAnimationChanged()
|
||||
void OnAnimationChanged()
|
||||
{
|
||||
if (animatedSprite.Animation == "move_side")
|
||||
{
|
||||
|
Reference in New Issue
Block a user