Skip to content

Commit

Permalink
2.7b release
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyWizard committed Dec 10, 2021
1 parent 1a1d12b commit a80a2f1
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 23 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LazyLib.iml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<orderEntry type="library" name="Starsector API" level="application" />
<orderEntry type="library" name="Console Commands" level="application" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="org.jetbrains:annotations:22.0.0" level="project" />
<orderEntry type="library" name="org.jetbrains:annotations:23.0.0" level="project" />
<orderEntry type="library" name="org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" level="application" />
</component>
</module>
14 changes: 4 additions & 10 deletions docstubs/org/lazywizard/lazylib/ui/LazyFont.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public DrawableString createText()
//<editor-fold desc="LazyChar" defaultstate="collapsed">

/**
* Keeps track of the metadata for each supported character in a font. This is used internally to render and wrap
* Keeps track of the metadata for each supported character in a font. This is used internally to wrap and render
* text, and it is unlikely that end users will ever need to use this class or any of its methods in their code.
* <p>
* In the rare case that these methods are needed, their names should match the bitmap font file format found <a
Expand Down Expand Up @@ -582,9 +582,7 @@ public enum TextAnchor

/**
* Represents the alignment of text within a {@link DrawableString}'s render area. Text can be left-aligned (the
* default), centered, or right-aligned. Anything other than left-aligned requires the {@link DrawableString}'s
* maximum width to be set, either through its construction in {@link #createText()} or by calling {@link
* DrawableString#setMaxWidth(float)}.
* default), centered, or right-aligned.
*
* @since 2.7
*/
Expand All @@ -595,15 +593,11 @@ public enum TextAlignment
*/
LEFT,
/**
* Text will be drawn centered within the text area. <b>Note:</b> the {@link DrawableString} <i>must</i> have
* its maximum width set (either through its construction in {@link #createText()} or by calling {@link
* DrawableString#setMaxWidth(float)}) for this to work properly.
* Text will be drawn centered within the text area.
*/
CENTER,
/**
* Text will align with the right of the text area. <b>Note:</b> the {@link DrawableString} <i>must</i> have
* its maximum width set (either through its construction in {@link #createText()} or by calling {@link
* DrawableString#setMaxWidth(float)}) for this to work properly.
* Text will align with the right of the text area.
*/
RIGHT
}
Expand Down
2 changes: 1 addition & 1 deletion ext/LazyLib-Extensions.iml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="Starsector API" level="application" />
<orderEntry type="module" module-name="LazyLib" />
<orderEntry type="library" name="org.jetbrains:annotations:22.0.0" level="project" />
<orderEntry type="library" name="org.jetbrains:annotations:23.0.0" level="project" />
</component>
</module>
9 changes: 9 additions & 0 deletions mod/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2.7b (December 10, 2021)
==========================
Updated to be compatible with Starsector 0.95.1a
Updated bundled libraries:
- jetbrains-annotations: v22.0.0 -> 23.0.0
Changes to LazyFont.DrawableString:
- Center/right-aligned text no longer requires maxWidth to be set
- setRenderDebugBounds() now shows anchor and max size

2.7 (October 22, 2021)
========================
Fixed links to online Starsector API in javadoc.zip
Expand Down
2 changes: 1 addition & 1 deletion mod/lazylib.version
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
{
"major":2,
"minor":7,
"patch":0
"patch":b
}
}
4 changes: 2 additions & 2 deletions mod/mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "LazyLib",
"author": "LazyWizard",
"utility": "true",
"version": "2.7",
"version": "2.7b",
"description": "A collection of classes to aid modding. Not a mod in itself, but required by certain other mods.",
"gameVersion": "0.95a-RC15",
"gameVersion": "0.95.1a-RC3",
"jars": ["jars/LazyLib.jar","jars/LazyLib-Kotlin.jar","jars/lib/Kotlin-Runtime.jar"],
"modPlugin": "org.lazywizard.lazylib.LazyLib"
}
8 changes: 8 additions & 0 deletions src/org/lazywizard/lazylib/combat/entities/EntityBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,12 @@ public Map<String, Object> getCustomData()
{
return null;
}

/**
* <small><i>NONFUNCTIONAL/PLACEHOLDER</i></small>
*/
@Override
public void setHitpoints(float hitpoints)
{
}
}
5 changes: 3 additions & 2 deletions src/org/lazywizard/lazylib/ui/LazyFont.kt
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ class LazyFont private constructor(
}

// Calculate alignment adjustment for the text on this line
// TODO: Update Javadoc to mention how maxWidth is handled with non-left alignment
xOffset = when (alignment) {
TextAlignment.LEFT -> 0f
TextAlignment.CENTER -> (maxWidthForOffset - calcWidth(line, fontSize)) / 2f
Expand Down Expand Up @@ -728,7 +729,7 @@ class LazyFont private constructor(
glVertex2f(0f, -height)
glEnd()

// Draw maxWidth/maxHeight
// Draw maxWidth/maxHeight if at least one has been set
if (maxWidth != Float.MAX_VALUE || maxHeight != Float.MAX_VALUE) {
val displayedMaxWidth =
if (maxWidth == Float.MAX_VALUE) width
Expand All @@ -746,7 +747,7 @@ class LazyFont private constructor(
glEnd()
}

// Draw anchor
// Draw anchor (origin of rendering)
glColor(Color.RED)
glBegin(GL_LINES)
glVertex2f(-offset.x - 3f, -offset.y - 3f)
Expand Down
2 changes: 1 addition & 1 deletion tests/LazyLib-Tests.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<orderEntry type="library" name="Console Commands" level="application" />
<orderEntry type="module" module-name="LazyLib" />
<orderEntry type="module" module-name="LazyLib-Extensions" />
<orderEntry type="library" name="org.jetbrains:annotations:22.0.0" level="project" />
<orderEntry type="library" name="org.jetbrains:annotations:23.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="junit:junit:4.13.2" level="application" />
</component>
</module>

0 comments on commit a80a2f1

Please sign in to comment.