Merge pull request #1346 from MellowArpeggiation/master

Improve SSG animations
This commit is contained in:
HbmMods 2024-02-20 08:34:06 +01:00 committed by GitHub
commit 17adce20bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 6 deletions

View File

@ -26,6 +26,7 @@ public class CommonConfig {
public static final String CATEGORY_STRUCTURES = "15_structures";
public static final String CATEGORY_POLLUTION = "16_pollution";
public static final String CATEGORY_BIOMES = "17_biomes";
public static final String CATEGORY_WEAPONS = "18_weapons";
public static final String CATEGORY_528 = "528";
public static final String CATEGORY_LBSM = "LESS BULLSHIT MODE";

View File

@ -15,6 +15,8 @@ public class WeaponConfig {
public static boolean dropStar = true;
public static boolean dropCrys = true;
public static boolean dropDead = true;
public static boolean linearAnimations = false;
public static void loadFromConfig(Configuration config) {
@ -38,5 +40,9 @@ public class WeaponConfig {
dropStar = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", "Whether rigged star blaster cells should explode when dropped", true);
dropCrys = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.04_dropCrys", "Whether xen crystals should move blocks when dropped", true);
dropDead = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.05_dropDead", "Whether dead man's explosives should explode when dropped", true);
final String CATEGORY_WEAPONS = CommonConfig.CATEGORY_WEAPONS;
linearAnimations = CommonConfig.createConfigBool(config, CATEGORY_WEAPONS, "18.00_linearAnimations", "Should heavily stylised weapon animations be replaced with more conventional ones?", false);
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.config.WeaponConfig;
import com.hbm.items.weapon.ItemGunBase;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
@ -49,16 +50,18 @@ public class ItemRenderWeaponShotty implements IItemRenderer {
switch(type) {
case EQUIPPED_FIRST_PERSON:
String animSuffix = WeaponConfig.linearAnimations ? "Lame" : "";
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-95F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-2.0F, 0.5F, -2.0F);
GL11.glTranslatef(-2.0F, 0.25F, -2.5F);
HbmAnimations.applyRelevantTransformation("Body");
HbmAnimations.applyRelevantTransformation("Body" + animSuffix);
ResourceManager.shotty.renderPart("Body");
HbmAnimations.applyRelevantTransformation("Barrel");
HbmAnimations.applyRelevantTransformation("Barrel" + animSuffix);
ResourceManager.shotty.renderPart("Barrel");
// If we've run out of ammo, stop drawing the shells after ejection has completed
@ -67,12 +70,12 @@ public class ItemRenderWeaponShotty implements IItemRenderer {
if(ItemGunBase.getBeltSize(player, ItemGunBase.getBeltType(player, item, true)) > 0 || millis < 1000) {
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("ShellL");
HbmAnimations.applyRelevantTransformation("ShellL" + animSuffix);
ResourceManager.shotty.renderPart("ShellL");
GL11.glPopMatrix();
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("ShellR");
HbmAnimations.applyRelevantTransformation("ShellR" + animSuffix);
ResourceManager.shotty.renderPart("ShellR");
GL11.glPopMatrix();
}

File diff suppressed because one or more lines are too long