Skip to content

Commit

Permalink
CYF 0.6.6 LTS 2
Browse files Browse the repository at this point in the history
  • Loading branch information
RhenaudTheLukark committed Jun 19, 2022
1 parent d4bba1c commit da9064d
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 192 deletions.
7 changes: 2 additions & 5 deletions Assets/Default/Sprites/UI/Fonts/monster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@
<sprite name="W">
<rect x="22" y="62" w="8" h="12"/>
</sprite>
<sprite name="Wcopyorsomethingidk">
<rect x="24" y="112" w="9" h="12"/>
</sprite>
<sprite name="X">
<rect x="22" y="78" w="8" h="12"/>
</sprite>
Expand Down Expand Up @@ -267,10 +264,10 @@
<sprite name="unnamed_2015_45">
<rect x="111" y="62" w="7" h="11"/>
</sprite>
<sprite name="unnamed_2015_lt">
<sprite name="lt">
<rect x="73" y="32" w="8" h="7"/>
</sprite>
<sprite name="unnamed_2015_rt">
<sprite name="rt">
<rect x="83" y="32" w="8" h="7"/>
</sprite>
<sprite name="v">
Expand Down
Binary file modified Assets/Default/Sprites/UI/Fonts/uibattlesmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 31 additions & 94 deletions Assets/Default/Sprites/UI/Fonts/uibattlesmall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,140 +129,77 @@
<sprite name="space">
<rect x="210" y="22" w="11" h="15"/>
</sprite>
<sprite name="unnamed_2018_0">
<sprite name="@">
<rect x="2" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_1">
<sprite name="$">
<rect x="19" y="108" w="15" h="18"/>
</sprite>
<sprite name="unnamed_2018_11">
<rect x="186" y="108" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_12">
<rect x="200" y="108" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_15">
<rect x="2" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_16">
<rect x="16" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_2">
<sprite name="ampersand">
<rect x="36" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_21">
<rect x="86" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_23">
<rect x="114" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_26">
<rect x="156" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_28">
<rect x="184" y="88" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_3">
<sprite name="+">
<rect x="53" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_33">
<rect x="2" y="68" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_34">
<rect x="16" y="68" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_4">
<sprite name="asterisk">
<rect x="70" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_42">
<rect x="142" y="68" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_43">
<rect x="156" y="68" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_49">
<rect x="240" y="68" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_50">
<rect x="2" y="48" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_54">
<rect x="58" y="48" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_56">
<rect x="86" y="48" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_57">
<rect x="111" y="48" w="12" h="15"/>
</sprite>
<sprite name="unnamed_2018_58">
<sprite name="%">
<rect x="125" y="48" w="12" h="12"/>
</sprite>
<sprite name="unnamed_2018_62">
<rect x="181" y="48" w="12" h="15"/>
<sprite name="-">
<rect x="2" y="2" w="4" h="6"/>
</sprite>
<sprite name="unnamed_2018_64">
<rect x="209" y="48" w="12" h="15"/>
<sprite name=";">
<rect x="15" y="2" w="3" h="12"/>
</sprite>
<sprite name="unnamed_2018_65">
<rect x="223" y="48" w="12" h="15"/>
<sprite name="|">
<rect x="20" y="2" w="3" h="15"/>
</sprite>
<sprite name="unnamed_2018_66">
<rect x="237" y="48" w="12" h="15"/>
<sprite name="colon">
<rect x="25" y="2" w="3" h="12"/>
</sprite>
<sprite name="unnamed_2018_67">
<rect x="2" y="2" w="37" h="15"/>
<sprite name="quote">
<rect x="30" y="2" w="3" h="15"/>
</sprite>
<sprite name="unnamed_2018_69">
<rect x="16" y="22" w="12" h="15"/>
<sprite name="doublequote">
<rect x="30" y="2" w="8" h="15"/>
</sprite>
<sprite name="unnamed_2018_7">
<sprite name="#">
<rect x="121" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_70">
<sprite name="backslash">
<rect x="44" y="22" w="12" h="12"/>
</sprite>
<sprite name="unnamed_2018_72">
<rect x="86" y="28" w="15" h="9"/>
<sprite name="^">
<rect x="86" y="22" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_73">
<sprite name="gt">
<rect x="103" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_74">
<sprite name="]">
<rect x="114" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_75">
<sprite name="lt">
<rect x="125" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_77">
<sprite name=")">
<rect x="147" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_78">
<sprite name="[">
<rect x="158" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_79">
<sprite name="{">
<rect x="169" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_8">
<rect x="138" y="108" w="15" h="15"/>
</sprite>
<sprite name="unnamed_2018_80">
<sprite name="}">
<rect x="180" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_81">
<sprite name="(">
<rect x="191" y="22" w="9" h="15"/>
</sprite>
<sprite name="unnamed_2018_82">
<rect x="224" y="31" w="23" h="6"/>
</sprite>
<sprite name="unnamed_2018_83">
<sprite name=",">
<rect x="202" y="22" w="6" h="6"/>
</sprite>
<sprite name="unnamed_2018_9">
<rect x="155" y="108" w="15" h="15"/>
</sprite>
<sprite name="z">
<rect x="58" y="22" w="12" h="15"/>
</sprite>
</spritesheet>
</font>
54 changes: 27 additions & 27 deletions Assets/Default/Sprites/UI/Fonts/uidamagetransp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,12 @@
<sprite name="c">
<rect x="157" y="227" w="29" h="28"/>
</sprite>
<sprite name="colon">
<rect x="123" y="72" w="13" h="28"/>
</sprite>
<sprite name="d">
<rect x="219" y="136" w="29" h="28"/>
</sprite>
<sprite name="dot">
<rect x="32" y="72" w="13" h="12"/>
</sprite>
<sprite name="doublequote">
<rect x="100" y="84" w="21" h="16"/>
</sprite>
<sprite name="e">
<rect x="188" y="226" w="29" h="28"/>
</sprite>
Expand All @@ -183,7 +177,7 @@
<rect x="467" y="136" w="29" h="28"/>
</sprite>
<sprite name="l">
<rect x="17" y="72" w="13" h="28"/>
<rect x="413" y="106" w="17" h="28"/>
</sprite>
<sprite name="m">
<rect x="219" y="226" w="29" h="28"/>
Expand Down Expand Up @@ -221,56 +215,62 @@
<sprite name="u">
<rect x="2" y="196" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_13">
<sprite name="+">
<rect x="405" y="226" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_24">
<sprite name="asterisk">
<rect x="250" y="196" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_59">
<sprite name="¥">
<rect x="343" y="136" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_61">
<sprite name="%">
<rect x="405" y="136" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_62">
<sprite name="@">
<rect x="436" y="136" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_66">
<sprite name="ampersand">
<rect x="64" y="106" w="29" h="28"/>
</sprite>
<sprite name="unnamed_2017_68">
<sprite name="gt">
<rect x="126" y="106" w="21" h="28"/>
</sprite>
<sprite name="unnamed_2017_69">
<sprite name="{">
<rect x="149" y="106" w="21" h="28"/>
</sprite>
<sprite name="unnamed_2017_72">
<sprite name="}">
<rect x="218" y="106" w="21" h="28"/>
</sprite>
<sprite name="unnamed_2017_74">
<sprite name="lt">
<rect x="264" y="106" w="21" h="28"/>
</sprite>
<sprite name="unnamed_2017_76">
<sprite name="[">
<rect x="337" y="106" w="17" h="28"/>
</sprite>
<sprite name="unnamed_2017_77">
<sprite name=")">
<rect x="356" y="106" w="17" h="28"/>
</sprite>
<sprite name="unnamed_2017_78">
<sprite name="(">
<rect x="375" y="106" w="17" h="28"/>
</sprite>
<sprite name="unnamed_2017_80">
<rect x="413" y="106" w="17" h="28"/>
<sprite name="|">
<rect x="17" y="72" w="13" h="28"/>
</sprite>
<sprite name="unnamed_2017_81">
<sprite name="]">
<rect x="432" y="106" w="17" h="28"/>
</sprite>
<sprite name="unnamed_2017_82">
<rect x="451" y="118" w="25" h="16"/>
<sprite name="doublequote">
<rect x="100" y="72" w="21" h="28"/>
</sprite>
<sprite name="^">
<rect x="77" y="72" w="21" h="28"/>
</sprite>
<sprite name="colon">
<rect x="123" y="72" w="13" h="24"/>
</sprite>
<sprite name="unnamed_2017_88">
<rect x="77" y="84" w="21" h="16"/>
<sprite name="quote">
<rect x="168" y="72" w="13" h="28"/>
</sprite>
<sprite name="v">
<rect x="250" y="226" w="29" h="28"/>
Expand Down
3 changes: 2 additions & 1 deletion Assets/Plugins/MoonSharp/Interpreter/CoreLib/LoadModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Battle/EnemyEncounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CYFSprite>().ctrl._spritename = sprite;
projectile.GetComponent<CYFSprite>().ctrl.spritename = sprite;
projectile.owner = s;
projectile.gameObject.SetActive(true);
projectile.ctrl.MoveToAbs(xpos, ypos);
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Battle/UIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Device/GlobalControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Assets/Scripts/Device/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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 + "\"");
Expand Down
Loading

0 comments on commit da9064d

Please sign in to comment.