From da9064d740551e5a4130138c09247251fecdc2c4 Mon Sep 17 00:00:00 2001
From: RhenaudTheLukark
Date: Sun, 19 Jun 2022 16:02:22 +0200
Subject: [PATCH] CYF 0.6.6 LTS 2
---
Assets/Default/Sprites/UI/Fonts/monster.xml | 7 +-
.../Sprites/UI/Fonts/uibattlesmall.png | Bin 5117 -> 20440 bytes
.../Sprites/UI/Fonts/uibattlesmall.xml | 125 +++++-------------
.../Sprites/UI/Fonts/uidamagetransp.xml | 54 ++++----
.../Interpreter/CoreLib/LoadModule.cs | 3 +-
Assets/Scripts/Battle/EnemyEncounter.cs | 2 +-
Assets/Scripts/Battle/UIController.cs | 1 +
Assets/Scripts/Device/GlobalControls.cs | 2 +-
Assets/Scripts/Device/Misc.cs | 14 +-
Assets/Scripts/Lua/CLRBindings/LuaFile.cs | 2 +-
.../Lua/CLRBindings/LuaSpriteController.cs | 9 +-
.../Scripts/Lua/CLRBindings/LuaTextManager.cs | 30 +++++
Assets/Scripts/Lua/FileLoader.cs | 3 +-
.../StaticRegistries/SpriteFontRegistry.cs | 34 +++--
Assets/Scripts/Overworld/EventManager.cs | 34 +++--
.../Util/AutoloadResourcesFromRegistry.cs | 20 ++-
Assets/Scripts/Util/SpriteUtil.cs | 2 +-
Build.py | 2 +-
.../pages/api-animation.html | 1 -
.../pages/api-functions-misc.html | 21 +--
Documentation CYF 1.0/pages/cyf-text.html | 25 ++++
21 files changed, 199 insertions(+), 192 deletions(-)
diff --git a/Assets/Default/Sprites/UI/Fonts/monster.xml b/Assets/Default/Sprites/UI/Fonts/monster.xml
index a1f3271d6..9333222c7 100644
--- a/Assets/Default/Sprites/UI/Fonts/monster.xml
+++ b/Assets/Default/Sprites/UI/Fonts/monster.xml
@@ -143,9 +143,6 @@
-
-
-
@@ -267,10 +264,10 @@
-
+
-
+
diff --git a/Assets/Default/Sprites/UI/Fonts/uibattlesmall.png b/Assets/Default/Sprites/UI/Fonts/uibattlesmall.png
index 3c6d046101f9a3e3740fbeaf3fdd2969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Sprites/UI/Fonts/uibattlesmall.xml
@@ -129,140 +129,77 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Assets/Default/Sprites/UI/Fonts/uidamagetransp.xml b/Assets/Default/Sprites/UI/Fonts/uidamagetransp.xml
index e0c59f1ed..200eeeeff 100644
--- a/Assets/Default/Sprites/UI/Fonts/uidamagetransp.xml
+++ b/Assets/Default/Sprites/UI/Fonts/uidamagetransp.xml
@@ -149,18 +149,12 @@
-
-
-
-
-
-
@@ -183,7 +177,7 @@
-
+
@@ -221,56 +215,62 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/Assets/Plugins/MoonSharp/Interpreter/CoreLib/LoadModule.cs b/Assets/Plugins/MoonSharp/Interpreter/CoreLib/LoadModule.cs
index 37e56da80..a756e6b54 100644
--- a/Assets/Plugins/MoonSharp/Interpreter/CoreLib/LoadModule.cs
+++ b/Assets/Plugins/MoonSharp/Interpreter/CoreLib/LoadModule.cs
@@ -290,8 +290,9 @@ public static bool RequireFile(ref string fileName, string pathSuffix, bool erro
try {
string modPath = pathSuffix;
ExplorePath(ref fileNameMod, ref modPath);
- if (needsToExist && !new FileInfo(fileNameMod).Exists) throw new CYFException("The file " + fileNameMod + " doesn't exist.");
+ // Keep the path to the mod folder in case of failure (used to open nonexistent files!)
fileName = fileNameMod;
+ if (needsToExist && !new FileInfo(fileNameMod).Exists) throw new CYFException("The file " + fileNameMod + " doesn't exist.");
if (needsAbsolutePath) return true;
diff --git a/Assets/Scripts/Battle/EnemyEncounter.cs b/Assets/Scripts/Battle/EnemyEncounter.cs
index 64b54e079..8af023c06 100644
--- a/Assets/Scripts/Battle/EnemyEncounter.cs
+++ b/Assets/Scripts/Battle/EnemyEncounter.cs
@@ -278,7 +278,7 @@ [HideInInspector] public DynValue CreateProjectileAbs(Script s, string sprite, f
SpriteUtil.SwapSpriteFromFile(projectile, sprite);
// TODO: Restore in 0.7
//projectile.name = sprite;
- projectile.GetComponent().ctrl._spritename = sprite;
+ projectile.GetComponent().ctrl.spritename = sprite;
projectile.owner = s;
projectile.gameObject.SetActive(true);
projectile.ctrl.MoveToAbs(xpos, ypos);
diff --git a/Assets/Scripts/Battle/UIController.cs b/Assets/Scripts/Battle/UIController.cs
index b392c784c..b4bf8a5ec 100644
--- a/Assets/Scripts/Battle/UIController.cs
+++ b/Assets/Scripts/Battle/UIController.cs
@@ -581,6 +581,7 @@ public void SwitchState(string newState, bool first = false) {
public static void SwitchStateOnString(Script scr, string state) {
if (state == null)
throw new CYFException("State: Argument cannot be nil.");
+ state = state.ToUpper();
if (instance.encounter.gameOverStance) return;
if (!instance.UIStates.Contains(state))
throw new CYFException("The state \"" + state + "\" is not a valid state. Are you sure it exists?\n\nPlease double-check in the Misc. Functions section of the docs for a list of every default valid state.");
diff --git a/Assets/Scripts/Device/GlobalControls.cs b/Assets/Scripts/Device/GlobalControls.cs
index 60b726dcd..0b32936d3 100644
--- a/Assets/Scripts/Device/GlobalControls.cs
+++ b/Assets/Scripts/Device/GlobalControls.cs
@@ -11,7 +11,7 @@
public class GlobalControls : MonoBehaviour {
public static string CYFversion = "0.6.6"; // Current version of CYF displayed in the main menu and usable in scripts
public static string OverworldVersion = "0.6.6"; // Last version in which the overworld was changed, notifying any user with an old save to delete it
- public static int LTSversion = 1; // LTS version, mainly used for CYF 0.6.6
+ public static int LTSversion = 2; // LTS version, mainly used for CYF 0.6.6
public static int frame; // Frame counter used for logging purposes
public static float overworldTimestamp = 0f; // Timestamp of the creation of the save file, mostly used to know the time spent in this save in the save and load screen
diff --git a/Assets/Scripts/Device/Misc.cs b/Assets/Scripts/Device/Misc.cs
index 7600c9839..df6cfab74 100644
--- a/Assets/Scripts/Device/Misc.cs
+++ b/Assets/Scripts/Device/Misc.cs
@@ -157,19 +157,19 @@ public LuaSpriteShader ScreenShader {
public static LuaFile OpenFile(string path, string mode = "rw") { return new LuaFile(path, mode); }
public bool FileExists(string path) {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
FileLoader.SanitizePath(ref path, "", false, true, false);
return File.Exists(path);
}
public bool DirExists(string path) {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
FileLoader.SanitizePath(ref path, "", false, true, false);
return Directory.Exists(path);
}
public bool CreateDir(string path) {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
FileLoader.SanitizePath(ref path, "", false, true, false);
if (Directory.Exists(path)) return false;
Directory.CreateDirectory(path);
@@ -179,8 +179,8 @@ public bool CreateDir(string path) {
private static bool PathValid(string path) { return path != " " && path != "" && path != "/" && path != "\\" && path != "." && path != "./" && path != ".\\"; }
public bool MoveDir(string path, string newPath) {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
- newPath = newPath.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!newPath.StartsWith(FileLoader.DataRoot)) newPath = newPath.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
if (!DirExists(path) || DirExists(newPath) || !PathValid(path)) return false;
FileLoader.SanitizePath(ref path, "", false, true, false);
@@ -190,7 +190,7 @@ public bool MoveDir(string path, string newPath) {
}
public bool RemoveDir(string path, bool force = false) {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
FileLoader.SanitizePath(ref path, "", false, true, false);
if (!Directory.Exists(path)) return false;
@@ -204,7 +204,7 @@ public string[] ListDir(string path, bool getFolders = false) {
if (path == null) throw new CYFException("Cannot list a directory with a nil path.");
string origPath = path;
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
FileLoader.SanitizePath(ref path, "", false, true, false);
if (!Directory.Exists(path))
throw new CYFException("Invalid path:\n\n\"" + origPath + "\"");
diff --git a/Assets/Scripts/Lua/CLRBindings/LuaFile.cs b/Assets/Scripts/Lua/CLRBindings/LuaFile.cs
index e4edc2af4..aa7dac514 100644
--- a/Assets/Scripts/Lua/CLRBindings/LuaFile.cs
+++ b/Assets/Scripts/Lua/CLRBindings/LuaFile.cs
@@ -9,7 +9,7 @@ public class LuaFile {
public string filePath { get; private set; }
public LuaFile(string path, string mode = "rw") {
- path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
+ if (!path.StartsWith(FileLoader.DataRoot)) path = path.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
if (path == null) throw new CYFException("Cannot open a file with a nil path.");
if (mode != "r" && mode != "w" && mode != "rw" && mode != "wr") throw new CYFException("A file's open mode can only be \"r\" (read), \"w\" (write) or \"rw\" (read + write).");
if (!FileLoader.SanitizePath(ref path, "", false, true) && mode == "r") throw new CYFException("You can't open a file that doesn't exist (" + path + ") in read-only mode.");
diff --git a/Assets/Scripts/Lua/CLRBindings/LuaSpriteController.cs b/Assets/Scripts/Lua/CLRBindings/LuaSpriteController.cs
index e366dbbee..02735a3f2 100644
--- a/Assets/Scripts/Lua/CLRBindings/LuaSpriteController.cs
+++ b/Assets/Scripts/Lua/CLRBindings/LuaSpriteController.cs
@@ -51,6 +51,7 @@ public string spritename {
// TODO: Restore in 0.7
//get { return img.GetComponent() ? img.GetComponent().sprite.name : img.GetComponent().sprite.name; }
get { return _spritename; }
+ [MoonSharpHidden] set { _spritename = value; }
}
// The x position of the sprite, relative to the arena position and its anchor.
@@ -409,7 +410,7 @@ public void Set(string name) {
}
// TODO: Restore in 0.7
//imgtemp.name = name;
- _spritename = name;
+ spritename = name;
Scale(xScale, yScale);
if (tag == "projectile")
img.GetComponent().needUpdateTex = true;
@@ -745,17 +746,17 @@ internal void UpdateAnimation() {
if (k != null) {
// TODO: Restore in 0.7
//img.name = k.name;
- _spritename = k.name;
+ spritename = k.name;
} else {
StopAnimation();
return;
}
if (k.sprite == null) return;
- Set(_spritename);
+ Set(spritename);
// TODO: Remove in 0.7
if (k == KeyframeCollection.EMPTY_KEYFRAME)
- _spritename = "blank";
+ spritename = "blank";
}
public void SetVar(string name, DynValue value) {
diff --git a/Assets/Scripts/Lua/CLRBindings/LuaTextManager.cs b/Assets/Scripts/Lua/CLRBindings/LuaTextManager.cs
index 686fa39b1..026410547 100644
--- a/Assets/Scripts/Lua/CLRBindings/LuaTextManager.cs
+++ b/Assets/Scripts/Lua/CLRBindings/LuaTextManager.cs
@@ -2,6 +2,7 @@
using UnityEngine.UI;
using System;
using System.Collections;
+using System.Collections.Generic;
using MoonSharp.Interpreter;
public class LuaTextManager : TextManager {
@@ -22,6 +23,7 @@ public class LuaTextManager : TextManager {
private float xScale = 1;
private float yScale = 1;
[MoonSharpHidden] public bool autoSetLayer = true;
+ private readonly Dictionary vars = new Dictionary();
public bool isactive {
get { return !removed && !hidden; }
@@ -225,6 +227,16 @@ public string layer {
}
}
+ public void SendToTop() {
+ CheckExists();
+ transform.SetAsLastSibling();
+ }
+
+ public void SendToBottom() {
+ CheckExists();
+ transform.SetAsFirstSibling();
+ }
+
public void MoveBelow(LuaTextManager otherText) {
CheckExists();
if (otherText == null || !otherText.isactive) throw new CYFException("The text object passed as an argument is nil or inactive.");
@@ -642,4 +654,22 @@ public int GetTextHeight() {
CheckExists();
return (int)UnitaleUtil.CalcTextHeight(this);
}
+
+ public void SetVar(string key, DynValue value) {
+ if (key == null)
+ throw new CYFException("text.SetVar: The first argument (the index) is nil.\n\nSee the documentation for proper usage.");
+ vars[key] = value;
+ }
+
+ public DynValue GetVar(string key) {
+ if (key == null)
+ throw new CYFException("text.GetVar: The first argument (the index) is nil.\n\nSee the documentation for proper usage.");
+ DynValue retval;
+ return vars.TryGetValue(key, out retval) ? retval : DynValue.NewNil();
+ }
+
+ public DynValue this[string key] {
+ get { return GetVar(key); }
+ set { SetVar(key, value); }
+ }
}
\ No newline at end of file
diff --git a/Assets/Scripts/Lua/FileLoader.cs b/Assets/Scripts/Lua/FileLoader.cs
index d96b7a002..e194c4c72 100644
--- a/Assets/Scripts/Lua/FileLoader.cs
+++ b/Assets/Scripts/Lua/FileLoader.cs
@@ -169,8 +169,7 @@ public static bool SanitizePath(ref string fileName, string pathSuffix, bool err
if (!LoadModule.RequireFile(ref fileName, pathSuffix, !leadingSlash && errorOnFailure, needsAbsolutePath, needsToExist))
if (leadingSlash) {
// Passthrough: Remove the leading slash if the file wasn't found
- // TODO: Remove this on 0.7
- fileName = fileName.TrimStart(Path.DirectorySeparatorChar);
+ if (!fileName.StartsWith(DataRoot)) fileName = fileName.Replace('\\', '/').TrimStart('/'); // TODO: Remove this for 0.7
if (!LoadModule.RequireFile(ref fileName, pathSuffix, errorOnFailure, needsAbsolutePath, needsToExist))
return false;
} else
diff --git a/Assets/Scripts/Lua/StaticRegistries/SpriteFontRegistry.cs b/Assets/Scripts/Lua/StaticRegistries/SpriteFontRegistry.cs
index a64ddd35d..498f13bd4 100644
--- a/Assets/Scripts/Lua/StaticRegistries/SpriteFontRegistry.cs
+++ b/Assets/Scripts/Lua/StaticRegistries/SpriteFontRegistry.cs
@@ -115,27 +115,35 @@ private static UnderFont GetUnderFont(string fontName) {
return underfont;
}
+ private static void AddLetter(Dictionary letters, char letter, Sprite s, string fontPath) {
+ if (letters.ContainsKey(letter)) {
+ UnitaleUtil.DisplayLuaError("", "Error while loading the font " + fontPath + "\n\nThe letter \" " + letter + " \" has been added several times to the font!", true);
+ return;
+ }
+ letters.Add(letter, s);
+ }
+
private static Dictionary LoadBuiltInFont(XmlNode sheetNode, string fontPath) {
Sprite[] letterSprites = SpriteUtil.AtlasFromXml(sheetNode, SpriteUtil.FromFile(fontPath, "Sprites/UI/Fonts/"));
Dictionary letters = new Dictionary();
foreach (Sprite s in letterSprites) {
string name = s.name;
if (name.Length == 1)
- letters.Add(name[0], s);
+ AddLetter(letters, name[0], s, fontPath);
else
switch (name) {
- case "slash": letters.Add('/', s); break;
- case "dot": letters.Add('.', s); break;
- case "pipe": letters.Add('|', s); break;
- case "backslash": letters.Add('\\', s); break;
- case "colon": letters.Add(':', s); break;
- case "questionmark": letters.Add('?', s); break;
- case "doublequote": letters.Add('"', s); break;
- case "asterisk": letters.Add('*', s); break;
- case "space": letters.Add(' ', s); break;
- case "lt": letters.Add('<', s); break;
- case "rt": letters.Add('>', s); break;
- case "ampersand": letters.Add('&', s); break;
+ case "slash": AddLetter(letters, '/', s, fontPath); break;
+ case "dot": AddLetter(letters, '.', s, fontPath); break;
+ case "pipe": AddLetter(letters, '|', s, fontPath); break;
+ case "backslash": AddLetter(letters, '\\', s, fontPath); break;
+ case "colon": AddLetter(letters, ':', s, fontPath); break;
+ case "questionmark": AddLetter(letters, '?', s, fontPath); break;
+ case "doublequote": AddLetter(letters, '"', s, fontPath); break;
+ case "asterisk": AddLetter(letters, '*', s, fontPath); break;
+ case "space": AddLetter(letters, ' ', s, fontPath); break;
+ case "lt": AddLetter(letters, '<', s, fontPath); break;
+ case "rt": AddLetter(letters, '>', s, fontPath); break;
+ case "ampersand": AddLetter(letters, '&', s, fontPath); break;
}
}
return letters;
diff --git a/Assets/Scripts/Overworld/EventManager.cs b/Assets/Scripts/Overworld/EventManager.cs
index 64f04e97b..ec1067ae3 100644
--- a/Assets/Scripts/Overworld/EventManager.cs
+++ b/Assets/Scripts/Overworld/EventManager.cs
@@ -375,15 +375,15 @@ public int GetTrigger(GameObject go, int index) {
///
/// Resets the events by counting them all again, stopping the current events and destroying all the current images.
///
- /// SEt to true if you want all scripts to be reloaded as well.
+ /// Set to true if you want all scripts to be reloaded as well.
public void ResetEvents(bool resetScripts = true) {
coroutines.Clear();
initializedEvents.Clear();
events.Clear();
autoDone.Clear();
- spriteControllers.Clear();
// Reset all loaded scripts in order to reload them later
if (resetScripts) {
+ spriteControllers.Clear();
eventScripts.Clear();
ScriptWrapper.instances.Clear();
}
@@ -784,9 +784,11 @@ public void SetEventStates(bool addPlayer = false) {
CurrPage = ev.actualPage,
CurrSpriteNameOrCYFAnim = ev.GetComponent()
? ev.GetComponent().specialHeader
- : instance.spriteControllers[ev.name].img.GetComponent()
- ? instance.spriteControllers[ev.name].img.GetComponent().sprite.name
- : instance.spriteControllers[ev.name].img.GetComponent().sprite.name,
+ : spriteControllers[ev.name].spritename != "empty"
+ ? spriteControllers[ev.name].spritename
+ : instance.spriteControllers[ev.name].img.GetComponent()
+ ? instance.spriteControllers[ev.name].img.GetComponent().sprite.name
+ : instance.spriteControllers[ev.name].img.GetComponent().sprite.name,
NoCollision = ev.gameObject.layer == 0,
Anchor = UnitaleUtil.VectorToVect(ev.GetComponent().anchorMax),
Pivot = UnitaleUtil.VectorToVect(ev.GetComponent().pivot)
@@ -1019,13 +1021,21 @@ public static void GetMapState(MapInfos mi, string id) {
ev.actualPage = ei.CurrPage;
ev.gameObject.layer = ei.NoCollision ? 0 : 21;
- // Sets data to the event's animator if it exists
- if (ev.GetComponent()) ev.GetComponent().specialHeader = ei.CurrSpriteNameOrCYFAnim;
- // Sets the event's sprite using auto-load if it exists
- else if (ev.GetComponent()) ev.GetComponent().SpritePath = ei.CurrSpriteNameOrCYFAnim;
- // Sets the event's sprite directly otherwise
- else if (ev.GetComponent()) ev.GetComponent().sprite = SpriteRegistry.Get(ei.CurrSpriteNameOrCYFAnim);
- else ev.GetComponent().sprite = SpriteRegistry.Get(ei.CurrSpriteNameOrCYFAnim);
+ try {
+ // Sets data to the event's animator if it exists
+ if (ev.GetComponent())
+ ev.GetComponent().specialHeader = ei.CurrSpriteNameOrCYFAnim;
+ // Sets the event's sprite using auto-load if it exists
+ else if (ev.GetComponent())
+ ev.GetComponent().SpritePath = ei.CurrSpriteNameOrCYFAnim;
+ // Sets the event's sprite directly otherwise
+ else if (ev.GetComponent())
+ ev.GetComponent().sprite = SpriteRegistry.Get(ei.CurrSpriteNameOrCYFAnim);
+ else ev.GetComponent().sprite = SpriteRegistry.Get(ei.CurrSpriteNameOrCYFAnim);
+ } catch {
+ Debug.LogWarning("Map loading: Couldn't load sprite " + ei.CurrSpriteNameOrCYFAnim + " for object " + ev.name);
+ // ignored
+ }
}
go.GetComponent().anchorMax = UnitaleUtil.VectToVector(ei.Anchor);
go.GetComponent().anchorMin = UnitaleUtil.VectToVector(ei.Anchor);
diff --git a/Assets/Scripts/Util/AutoloadResourcesFromRegistry.cs b/Assets/Scripts/Util/AutoloadResourcesFromRegistry.cs
index 3d46a2a72..e3052033f 100644
--- a/Assets/Scripts/Util/AutoloadResourcesFromRegistry.cs
+++ b/Assets/Scripts/Util/AutoloadResourcesFromRegistry.cs
@@ -1,5 +1,4 @@
-using System.Linq;
-using UnityEngine;
+using UnityEngine;
using UnityEngine.UI;
///
@@ -31,8 +30,15 @@ private void OnDisable() {
private void LateStart() {
if (!StaticInits.Initialized) return;
loadRequested = true;
- if (!string.IsNullOrEmpty(SpritePath) && !(!GlobalControls.isInFight && StaticInits.MODFOLDER != FindObjectOfType().modToLoad)) {
- Sprite spr = SpriteRegistry.Get(SpritePath);
+ if (string.IsNullOrEmpty(SpritePath))
+ Destroy(this);
+ else if (GlobalControls.isInFight || StaticInits.MODFOLDER == FindObjectOfType().modToLoad) {
+ Sprite spr = null;
+ try { spr = SpriteRegistry.Get(SpritePath); }
+ catch (MoonSharp.Interpreter.ScriptRuntimeException ex) {
+ UnitaleUtil.DisplayLuaError("Autoloading a resource - " + SpritePath, ex.DecoratedMessage != null ? UnitaleUtil.FormatErrorSource(ex.DecoratedMessage, ex.Message) + ex.Message : ex.Message);
+ }
+
if (spr == null) {
// Needs to wait for mod loading
if (tries < 10) tries++;
@@ -48,10 +54,10 @@ private void LateStart() {
} else if (img3 != null)
img3.material.mainTexture = spr.texture;
else
- throw new CYFException("The GameObject " + gameObject.name + " doesn't have an Image, Sprite Renderer or Particle System component.");
- }
+ throw new CYFException("The GameObject " + name + " doesn't have an Image, Sprite Renderer or Particle System component.");
- Destroy(this);
+ Destroy(this);
+ }
}
public void Update() {
diff --git a/Assets/Scripts/Util/SpriteUtil.cs b/Assets/Scripts/Util/SpriteUtil.cs
index 3b6effbf7..926287e5c 100644
--- a/Assets/Scripts/Util/SpriteUtil.cs
+++ b/Assets/Scripts/Util/SpriteUtil.cs
@@ -121,7 +121,7 @@ public static DynValue MakeIngameSprite(string filename, string tag = "BelowAren
sprCtrl = LuaSpriteController.GetOrCreate(i.gameObject);
// TODO: Restore in 0.7
//if (!UnitaleUtil.IsOverworld) i.name = filename;
- if (!UnitaleUtil.IsOverworld) sprCtrl._spritename = filename;
+ sprCtrl.spritename = filename;
} else
throw new CYFException("You can't create a sprite object with a nil sprite!");
if (!GameObject.Find(tag + "Layer") && tag != "none")
diff --git a/Build.py b/Build.py
index f8b406100..ea99c2b5e 100644
--- a/Build.py
+++ b/Build.py
@@ -22,7 +22,7 @@
### Script Vars ###
# This is the version of CYF to name the executables and the Documentation folder
-CYFversion = "0.6.6"
+CYFversion = "0.6.6 LTS 2"
# This is the path we will build to
buildPath = os.getcwd() + "\\bin"
diff --git a/Documentation CYF 1.0/pages/api-animation.html b/Documentation CYF 1.0/pages/api-animation.html
index dcf8df687..013b12486 100644
--- a/Documentation CYF 1.0/pages/api-animation.html
+++ b/Documentation CYF 1.0/pages/api-animation.html
@@ -63,7 +63,6 @@
Projectile management
The Pixel-Perfect Collision System
> Sprites & Animation <
- The Text Object
Introduction
diff --git a/Documentation CYF 1.0/pages/api-functions-misc.html b/Documentation CYF 1.0/pages/api-functions-misc.html
index ec6593460..eb52168c8 100644
--- a/Documentation CYF 1.0/pages/api-functions-misc.html
+++ b/Documentation CYF 1.0/pages/api-functions-misc.html
@@ -199,8 +199,7 @@
File Functions
Misc.FileExists( path)
- Use this function to check if a file in your Mod folder ONLY exists.
- Using ../ to go up a folder is NOT allowed.
+ Use this function to check if a file exists.
- path: Path to the file to open, relative to your Mod folder.
@@ -209,8 +208,7 @@ File Functions
Use this before Misc.OpenFile if you plan to read from a file.
Misc.ListDir( path, getFolders = false)
- This function returns a list of either files or folders in your Mod folder ONLY.
- Using ../ to go up a folder is NOT allowed.
+ This function returns a list of either files or folders.
- path: Path to the file to open, relative to your Mod folder.
@@ -220,29 +218,25 @@ File Functions
Misc.DirExists( path)
- Use this function to check if a folder in your Mod folder ONLY exists.
- Using ../ to go up a folder is NOT allowed.
+ Use this function to check if a folder exists.
- path: Path to the file to open, relative to your Mod folder.
Can enter subfolders such as Lua.
Misc.CreateDir( path)
- Attempts to create a folder with the path path relative to your Mod folder.
- Using ../ to go up a folder is NOT allowed.
+ Attempts to create a folder with the path path relative to your Mod folder.
Returns true if the operation was successful, false otherwise.
Misc.MoveDir( path, newPath)
Attempts to move a folder with the path path relative to your Mod folder to a new location newPath
- also relative to your mod folder.
- Using ../ to go up a folder is NOT allowed.
+ also relative to your mod folder.
Returns true if the operation was successful, false otherwise.
Misc.RemoveDir( path, force = false)
- Attempts to delete a folder with the path path relative to your Mod folder.
- Using ../ to go up a folder is NOT allowed.
+ Attempts to delete a folder with the path path relative to your Mod folder.
- force: If true, this function will forcefully remove a folder. Otherwise, a folder will only be removed if it is empty.
@@ -250,8 +244,7 @@ File Functions
Returns true if the operation was successful, false otherwise.
Misc.OpenFile( path, mode = "rw") returns File
- This function opens a file in your Mod folder ONLY, for reading and writing.
- Using ../ to go up a folder is NOT allowed.
+ This function opens a file in CYF's Mods folder ONLY for writing and anywhere for reading.
- path: Path to the file to open, relative to your Mod folder.
diff --git a/Documentation CYF 1.0/pages/cyf-text.html b/Documentation CYF 1.0/pages/cyf-text.html
index 29a273b30..2bde3b3d8 100644
--- a/Documentation CYF 1.0/pages/cyf-text.html
+++ b/Documentation CYF 1.0/pages/cyf-text.html
@@ -346,6 +346,17 @@ Letter sprite objects can not have their layer changed, can not run Text.MoveAbove(text otherTextObject)
Moves a text object above another text object.
They must both be on the same layer.
+
+
Text.SendToTop()
+ Sends this text object to the top of its layer's hierarchy. If a sprite has 5
+ children, for instance, you can use this to rearrange this text object's position internally.
+ However, child text objects will always appear on top of their parents, regardless of this
+ function being called.
+
+
+
Text.SendToBottom()
+ Sends this text objct to the bottom of its layer's hierarchy. Similar rules apply as with SendToTop().
+
Text.AddText( text (OR) text)
Adds the given text to the object's text table. Acts like Text.SetText() if all the text is already done.
@@ -445,6 +456,20 @@
Letter sprite objects can not have their layer changed, can not run
Note: This function is not 100% accurate.
+
+
+ Text.SetVar( yourVariableName, value)
+
or Text[ yourVariableName]
+ Sets a variable in a text object that you can retrieve with Text.GetVar.
+ Identical to SetVar in projectiles.
+
+
+
+ Text.GetVar( yourVariableName)
+
or Text[ yourVariableName] = value
+ Gets a variable in a text object that you previously set with Text.SetVar.
+ Identical to GetVar in projectiles.
+