Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Wavesonics committed Jun 16, 2023
2 parents 37cac53 + 903b43a commit 34195c2
Show file tree
Hide file tree
Showing 149 changed files with 2,260 additions and 413 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
uses: codecov/codecov-action@v3
ios:
runs-on: macos-latest
if: ${{ false }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish
on:
release:
types: [ published ]

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '**New release:** {{ EVENT_PAYLOAD.release.name }} **Download Here:** {{ EVENT_PAYLOAD.release.html_url }}'
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# ![Hammer Logo](readme/logo.png) Hammer: A story editor

A simple tool for building stories.

![MIT License](https://img.shields.io/github/license/Wavesonics/hammer-editor) [![CircleCI](https://img.shields.io/circleci/build/github/Wavesonics/hammer-editor/develop)](https://app.circleci.com/pipelines/github/Wavesonics/hammer-editor) [![codebeat badge](https://codebeat.co/badges/ff1a14c8-352e-495f-8b61-2d5d46061149)](https://codebeat.co/projects/github-com-wavesonics-hammer-editor-master) [![codecov](https://codecov.io/gh/Wavesonics/hammer-editor/branch/develop/graph/badge.svg)](https://codecov.io/gh/Wavesonics/hammer-editor) ![Latest Release](https://img.shields.io/github/v/release/Wavesonics/hammer-editor?include_prereleases)

![badge-platform-android] ![badge-platform-windows] ![badge-platform-linux]

[![Discord badge](https://img.shields.io/discord/1100282852295327744)](https://discord.gg/GTmgjZcupk)
[![Discord badge](https://img.shields.io/discord/1100282852295327744?logo=discord)](https://discord.gg/GTmgjZcupk)
[![Localization badge](https://hosted.weblate.org/widgets/hammer/-/clients/svg-badge.svg)](https://hosted.weblate.org/engage/hammer/)

A simple tool for building stories.
### _**Note:** This is currently Alpha quality software, users beware!_

Take a look at the [Roadmap](ROADMAP.md) to see whats coming.

Join our [Discord](https://discord.gg/GTmgjZcupk) and help us by reporting bugs, making feature requests, and discussing the future of Hammer.

## Multi-platform

Expand Down
53 changes: 53 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Roadmap

_**Note:** This is a one-man side project, so development velocity is slow and uneven. This roadmap is aspirational,
nothing
on here is a guaranteed, and I can't be sure when any of it will actually happen._

## Near-term

- **Client/Server syncing stabilization:** There's no known bugs, but this is by far the most likely feature to cause
user data loss, so it must be rock solid
- **Localization Support:** Move all strings into localization files, get setup with community localization service.
- **Quality of Life UI improvements:** The UI is ready for a second polish pass, focusing on quality of life
improvements.
- Word Count in text editor
- Draft selection editor
- Lots of work on Merge Conflict editors when syncing
- General work for larger screen sizes
- Confirm save on more entity types beyond just scenes

## Road to 1.0

- **Rich Text Editor 2.0:** This is one of the biggest weaknesses currently. The current text editor is buggy, has poor
performance with lots of text, and only supports rich text through ugly hacks. We're waiting on `BasicTextfield2`
coming later this year to build a more robust editor on.
- Spell check
- Possibly grammar check
- **Encyclopedia Improvements:** usability improvements
- Allow more characters to be used in the name
- Allow changing of entry type after creation
- Allow tag removal, addition after creation
- Tag search in browser
- More unit testing across the board
- Release for **MacOS**

## Post 1.0

- Release for **iOS**
- **Outlines:** write a short outline for each scene. Be able to see an overview of your story by reading only your
outlines in order.
- **Hemingway Mode:** Provide a distraction free writing experience. Very little UI, no spell check, ect.
- **Scene Notes:** add extra notes to a scene, remind your self what story beats to hit, or what tone to strike.
- **Scene/Encyclopedia Integration:**
- When you type the name of an entry in your encyclopedia, it will be hyper linked in-line to the entry.
- See a summary of which characters or locations appear in the scene
- **Story Insights**: Which scene two characters first appeared in together, possibly other stuff pulling from
encyclopedia and scenes
- **Encyclopedia 2.0:** Type specific templates, different fields for characters, locations, and more

## Further Future

- **Editor Requests:** Create a request for someone to edit a scene. A link to generated, and they can read and suggest
edits to the scene from a webpage. Then in-app, you can receive the edits and choose what to take.
- **Publish on Web:** Publish a story as a simple webview you can link people to.
1 change: 1 addition & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
android:name=".HammerApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.darkrockstudios.apps.hammer.common.AppCloseManager
import com.darkrockstudios.apps.hammer.common.components.projectroot.ProjectRoot
import com.darkrockstudios.apps.hammer.common.components.projectroot.ProjectRootComponent
import com.darkrockstudios.apps.hammer.common.compose.Ui
import com.darkrockstudios.apps.hammer.common.compose.moko.get
import com.darkrockstudios.apps.hammer.common.compose.theme.AppTheme
import com.darkrockstudios.apps.hammer.common.data.MenuDescriptor
import com.darkrockstudios.apps.hammer.common.data.ProjectDef
Expand Down Expand Up @@ -163,10 +164,10 @@ class ProjectRootActivity : AppCompatActivity() {
icon = {
Icon(
imageVector = getDestinationIcon(item),
contentDescription = item.text
contentDescription = item.text.get()
)
},
label = { Text(item.text) },
label = { Text(item.text.get()) },
selected = router.active.instance.getLocationType() == item,
onClick = {
scope.launch { drawerState.close() }
Expand All @@ -186,11 +187,11 @@ class ProjectRootActivity : AppCompatActivity() {

private fun confirmCloseDialog(component: AppCloseManager) {
AlertDialog.Builder(this)
.setTitle("Unsaved Scenes")
.setMessage("Save unsaved scenes?")
.setNegativeButton("Discard and close") { _, _ -> finish() }
.setNeutralButton("Cancel") { dialog, _ -> dialog.dismiss() }
.setPositiveButton("Save and close") { _, _ ->
.setTitle(R.string.unsaved_scenes_dialog_title)
.setMessage(R.string.unsaved_scenes_dialog_message)
.setNegativeButton(R.string.unsaved_scenes_dialog_negative_button) { _, _ -> finish() }
.setNeutralButton(R.string.unsaved_scenes_dialog_neutral_button) { dialog, _ -> dialog.dismiss() }
.setPositiveButton(R.string.unsaved_scenes_dialog_positive_button) { _, _ ->
lifecycleScope.launch {
component.storeDirtyBuffers()
withContext(mainDispatcher) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.darkrockstudios.apps.hammer.base.BuildMetadata
import com.darkrockstudios.apps.hammer.common.components.projectselection.ProjectSelection
import com.darkrockstudios.apps.hammer.common.components.projectselection.ProjectSelectionComponent
import com.darkrockstudios.apps.hammer.common.compose.Ui
import com.darkrockstudios.apps.hammer.common.compose.moko.get
import com.darkrockstudios.apps.hammer.common.compose.theme.AppTheme
import com.darkrockstudios.apps.hammer.common.data.ProjectDef
import com.darkrockstudios.apps.hammer.common.data.globalsettings.GlobalSettingsRepository
Expand Down Expand Up @@ -103,7 +104,7 @@ class ProjectSelectActivity : AppCompatActivity() {
topBar = {
SetStatusBar()
TopBar(
title = "Hammer",
title = getString(R.string.app_name),
drawerOpen = drawerState,
onButtonClicked = {
scope.launch {
Expand All @@ -125,7 +126,7 @@ class ProjectSelectActivity : AppCompatActivity() {
Spacer(Modifier.height(12.dp))
ProjectSelection.Locations.values().forEach { item ->
NavigationDrawerItem(
icon = { Icon(getLocationIcon(item), contentDescription = item.text) },
icon = { Icon(getLocationIcon(item), contentDescription = item.text.get()) },
label = { Text(item.name) },
selected = item == slot.child?.configuration?.location,
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.darkrockstudios.apps.hammer.common.data.MenuDescriptor

@Composable
Expand All @@ -27,7 +28,7 @@ fun TopAppBarDropdownMenu(
}) {
Icon(
Icons.Filled.MoreVert,
contentDescription = "More Menu",
contentDescription = stringResource(R.string.overflow_menu_button),
tint = MaterialTheme.colorScheme.onSurface
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.material.icons.filled.Menu
import androidx.compose.material.icons.filled.MenuOpen
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import com.darkrockstudios.apps.hammer.common.compose.Ui

@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -36,7 +37,7 @@ internal fun TopBar(
IconButton(onClick = { onButtonClicked() }) {
Icon(
icon,
contentDescription = "Nav Drawer",
contentDescription = stringResource(R.string.navdrawer_button),
)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment.Companion.End
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import androidx.work.Data
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.OutOfQuotaPolicy
import androidx.work.WorkManager
import com.darkrockstudios.apps.hammer.android.R
import com.darkrockstudios.apps.hammer.common.compose.Ui
import com.darkrockstudios.apps.hammer.common.compose.theme.AppTheme
import com.darkrockstudios.apps.hammer.common.data.ProjectDef
Expand All @@ -37,7 +39,7 @@ class AddNoteActivity : ComponentActivity(), KoinComponent {

val projects = projectsRepository.getProjects()
if (projects.isEmpty()) {
Toast.makeText(this, "No projects", Toast.LENGTH_SHORT).show()
Toast.makeText(this, getString(R.string.note_widget_toast_no_projects), Toast.LENGTH_SHORT).show()
finish()
} else {
setContent {
Expand All @@ -53,7 +55,7 @@ class AddNoteActivity : ComponentActivity(), KoinComponent {
modifier = Modifier.padding(Ui.Padding.XL)
) {
Text(
"Add Note to:",
stringResource(R.string.note_widget_dialog_title),
style = MaterialTheme.typography.headlineMedium,
color = MaterialTheme.colorScheme.onBackground
)
Expand All @@ -75,7 +77,7 @@ class AddNoteActivity : ComponentActivity(), KoinComponent {
}
}
) {
Text("Save")
Text(stringResource(R.string.note_widget_dialog_save_button))
}
}
}
Expand Down Expand Up @@ -107,7 +109,7 @@ class AddNoteActivity : ComponentActivity(), KoinComponent {
readOnly = true,
value = selectedOptionText,
onValueChange = { selectedOptionText = it },
label = { Text("Categories") },
label = { Text(stringResource(R.string.note_widget_dialog_categories_dropdown)) },
trailingIcon = {
ExposedDropdownMenuDefaults.TrailingIcon(
expanded = expanded
Expand Down Expand Up @@ -147,7 +149,7 @@ class AddNoteActivity : ComponentActivity(), KoinComponent {

WorkManager.getInstance(this).enqueue(request)

Toast.makeText(this, "Note Added", Toast.LENGTH_SHORT).show()
Toast.makeText(this, getString(R.string.note_widget_toast_success), Toast.LENGTH_SHORT).show()

finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.glance.GlanceId
import androidx.glance.GlanceModifier
Expand Down Expand Up @@ -42,7 +43,7 @@ class AddNoteWidget : GlanceAppWidget() {
Column {
Image(
ImageProvider(resId = R.drawable.ic_add_note),
contentDescription = "Add Note",
contentDescription = stringResource(R.string.note_widget_button_description),
modifier = GlanceModifier.fillMaxSize().clickable(
onClick = actionRunCallback<AddNoteClickAction>()
)
Expand All @@ -62,7 +63,7 @@ class AddNoteClickAction : ActionCallback {

val intent = Intent(context, AddNoteActivity::class.java)
.setFlags(FLAG_ACTIVITY_NEW_TASK)
.putExtra(AddNoteActivity.EXTRA_PROJECT_NAME, "Alice In Wonderland")
//.putExtra(AddNoteActivity.EXTRA_PROJECT_NAME, "Alice In Wonderland")
context.startActivity(intent)
}
}
22 changes: 22 additions & 0 deletions android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>

<monochrome>
<inset
android:insetLeft="25dp"
android:insetTop="25dp"
android:insetRight="25dp"
android:insetBottom="25dp">
<vector
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M9.738,10.3a0.516,0.516 0,0 0,-0.707 0L0.768,18.56a2.483,2.483 0,0 0,-0.733 1.768,2.564 2.564,0 0,0 2.5,2.5A2.481,2.481 0,0 0,4.3 22.1l8.263,-8.262a0.5,0.5 0,0 0,0 -0.707Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M23.524,9.236l-1.06,-1.061h0a1,1 0,0 0,-1.413 0,1.022 1.022,0 0,1 -1.414,0A1,1 0,0 1,19.413 7.1a1.5,1.5 0,0 0,-0.335 -1.607C17.646,4.056 17.07,3.48 16.785,3.249l0.007,-0.006A7.746,7.746 0,0 0,6.761 2.8a1,1 0,0 0,-0.348 1.138A1.013,1.013 0,0 0,7.4 4.6,5.014 5.014,0 0,1 11.15,6.055c0.518,0.518 0.78,0.917 0.78,1.186a0.41,0.41 0,0 1,-0.152 0.258L10.8,8.53a0.5,0.5 0,0 0,0 0.707l2.829,2.828a0.5,0.5 0,0 0,0.707 0L15.393,11a1.022,1.022 0,0 1,1.413 0,1 1,0 0,1 0,1.414 1,1 0,0 0,0 1.415l1.061,1.061a1.5,1.5 0,0 0,2.121 0l3.535,-3.537a1.5,1.5 0,0 0,0 -2.121Z"/>
</vector>
</inset>
</monochrome>
</adaptive-icon>
22 changes: 22 additions & 0 deletions android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>

<monochrome>
<inset
android:insetLeft="25dp"
android:insetTop="25dp"
android:insetRight="25dp"
android:insetBottom="25dp">
<vector
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M9.738,10.3a0.516,0.516 0,0 0,-0.707 0L0.768,18.56a2.483,2.483 0,0 0,-0.733 1.768,2.564 2.564,0 0,0 2.5,2.5A2.481,2.481 0,0 0,4.3 22.1l8.263,-8.262a0.5,0.5 0,0 0,0 -0.707Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M23.524,9.236l-1.06,-1.061h0a1,1 0,0 0,-1.413 0,1.022 1.022,0 0,1 -1.414,0A1,1 0,0 1,19.413 7.1a1.5,1.5 0,0 0,-0.335 -1.607C17.646,4.056 17.07,3.48 16.785,3.249l0.007,-0.006A7.746,7.746 0,0 0,6.761 2.8a1,1 0,0 0,-0.348 1.138A1.013,1.013 0,0 0,7.4 4.6,5.014 5.014,0 0,1 11.15,6.055c0.518,0.518 0.78,0.917 0.78,1.186a0.41,0.41 0,0 1,-0.152 0.258L10.8,8.53a0.5,0.5 0,0 0,0 0.707l2.829,2.828a0.5,0.5 0,0 0,0.707 0L15.393,11a1.022,1.022 0,0 1,1.413 0,1 1,0 0,1 0,1.414 1,1 0,0 0,0 1.415l1.061,1.061a1.5,1.5 0,0 0,2.121 0l3.535,-3.537a1.5,1.5 0,0 0,0 -2.121Z"/>
</vector>
</inset>
</monochrome>
</adaptive-icon>
20 changes: 20 additions & 0 deletions android/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unsaved_scenes_dialog_title">Nicht gespeicherte Szenen</string>
<string name="app_name">Hammer</string>
<string name="unsaved_scenes_dialog_neutral_button">Abbrechen</string>
<string name="unsaved_scenes_dialog_positive_button">Speichern und schließen</string>
<string name="unsaved_scenes_dialog_message">Ungespeicherte Szenen speichern\?</string>
<string name="unsaved_scenes_dialog_negative_button">Verwerfen und schließen</string>
<string name="loading">Laden…</string>
<string name="title_activity_configure_note_widget">Widget konfigurieren</string>
<string name="title_activity_add_note">Notiz hinzufügen</string>
<string name="overflow_menu_button">Mehr</string>
<string name="navdrawer_button">Navigation</string>
<string name="note_widget_dialog_save_button">Speichern</string>
<string name="note_widget_dialog_categories_dropdown">Kategorien</string>
<string name="note_widget_button_description">Notiz hinzugefügen</string>
<string name="note_widget_toast_no_projects">Keine Projekte bisher</string>
<string name="note_widget_dialog_title">Notiz hinzufügen:</string>
<string name="note_widget_toast_success">Notiz hinzugefügt</string>
</resources>
16 changes: 16 additions & 0 deletions android/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hammer</string>
<string name="unsaved_scenes_dialog_title">Escenas sin guardar</string>
<string name="title_activity_add_note">Agregar nota</string>
<string name="unsaved_scenes_dialog_message">¿Desea guardar las escenas sin guardar\?</string>
<string name="loading">Cargando…</string>
<string name="unsaved_scenes_dialog_negative_button">Descartar y cerrar</string>
<string name="title_activity_configure_note_widget">Configurar Widget</string>
<string name="unsaved_scenes_dialog_neutral_button">Cancelar</string>
<string name="unsaved_scenes_dialog_positive_button">Guardar y cerrar</string>
<string name="note_widget_dialog_title">Agregar nota a:</string>
<string name="note_widget_dialog_save_button">Guardar</string>
<string name="note_widget_dialog_categories_dropdown">Categorías</string>
<string name="note_widget_button_description">Agregar nota</string>
</resources>
Loading

0 comments on commit 34195c2

Please sign in to comment.